filename | src/drivers/cdrom/drive.h |
changeset | 1097:d4807997e450 |
next | 1296:30ecee61f811 |
author | nkeynes |
date | Sat Aug 04 08:46:28 2012 +1000 (11 years ago) |
permissions | -rw-r--r-- |
last change | Handle corner case in pvr2_run_slice when we've previously slightly overrun the end of the time slice |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * Host CD/DVD drive support.
5 *
6 * This module supplies functions to enumerate the physical drives in the
7 * host system, and open them as a cdrom disc.
8 *
9 * Note that cdrom_disc_t objects bound to a physical drive may update their
10 * TOC at any time, including setting disc_type to CDROM_DISC_NONE (to indicate
11 * no media present).
12 *
13 * Copyright (c) 2009 Nathan Keynes.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 */
26 #ifndef cdrom_drive_H
27 #define cdrom_drive_H 1
29 #include <glib/glist.h>
30 #include "hook.h"
31 #include "drivers/cdrom/defs.h"
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
38 typedef struct cdrom_drive *cdrom_drive_t;
40 typedef cdrom_disc_t (*cdrom_drive_open_fn_t)(cdrom_drive_t, ERROR *);
42 /**
43 * A cdrom_device is a placeholder for a physical CD/DVD drive in the host
44 * system.
45 */
46 struct cdrom_drive {
47 /**
48 * System name for the device
49 */
50 const char *name;
51 /**
52 * Human-readable name of the device - normally the device's vendor
53 * and product name as returned by an Inquiry request.
54 */
55 const char *display_name;
57 /**
58 * Implementation specific function to open the drive, returning a new
59 * cdrom_disc_t.
60 */
61 cdrom_drive_open_fn_t open;
62 };
64 typedef gboolean (*cdrom_drive_list_change_hook_t)( GList *drive_list, void *user_data );
65 DECLARE_HOOK(cdrom_drive_list_change_hook, cdrom_drive_list_change_hook_t);
68 /**
69 * Native CD-ROM API - provided by drivers/cd_*.c
70 *
71 * A device name is either a system special file (most unixes) or a url of the
72 * form dvd://<identifier> or cd://<identifier>, where <identifier> is a system
73 * defined string that uniquely identifies a particular device.
74 */
76 /**
77 * Return a list of cdrom_drive_t defining all CD/DVD drives in the host system.
78 */
79 GList *cdrom_drive_get_list();
81 /**
82 *
83 */
84 cdrom_drive_t cdrom_drive_find( const char *name );
86 /**
87 * Open a cdrom_drive_t previously obtained from the system.
88 *
89 * @return NULL on failure, otherwise a valid cdrom_disc_t that can be mounted.
90 */
91 cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err );
93 #ifdef __cplusplus
94 }
95 #endif
97 #endif /* !cdrom_drive_H */
.