| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#include <boca.h> |
| 14 |
|
| 15 |
extern "C" { |
| 16 |
# include <cdda_interface.h> |
| 17 |
# include <cdda_paranoia.h> |
| 18 |
} |
| 19 |
|
| 20 |
BoCA_BEGIN_COMPONENT(DecoderCDParanoia) |
| 21 |
|
| 22 |
namespace BoCA |
| 23 |
{ |
| 24 |
class DecoderCDParanoia : public CS::DecoderComponent |
| 25 |
{ |
| 26 |
friend void paranoiaCallback(long, int); |
| 27 |
|
| 28 |
constants: |
| 29 |
static const UnsignedInt bytesPerSector = 2352; |
| 30 |
static const UnsignedInt samplesPerSector = 588; |
| 31 |
private: |
| 32 |
static Threads::Mutex readMutex; |
| 33 |
static DecoderCDParanoia *readDecoder; |
| 34 |
|
| 35 |
static Array<UnsignedInt64> lastRead; |
| 36 |
|
| 37 |
ConfigLayer *configLayer; |
| 38 |
|
| 39 |
cdrom_drive *drive; |
| 40 |
cdrom_paranoia *paranoia; |
| 41 |
|
| 42 |
Int nextSector; |
| 43 |
Int sectorsLeft; |
| 44 |
|
| 45 |
Int readOffset; |
| 46 |
|
| 47 |
Int skipSamples; |
| 48 |
Int prependSamples; |
| 49 |
Int appendSamples; |
| 50 |
|
| 51 |
Int numCacheErrors; |
| 52 |
|
| 53 |
String GetDriveID() const; |
| 54 |
|
| 55 |
Bool GetTrackSectors(Int &, Int &, Bool &) const; |
| 56 |
public: |
| 57 |
static const String &GetComponentSpecs(); |
| 58 |
|
| 59 |
DecoderCDParanoia(); |
| 60 |
~DecoderCDParanoia(); |
| 61 |
|
| 62 |
Bool CanOpenStream(const String &); |
| 63 |
Error GetStreamInfo(const String &, Track &); |
| 64 |
|
| 65 |
Bool Activate(); |
| 66 |
Bool Deactivate(); |
| 67 |
|
| 68 |
Bool Seek(Int64); |
| 69 |
|
| 70 |
Int ReadData(Buffer<UnsignedByte> &); |
| 71 |
|
| 72 |
ConfigLayer *GetConfigurationLayer(); |
| 73 |
}; |
| 74 |
}; |
| 75 |
|
| 76 |
BoCA_DEFINE_DECODER_COMPONENT(DecoderCDParanoia) |
| 77 |
|
| 78 |
BoCA_END_COMPONENT(DecoderCDParanoia) |