ScummVM API documentation
sol.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCI_SOUND_DECODERS_SOL_H
23 #define SCI_SOUND_DECODERS_SOL_H
24 
25 #include "audio/audiostream.h"
26 #include "common/stream.h"
27 
28 namespace Sci {
29 
30 enum SOLFlags {
31  kCompressed = 1,
32  k16Bit = 4,
33  kStereo = 16
34 };
35 
36 template <bool STEREO, bool S16BIT, bool OLDDPCM8>
38 private:
43 
47  uint16 _sampleRate;
48 
52  int32 _rawDataSize;
53 
57  union {
58  struct { int16 l; int16 r; } _dpcmCarry16;
59  struct { uint8 l; uint8 r; } _dpcmCarry8;
60  };
61 
65  Audio::Timestamp _length;
66 
67  bool seek(const Audio::Timestamp &where) override;
68  Audio::Timestamp getLength() const override;
69  int readBuffer(int16 *buffer, const int numSamples) override;
70  bool isStereo() const override;
71  int getRate() const override;
72  bool endOfData() const override;
73  bool rewind() override;
74 
75 public:
76  SOLStream(Common::SeekableReadStream *stream, const DisposeAfterUse::Flag disposeAfterUse, const uint16 sampleRate, const int32 rawDataSize);
77 };
78 
79 Audio::SeekableAudioStream *makeSOLStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse);
80 
81 } // End of namespace Sci
82 
83 #endif // SCI_SOUND_DECODERS_SOL_H
Definition: timestamp.h:83
Definition: stream.h:745
Definition: audiostream.h:212
Definition: console.h:28
Definition: sol.h:37