Class for a raw CDROM device.
This is the RawCD object. It defines an API for cdrom-device access.The API is toolkit- and platform- independent. Any platform-specific code will be in the *.C sources for each platform, which should include this file.
The API uses standard Unix file operations, and requires a filename for the CDROM device.
Private Members
There are numerous private member flags, variables, and methods. All [well, most] of the private methods are inlined.
The private members are all specific to this implementation of a raw CD device. If you decide to create your own implementation, it makes more sense to just keep this header file, but rewrite all of the code in the *.C file. This is also what you should do if you need to port this class to systems other than Linux or to Linux SCSI drives.
---------------------------------------------------------- ----------------------------------------------------------
idx=0 refers to the first item.
The lrqp-counter is used by PlayItem() for synchronization
purposes.
idx=0 refers to the first item.
If t_f<=t0, PlayItemBlock returns an error. If
t_f is 0, negative, or beyond the end of the CD,
PlayItemBlock simply plays to the end of the disc. The flag reposition is used to control what
PlayItemBlock does if the drive is already playing. If
reposition=true, the drive stops and restarts at the new
location. Otherwise, PlayItemBlock does nothing.
The flag reposition is used to control what
PlayItem does if the drive is already playing. If
reposition=true, the drive stops and restarts at the new
location. Otherwise, PlayItem does nothing. This is where the lrpq-index comes in. It specifies the index of
the last specifically-requested play item, and is set by both
PlayItem and PlayItemBlock. If:
The idea behind this elaborate scheme is to keep play smooth. As
long as your CDROM drive keeps playing through, in sequence, once
it's started playing, this scheme will work.
RawCD( void )
RawCD( char *devname )
void InitDev( char *devname )
void TrayControl( bool close_ioctl=false, bool trayless=false )
float Volume(void)
int ToC_Entry(int idx)
void lrqpSet(int idx)
int ItemLength(int idx)
CdStatus getStatus(void)
int CurrentItemIndex(void)
int CurrentItemLength(void)
int CurrentItemTime(void)
int ToC_Length(void)
void InitDev(void)
void IncVol(void)
void DecVol(void)
void Stop(void)
void PauseResume(void)
void PlayItemBlock(int itemno, int t0, int t_f=-1, bool reposition=true)
void PlayItem(int itemno, bool reposition=false)
...then PlayItem just updates some counters and returns,
allowing the drive to keep playing. If the last two conditions
aren't met, then the drive stops an restarts. void UpdateStatus(void)
void Eject(void)
void CloseTray(void)
Copyright 1997 by John Weiss [John.Weiss@colorado.edu]
"generated by doc++"?! More like mangled generated by doc++