libcdio-paranoia 10.2+2.0.2
|
The top-level interface header for libcdio_cdda. Applications include this for paranoia access. More...
#include <cdio/cdio.h>
#include <signal.h>
Go to the source code of this file.
Data Structures | |
struct | TOC_s |
Structure for cdparanoia's CD Table of Contents. More... | |
struct | cdrom_drive_s |
Structure for cdparanoia's CD-ROM access. More... | |
Typedefs | |
typedef struct cdrom_paranoia_s | cdrom_paranoia_t |
typedef struct cdrom_drive_s | cdrom_drive_t |
typedef struct TOC_s | TOC_t |
Structure for cdparanoia's CD Table of Contents. More... | |
Enumerations | |
enum | paranoia_cdda_enums_t { CDDA_MESSAGE_FORGETIT = 0 , CDDA_MESSAGE_PRINTIT = 1 , CDDA_MESSAGE_LOGIT = 2 , CD_FRAMESAMPLES = CDIO_CD_FRAMESIZE_RAW / 4 , MAXTRK = (CDIO_CD_MAX_TRACKS+1) } |
enum | paranoia_jitter_t { CDDA_TEST_JITTER_SMALL = 1 , CDDA_TEST_JITTER_LARGE = 2 , CDDA_TEST_JITTER_MASSIVE = 3 , CDDA_TEST_FRAG_SMALL = (1<<3) , CDDA_TEST_FRAG_LARGE = (2<<3) , CDDA_TEST_FRAG_MASSIVE = (3<<3) , CDDA_TEST_UNDERRUN = 64 } |
enum | transport_error_t { TR_OK = 0 , TR_EWRITE = 1 , TR_EREAD = 2 , TR_UNDERRUN = 3 , TR_OVERRUN = 4 , TR_ILLEGAL = 5 , TR_MEDIUM = 6 , TR_BUSY = 7 , TR_NOTREADY = 8 , TR_FAULT = 9 , TR_UNKNOWN = 10 , TR_STREAMING = 11 } |
Variables | |
paranoia_jitter_t | debug_paranoia_jitter |
paranoia_cdda_enums_t | debug_paranoia_cdda_enums |
The top-level interface header for libcdio_cdda. Applications include this for paranoia access.
#define cdda_close cdio_cddap_close |
#define cdda_disc_firstsector cdio_cddap_disc_firstsector |
#define cdda_disc_lastsector cdio_cddap_disc_lastsector |
#define cdda_errors cdio_cddap_errors |
#define cdda_find_a_cdrom cdio_cddap_find_a_cdrom |
Errors returned by lib:
001: Unable to set CDROM to read audio mode 002: Unable to read table of contents lead-out 003: CDROM reporting illegal number of tracks 004: Unable to read table of contents header 005: Unable to read table of contents entry 006: Could not read any data from drive 007: Unknown, unrecoverable error reading data 008: Unable to identify CDROM model 009: CDROM reporting illegal table of contents 010: Unaddressable sector 100: Interface not supported 101: Drive is neither a CDROM nor a WORM device 102: Permision denied on cdrom (ioctl) device 103: Permision denied on cdrom (data) device 300: Kernel memory error 400: Device not open 401: Invalid track number 402: Track not audio data 403: No audio tracks on disc 404: No medium present 405: Option not supported by drive
For compatibility with good ol' paranoia
#define cdda_identify cdio_cddap_identify |
#define cdda_messages cdio_cddap_messages |
#define cdda_open cdio_cddap_open |
#define cdda_read cdio_cddap_read |
#define cdda_read_timed cdio_cddap_read_timed |
#define cdda_sector_gettrack cdio_cddap_sector_gettrack |
#define cdda_speed_set cdio_cddap_speed_set |
#define CDDA_TEST_ALWAYS_JITTER 4 |
jitter testing. The first two bits are set to determine the byte-distance we will jitter the data; 0 is no shifting. < jitter testing. Set the below bit to always cause jittering on reads. The below bit only has any effect if the first two (above) bits are nonzero. If the above bits are set, but the below bit isn't we'll jitter 90% of the time.
#define CDDA_TEST_FRAG_LARGE (2<<3) |
#define CDDA_TEST_FRAG_MASSIVE (3<<3) |
under-run testing. The below bit is set for testing.
#define CDDA_TEST_FRAG_SMALL (1<<3) |
fragment testing
#define CDDA_TEST_UNDERRUN 64 |
#define cdda_track_audiop cdio_cddap_track_audiop |
#define cdda_track_channels cdio_cddap_track_channels |
#define cdda_track_copyp cdio_cddap_track_copyp |
#define cdda_track_firstsector cdio_cddap_track_firstsector |
#define cdda_track_lastsector cdio_cddap_track_lastsector |
#define cdda_track_preemp cdio_cddap_track_preemp |
#define cdda_tracks cdio_cddap_tracks |
#define cdda_verbose_set cdio_cddap_verbose_set |
#define cdda_version cdio_cddap_version |
#define cdrom_drive cdrom_drive_t |
#define MAXTRK (CDIO_CD_MAX_TRACKS+1) |
We keep MAXTRK since this header is exposed publicly and other programs may have used this.
#define TOC TOC_t |
For compatibility. TOC is deprecated, use TOC_t instead.
typedef struct cdrom_drive_s cdrom_drive_t |
typedef struct cdrom_paranoia_s cdrom_paranoia_t |
cdrom_paranoia is an opaque structure which is used in all of the library operations.
For compatibility. cdrom_drive_t is deprecated, use cdrom_drive_t instead. Flags for simulating jitter used in testing.
The enumeration type one probably wouldn't really use in a program. It is here instead of defines to give symbolic names that can be helpful in debuggers where wants just to say refer to CDDA_TEST_JITTER_SMALL and get the correct value.
Enumerator | |
---|---|
CDDA_MESSAGE_FORGETIT | |
CDDA_MESSAGE_PRINTIT | |
CDDA_MESSAGE_LOGIT | |
CD_FRAMESAMPLES | |
MAXTRK |
enum paranoia_jitter_t |
Flags for simulating jitter used in testing.
The enumeration type one probably wouldn't really use in a program. It is here instead of defines to give symbolic names that can be helpful in debuggers where wants just to say refer to CDDA_TEST_JITTER_SMALL and get the correct value.
Enumerator | |
---|---|
CDDA_TEST_JITTER_SMALL | |
CDDA_TEST_JITTER_LARGE | |
CDDA_TEST_JITTER_MASSIVE | |
CDDA_TEST_FRAG_SMALL | |
CDDA_TEST_FRAG_LARGE | |
CDDA_TEST_FRAG_MASSIVE | |
CDDA_TEST_UNDERRUN |
enum transport_error_t |
transport errors:
int cdio_cddap_close | ( | cdrom_drive_t * | d | ) |
Closes d and releases all storage associated with it. Doubles as "cdrom_drive_free()".
d | cdrom_drive_t object to be closed. |
bool cdio_cddap_close_no_free_cdio | ( | cdrom_drive_t * | d | ) |
Closes d and releases all storage associated with it except the internal p_cdio pointer.
d | cdrom_drive_t object to be closed. |
lsn_t cdio_cddap_disc_firstsector | ( | cdrom_drive_t * | d | ) |
Get first lsn of the first audio track. -1 is returned on error.
lsn_t cdio_cddap_disc_lastsector | ( | cdrom_drive_t * | d | ) |
Get last lsn of the last audio track. The last lsn is generally one less than the start of the next track after the audio track. -1 is returned on error.
char * cdio_cddap_errors | ( | cdrom_drive_t * | d | ) |
Returns the current error buffer. Free the returned string using cdio_cddap_free_messages() if not NULL.
cdrom_drive_t * cdio_cddap_find_a_cdrom | ( | int | messagedest, |
char ** | ppsz_message | ||
) |
autosense functions Get a CD-ROM drive with a CD-DA in it. If mesagedest is CDDA_MESSAGE_LOGIT, then any messages in the process will be stored in message.
When using CDDA_MESSAGE_LOGIT, free the message buffer with cdio_cddap_free_messages() after use.
void cdio_cddap_free_messages | ( | char * | psz_messages | ) |
Frees the message string passed in psz_messages.
References NULL.
cdrom_drive_t * cdio_cddap_identify | ( | const char * | psz_dev, |
int | messagedest, | ||
char ** | ppsz_messages | ||
) |
Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL if there was an error.
When using CDDA_MESSAGE_LOGIT, free the message buffer with cdio_cddap_free_messages() after use.
Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL if there was an error.
References idmessage(), and NULL.
cdrom_drive_t * cdio_cddap_identify_cdio | ( | CdIo_t * | p_cdio, |
int | messagedest, | ||
char ** | ppsz_messages | ||
) |
Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL if there was an error. In contrast to cdio_cddap_identify, we start out with an initialized p_cdio object. For example you may have used that for other purposes such as to get CDDB/CD-Text information.
When using CDDA_MESSAGE_LOGIT, free the message buffer with cdio_cddap_free_messages() after use.
Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL if there was an error. In contrast to cdio_cddap_identify, we start out with an initialized p_cdio object. For example you may have used that for other purposes such as to get CDDB/CD-Text information.
References idmessage(), and NULL.
char * cdio_cddap_messages | ( | cdrom_drive_t * | d | ) |
Returns the current message buffer. Free the returned string using cdio_cddap_free_messages() if not NULL.
int cdio_cddap_open | ( | cdrom_drive_t * | d | ) |
long cdio_cddap_read | ( | cdrom_drive_t * | d, |
void * | p_buffer, | ||
lsn_t | beginsector, | ||
long | sectors | ||
) |
long cdio_cddap_read_timed | ( | cdrom_drive_t * | d, |
void * | p_buffer, | ||
lsn_t | beginsector, | ||
long | sectors, | ||
int * | milliseconds | ||
) |
int cdio_cddap_sector_gettrack | ( | cdrom_drive_t * | d, |
lsn_t | lsn | ||
) |
Return the track containing the given LSN. If the LSN is before the first track (in the pregap), 0 is returned. If there was an error or the LSN after the LEADOUT (beyond the end of the CD), then CDIO_INVALID_TRACK is returned.
int cdio_cddap_speed_set | ( | cdrom_drive_t * | d, |
int | speed | ||
) |
drive-oriented functions
int cdio_cddap_track_audiop | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Return 1 is track is an audio track, 0 otherwise.
int cdio_cddap_track_channels | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Return the number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track.
int cdio_cddap_track_copyp | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Return 1 is track has copy permit set, 0 otherwise.
Return 1 is track is an audio track, 0 otherwise.
lsn_t cdio_cddap_track_firstsector | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Return the lsn for the start of track i_track
lsn_t cdio_cddap_track_lastsector | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Get last lsn of the track. This generally one less than the start of the next track. -1 is returned on error.
int cdio_cddap_track_preemp | ( | cdrom_drive_t * | d, |
track_t | i_track | ||
) |
Return 1 is audio track has linear preemphasis set, 0 otherwise. Only makes sense for audio tracks.
track_t cdio_cddap_tracks | ( | cdrom_drive_t * | d | ) |
Return the number of tracks on the CD.
void cdio_cddap_verbose_set | ( | cdrom_drive_t * | d, |
int | err_action, | ||
int | mes_action | ||
) |
const char * cdio_cddap_version | ( | void | ) |
informational functions
References LIBCDIO_PARANOIA_VERSION.
int data_bigendianp | ( | cdrom_drive_t * | d | ) |
Determine Endian-ness of the CD-drive based on reading data from it. Some drives return audio data Big Endian while some (most) return data Little Endian. Drives known to return data bigendian are SCSI drives from Kodak, Ricoh, HP, Philips, Plasmon, Grundig CDR100IPW, and Mitsumi CD-R. ATAPI and MMC drives are little endian.
rocky: As someone who didn't write the code, I have to say this is nothing less than brilliant. An FFT is done both ways and the the transform is looked at to see which has data in the FFT (or audible) portion. (Or so that's how I understand it.)
|
extern |
|
extern |
The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions
CD-ROM code which interfaces between user-level visible CD paranoia routines and libddio routines. (There is some GNU/Linux-specific code here too that should probably be removed. The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions