#include <cdio/cdio.h>
#include <signal.h>
Go to the source code of this file.
#define CD_FRAMESAMPLES (CDIO_CD_FRAMESIZE_RAW / 4) |
#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 |
For compatibility with good ol' paranoia
#define cdda_identify cdio_cddap_identify |
#define CDDA_MESSAGE_FORGETIT 0 |
#define CDDA_MESSAGE_LOGIT 2 |
#define CDDA_MESSAGE_PRINTIT 1 |
#define cdda_messages cdio_cddap_messages |
#define cdda_open cdio_cddap_open |
#define cdda_read cdio_cddap_read |
#define cdda_sector_gettrack cdio_cddap_sector_gettrack |
#define cdda_speed_set cdio_cddap_speed_set |
#define CDDA_TEST_ALWAYS_JITTER 4 |
#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_JITTER_LARGE 2 |
#define CDDA_TEST_JITTER_MASSIVE 3 |
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_JITTER_SMALL 1 |
jitter testing. The first two bits are set to determine the byte-distance we will jitter the data; 0 is no shifting.
#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 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.
enum paranoia_cdda_enums |
An enumeration for some of the CDDA_TEST_* #defines below. This isn't really an enumeration one would really use in a program. The enumeration is created be helpful in debuggers where wants just to refer to the CDDA_TEST_ names and get something.
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 | ) |
cdrom_drive_t* cdio_cddap_find_a_cdrom | ( | int | messagedest, | |
char ** | ppsz_message | |||
) |
Get a CD-ROM drive with a CD-DA in it. If mesagedest is 1, then any messages in the process will be stored in message.
cdrom_drive_t* cdio_cddap_identify | ( | const char * | psz_device, | |
int | messagedest, | |||
char ** | ppsz_message | |||
) |
Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL if there was an error.
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.
char* cdio_cddap_messages | ( | cdrom_drive_t * | d | ) |
int cdio_cddap_open | ( | cdrom_drive_t * | d | ) |
long cdio_cddap_read | ( | cdrom_drive_t * | d, | |
void * | p_buffer, | |||
lsn_t | beginsector, | |||
long | sectors | |||
) |
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.
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 | |||
) |
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.)