Debian Codegraph @

components/decoder/cdparanoia/cdparanoia.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2021 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
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)