filename | src/gdrom/gdrom.h |
changeset | 678:35eb00945316 |
prev | 644:ccae4bfa5f82 |
next | 709:18c39a8e504c |
author | nkeynes |
date | Thu Jun 19 04:40:37 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Refactor the gd-rom list management out of the GUI (devices, recent files, etc). Add gd-rom list to the cocoa UI. |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * This file defines the public structures and functions exported by the
5 * GD-Rom subsystem
6 *
7 * Copyright (c) 2005 Nathan Keynes.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
20 #ifndef lxdream_gdrom_H
21 #define lxdream_gdrom_H 1
23 #include "lxdream.h"
24 #include "hook.h"
25 #include <glib/glist.h>
27 typedef uint16_t gdrom_error_t;
29 typedef struct gdrom_disc *gdrom_disc_t;
31 typedef gboolean (*gdrom_disc_change_hook_t)( gdrom_disc_t new_disc, const gchar *new_disc_name, void *user_data );
33 DECLARE_HOOK(gdrom_disc_change_hook, gdrom_disc_change_hook_t);
35 /**
36 * Open an image file
37 */
38 gdrom_disc_t gdrom_image_open( const gchar *filename );
40 /**
41 * Dump image info
42 */
43 void gdrom_image_dump_info( gdrom_disc_t d );
46 /**
47 * Shortcut to open and mount an image file
48 * @return true on success
49 */
50 gboolean gdrom_mount_image( const gchar *filename );
52 void gdrom_mount_disc( gdrom_disc_t disc );
54 void gdrom_unmount_disc( void );
56 gboolean gdrom_is_mounted( void );
58 gdrom_disc_t gdrom_get_current_disc();
60 const gchar *gdrom_get_current_disc_name();
62 GList *gdrom_get_native_devices();
64 uint32_t gdrom_read_sectors( uint32_t sector, uint32_t sector_count,
65 int mode, unsigned char *buf, uint32_t *length );
68 /**
69 * Retrieve the disc table of contents, and write it into the buffer in the
70 * format expected by the DC.
71 * @return 0 on success, error code on failure (eg no disc mounted)
72 */
73 gdrom_error_t gdrom_get_toc( unsigned char *buf );
75 /**
76 * Retrieve the short (6-byte) session info, and write it into the buffer.
77 * @return 0 on success, error code on failure.
78 */
79 gdrom_error_t gdrom_get_info( unsigned char *buf, int session );
81 uint8_t gdrom_get_track_no_by_lba( uint32_t lba );
83 #endif
.