Debian Codegraph @

include/engine/decoder.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2020 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 #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