paranoia.h File Reference

The top-level header for libcdda_paranoia: a device- and OS- independent library for reading CD-DA with error tolerance and repair. Applications include this for paranoia access. More...

#include <cdio/cdda.h>

Go to the source code of this file.

Defines

#define CD_FRAMEWORDS   (CDIO_CD_FRAMESIZE_RAW/2)
#define PARANOIA_MODE_FULL   0xff
#define PARANOIA_MODE_DISABLE   0
#define PARANOIA_MODE_VERIFY   1
#define PARANOIA_MODE_FRAGMENT   2
#define PARANOIA_MODE_OVERLAP   4
#define PARANOIA_MODE_SCRATCH   8
#define PARANOIA_MODE_REPAIR   16
#define PARANOIA_MODE_NEVERSKIP   32
#define paranoia_init   cdio_paranoia_init
#define paranoia_free   cdio_paranoia_free
#define paranoia_modeset   cdio_paranoia_modeset
#define paranoia_seek   cdio_paranoia_seek
#define paranoia_read   cdio_paranoia_read
#define paranoia_read_limited   cdio_paranoia_read_limited
#define paranoia_overlapset   cdio_paranoia_overlapset
#define paranoia_set_range   cdio_paranoia_read_overlapset

Enumerations

enum  paranoia_cb_mode_t {
  PARANOIA_CB_READ, PARANOIA_CB_VERIFY, PARANOIA_CB_FIXUP_EDGE, PARANOIA_CB_FIXUP_ATOM,
  PARANOIA_CB_SCRATCH, PARANOIA_CB_REPAIR, PARANOIA_CB_SKIP, PARANOIA_CB_DRIFT,
  PARANOIA_CB_BACKOFF, PARANOIA_CB_OVERLAP, PARANOIA_CB_FIXUP_DROPPED, PARANOIA_CB_FIXUP_DUPED,
  PARANOIA_CB_READERR
}

Functions

cdrom_paranoia_tcdio_paranoia_init (cdrom_drive_t *d)
void cdio_paranoia_free (cdrom_paranoia_t *p)
void cdio_paranoia_modeset (cdrom_paranoia_t *p, int mode)
lsn_t cdio_paranoia_seek (cdrom_paranoia_t *p, off_t seek, int whence)
int16_t * cdio_paranoia_read (cdrom_paranoia_t *p, void(*callback)(long int, paranoia_cb_mode_t))
int16_t * cdio_paranoia_read_limited (cdrom_paranoia_t *p, void(*callback)(long int, paranoia_cb_mode_t), int max_retries)
void cdio_paranoia_overlapset (cdrom_paranoia_t *p, long overlap)
void cdio_paranoia_set_range (cdrom_paranoia_t *p, long int start, long int end)

Variables

const char * paranoia_cb_mode2str []


Detailed Description

The top-level header for libcdda_paranoia: a device- and OS- independent library for reading CD-DA with error tolerance and repair. Applications include this for paranoia access.


Define Documentation

#define CD_FRAMEWORDS   (CDIO_CD_FRAMESIZE_RAW/2)

Paranoia likes to work with 16-bit numbers rather than (possibly byte-swapped) bytes. So there are this many 16-bit numbers block (frame, or sector) read.

#define paranoia_free   cdio_paranoia_free

#define paranoia_init   cdio_paranoia_init

For compatibility with good ol' paranoia

#define PARANOIA_MODE_DISABLE   0

#define PARANOIA_MODE_FRAGMENT   2

#define PARANOIA_MODE_FULL   0xff

! Flags used in paranoia_modeset.

#define PARANOIA_MODE_NEVERSKIP   32

#define PARANOIA_MODE_OVERLAP   4

#define PARANOIA_MODE_REPAIR   16

#define PARANOIA_MODE_SCRATCH   8

#define PARANOIA_MODE_VERIFY   1

#define paranoia_modeset   cdio_paranoia_modeset

#define paranoia_overlapset   cdio_paranoia_overlapset

#define paranoia_read   cdio_paranoia_read

#define paranoia_read_limited   cdio_paranoia_read_limited

#define paranoia_seek   cdio_paranoia_seek

#define paranoia_set_range   cdio_paranoia_read_overlapset


Enumeration Type Documentation

enum paranoia_cb_mode_t

Enumerator:
PARANOIA_CB_READ 
PARANOIA_CB_VERIFY 
PARANOIA_CB_FIXUP_EDGE 
PARANOIA_CB_FIXUP_ATOM 
PARANOIA_CB_SCRATCH 
PARANOIA_CB_REPAIR 
PARANOIA_CB_SKIP 
PARANOIA_CB_DRIFT 
PARANOIA_CB_BACKOFF 
PARANOIA_CB_OVERLAP 
PARANOIA_CB_FIXUP_DROPPED 
PARANOIA_CB_FIXUP_DUPED 
PARANOIA_CB_READERR 


Function Documentation

void cdio_paranoia_free ( cdrom_paranoia_t p  ) 

Free any resources associated with obj.

See also:
paranoia_init.

cdrom_paranoia_t* cdio_paranoia_init ( cdrom_drive_t d  ) 

Get and initialize a new cdrom_paranoia object from cdrom_drive. Run this before calling any of the other paranoia routines below.

Returns:
new cdrom_paranoia object Call paranoia_free() when you are done with it

void cdio_paranoia_modeset ( cdrom_paranoia_t p,
int  mode 
)

Set the kind of repair you want to on for reading. The modes are listed above

void cdio_paranoia_overlapset ( cdrom_paranoia_t p,
long  overlap 
)

a temporary hack

int16_t* cdio_paranoia_read ( cdrom_paranoia_t p,
void(*)(long int, paranoia_cb_mode_t callback 
)

Reads the next sector of audio data and returns a pointer to a full sector of verified samples.

Parameters:
p paranoia object.
callback callback routine which gets called with the status on each read.
Returns:
the audio data read, CDIO_CD_FRAMESIZE_RAW (2352) bytes. This data is not to be freed by the caller. It will persist only until the next call to paranoia_read() for this p.

int16_t* cdio_paranoia_read_limited ( cdrom_paranoia_t p,
void(*)(long int, paranoia_cb_mode_t callback,
int  max_retries 
)

The same as cdio_paranoia_read but the number of retries is set.

Parameters:
p paranoia object.
callback callback routine which gets called with the status on each read.
max_retries number of times to try re-reading a block before failing.
Returns:
the block of CDIO_FRAMEIZE_RAW bytes (or CDIO_FRAMESIZE_RAW / 2 16-bit integers). Unless byte-swapping has been turned off the 16-bit integers Endian independent order.
See also:
cdio_paranoia_read.

lsn_t cdio_paranoia_seek ( cdrom_paranoia_t p,
off_t  seek,
int  whence 
)

reposition reading offset.

Parameters:
p paranoia type
seek byte offset to seek to
whence like corresponding parameter in libc's lseek, e.g. SEEK_SET or SEEK_END.

void cdio_paranoia_set_range ( cdrom_paranoia_t p,
long int  start,
long int  end 
)


Variable Documentation

const char* paranoia_cb_mode2str[]


Generated on Thu May 3 13:32:57 2007 for libcdio by  doxygen 1.5.1