| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef H_FREAC_DECODER |
| 14 |
#define H_FREAC_DECODER |
| 15 |
|
| 16 |
#include "component.h" |
| 17 |
|
| 18 |
namespace freac |
| 19 |
{ |
| 20 |
class Decoder : public Component |
| 21 |
{ |
| 22 |
protected: |
| 23 |
String fileName; |
| 24 |
Int64 sampleOffset; |
| 25 |
|
| 26 |
BoCA::Format format; |
| 27 |
Int64 decodedSamples; |
| 28 |
|
| 29 |
IO::InStream *stream; |
| 30 |
BoCA::AS::DecoderComponent *decoder; |
| 31 |
|
| 32 |
Bool calculateCRC; |
| 33 |
Hash::CRC32 crc; |
| 34 |
|
| 35 |
UnsignedInt32 crcSum; |
| 36 |
String md5Sum; |
| 37 |
public: |
| 38 |
Decoder(const BoCA::Config *); |
| 39 |
virtual ~Decoder(); |
| 40 |
|
| 41 |
Bool Create(const String &, const BoCA::Track &); |
| 42 |
Bool Destroy(); |
| 43 |
|
| 44 |
Bool GetStreamInfo(BoCA::Track &) const; |
| 45 |
|
| 46 |
Int Read(Buffer<UnsignedByte> &); |
| 47 |
|
| 48 |
Bool Seek(Int64); |
| 49 |
accessors: |
| 50 |
Int64 GetInBytes() const; |
| 51 |
String GetDecoderName() const; |
| 52 |
|
| 53 |
Int64 GetDecodedSamples() const { return decodedSamples; } |
| 54 |
|
| 55 |
Void SetCalculateCRC(Bool); |
| 56 |
UnsignedInt32 GetCRCChecksum(); |
| 57 |
|
| 58 |
Void SetCalculateMD5(Bool); |
| 59 |
String GetMD5Checksum(); |
| 60 |
}; |
| 61 |
}; |
| 62 |
|
| 63 |
#endif |