libcdio  0.83
cdda.h
Go to the documentation of this file.
1 /*
2  $Id: cdda.h,v 1.30 2008/03/25 15:59:08 karl Exp $
3 
4  Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
5  Copyright (C) 2001 Xiph.org and Heiko Eissfeldt heiko@escape.colossus.de
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
28 #ifndef _CDDA_INTERFACE_H_
29 #define _CDDA_INTERFACE_H_
30 
31 #include <cdio/cdio.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36 
40  typedef struct cdrom_paranoia_s cdrom_paranoia_t;
41  typedef struct cdrom_drive_s cdrom_drive_t;
42 
54  typedef enum {
61 
62 
63 #include <signal.h>
64 
68 #define MAXTRK (CDIO_CD_MAX_TRACKS+1)
69 
71 typedef struct TOC_s {
72  unsigned char bTrack;
73  int32_t dwStartSector;
74 } TOC_t;
75 
77 #define TOC TOC_t
78 
80 struct cdrom_drive_s {
81 
83  int opened;
86 
87  char *drive_model;
89  int bigendianp;
93  int nsectors;
97  int cd_extra;
114 
117  char *errorbuf;
118  char *messagebuf;
119 
120  /* functions specific to particular drives/interfaces */
121 
122  int (*enable_cdda) (cdrom_drive_t *d, int onoff);
123  int (*read_toc) (cdrom_drive_t *d);
124  long (*read_audio) (cdrom_drive_t *d, void *p, lsn_t begin,
125  long sectors);
126  int (*set_speed) (cdrom_drive_t *d, int speed);
129 
130  int is_atapi;
131  int is_mmc;
132 
138 };
139 
140 
149  typedef enum {
158 
168 #define CDDA_TEST_ALWAYS_JITTER 4
169 
171 #define CDDA_TEST_FRAG_SMALL (1<<3)
172 #define CDDA_TEST_FRAG_LARGE (2<<3)
173 #define CDDA_TEST_FRAG_MASSIVE (3<<3)
174 
176 #define CDDA_TEST_UNDERRUN 64
177 
178 #if TESTING_IS_FINISHED
179 
181 #define CDDA_TEST_SCRATCH 128
182 #undef CDDA_TEST_BOGUS_BYTES 256
183 #undef CDDA_TEST_DROPDUPE_BYTES 512
184 #endif /* TESTING_IS_FINISHED */
185 
192 extern cdrom_drive_t *cdio_cddap_find_a_cdrom(int messagedest,
193  char **ppsz_message);
194 
199 extern cdrom_drive_t *cdio_cddap_identify(const char *psz_device,
200  int messagedest,
201  char **ppsz_message);
202 
210  int messagedest, char **ppsz_messages);
211 
214 extern int cdio_cddap_speed_set(cdrom_drive_t *d, int speed);
215 extern void cdio_cddap_verbose_set(cdrom_drive_t *d, int err_action,
216  int mes_action);
217 extern char *cdio_cddap_messages(cdrom_drive_t *d);
218 extern char *cdio_cddap_errors(cdrom_drive_t *d);
219 
231 
242 extern int cdio_cddap_close(cdrom_drive_t *d);
243 
244 extern int cdio_cddap_open(cdrom_drive_t *d);
245 
246 extern long cdio_cddap_read(cdrom_drive_t *d, void *p_buffer,
247  lsn_t beginsector, long sectors);
248 
251  track_t i_track);
252 
256 
259 
266 
271 extern int cdio_cddap_track_channels(cdrom_drive_t *d, track_t i_track);
272 
274 extern int cdio_cddap_track_audiop(cdrom_drive_t *d, track_t i_track);
275 
277 extern int cdio_cddap_track_copyp(cdrom_drive_t *d, track_t i_track);
278 
282 extern int cdio_cddap_track_preemp(cdrom_drive_t *d, track_t i_track);
283 
286 
291 
306 extern int data_bigendianp(cdrom_drive_t *d);
307 
310 typedef enum {
311  TR_OK = 0,
312  TR_EWRITE = 1 ,
313  TR_EREAD = 2 ,
317  TR_MEDIUM = 6 ,
318  TR_BUSY = 7 ,
320  TR_FAULT = 9 ,
321  TR_UNKNOWN = 10 ,
324 
325 
326 #ifdef NEED_STRERROR_TR
327 const char *strerror_tr[]={
328  "Success",
329  "Error writing packet command to device",
330  "Error reading command from device",
331  "SCSI packet data underrun (too little data)",
332  "SCSI packet data overrun (too much data)",
333  "Illegal SCSI request (rejected by target)",
334  "Medium reading data from medium",
335  "Device busy",
336  "Device not ready",
337  "Target hardware fault",
338  "Unspecified error",
339  "Drive lost streaming"
340 };
341 #endif /*NEED_STERROR_TR*/
342 
372 #ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY
373 
374 #define cdda_find_a_cdrom cdio_cddap_find_a_cdrom
375 #define cdda_identify cdio_cddap_identify
376 #define cdda_speed_set cdio_cddap_speed_set
377 #define cdda_verbose_set cdio_cddap_verbose_set
378 #define cdda_messages cdio_cddap_messages
379 #define cdda_errors cdio_cddap_errors
380 #define cdda_close cdio_cddap_close
381 #define cdda_open cdio_cddap_open
382 #define cdda_read cdio_cddap_read
383 #define cdda_track_firstsector cdio_cddap_track_firstsector
384 #define cdda_track_lastsector cdio_cddap_track_lastsector
385 #define cdda_tracks cdio_cddap_tracks
386 #define cdda_sector_gettrack cdio_cddap_sector_gettrack
387 #define cdda_track_channels cdio_cddap_track_channels
388 #define cdda_track_audiop cdio_cddap_track_audiop
389 #define cdda_track_copyp cdio_cddap_track_copyp
390 #define cdda_track_preemp cdio_cddap_track_preemp
391 #define cdda_disc_firstsector cdio_cddap_disc_firstsector
392 #define cdda_disc_lastsector cdio_cddap_disc_lastsector
393 #define cdrom_drive cdrom_drive_t
394 
395 #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
396 
397 #ifdef __cplusplus
398 }
399 #endif /* __cplusplus */
400 
409 
410 #endif /*_CDDA_INTERFACE_H_*/
411 

Generated for libcdio by doxygen 1.8.1.1