2
$Id: cdio.hpp,v 1.12 2006/03/11 04:15:35 rocky Exp $
4
Copyright (C) 2005, 2006 Rocky Bernstein <rocky@panix.com>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
* \brief C++ class for libcdio: the CD Input and Control
24
* library. Applications use this for anything regarding libcdio.
30
#include <cdio/cdio.h>
31
#include <cdio/audio.h>
35
// Make pre- and post-increment operators for enums in libcdio where it
37
#include <cdio++/enum.hpp>
39
/** Class for driver exceptions. **/
40
class DriverOpException
43
driver_return_code_t driver_return_code;
44
DriverOpException( void ) { };
45
DriverOpException( driver_return_code_t drc ) {
46
driver_return_code = drc;
48
driver_return_code_t get_code(void) {
49
return driver_return_code;
51
const char *get_msg(void) {
52
return cdio_driver_errmsg(driver_return_code);
56
class DriverOpError: public DriverOpException
59
DriverOpError(void) { driver_return_code = DRIVER_OP_ERROR; }
62
class DriverOpUnsupported: public DriverOpException
65
DriverOpUnsupported(void) { driver_return_code = DRIVER_OP_UNSUPPORTED; }
68
class DriverOpUninit: public DriverOpException
71
DriverOpUninit(void) { driver_return_code = DRIVER_OP_UNINIT; }
74
class DriverOpNotPermitted: public DriverOpException
77
DriverOpNotPermitted(void) {driver_return_code = DRIVER_OP_NOT_PERMITTED;}
80
class DriverOpBadParameter: public DriverOpException
83
DriverOpBadParameter(void) {driver_return_code = DRIVER_OP_BAD_PARAMETER;}
86
class DriverOpBadPointer: public DriverOpException
89
DriverOpBadPointer(void) {driver_return_code = DRIVER_OP_BAD_POINTER;}
92
class DriverOpNoDriver: public DriverOpException
95
DriverOpNoDriver(void) {driver_return_code = DRIVER_OP_NO_DRIVER;}
98
void possible_throw_device_exception(driver_return_code_t drc);
100
/** A class relating to CD-Text. Use invalid track number 0 to specify
101
CD-Text for the CD (as opposed to a specific track).
106
CdioCDText(cdtext_t *p)
109
cdtext_init(p); // make sure we're initialized on the C side
114
cdtext_destroy(p_cdtext);
115
p_cdtext = (cdtext_t *) NULL;
118
// Other member functions
119
#include "cdtext.hpp"
125
/** A class relating to tracks. A track object basically saves device
126
and track number information so that in track operations these
127
don't have be specified.
133
CdioTrack(CdIo_t *p, track_t t)
139
// Other member functions
147
/** A class relating to a CD-ROM device or pseudo CD-ROM device with
148
has a particular CD image. A device basically saves the libcdio
149
"object" (of type CdIo *).
162
p_cdio = (CdIo_t *) NULL;
167
cdio_destroy(p_cdio);
168
p_cdio = (CdIo_t *) NULL;
171
// Other member functions
172
#include "device.hpp"
179
/* Things related to devices. No class or object is needed. */
180
#include "devices.hpp"
182
#endif /* __CDIO_HPP__ */