ScummVM API documentation
sound.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 MADE_SOUND_H
23 #define MADE_SOUND_H
24 
25 #include "common/array.h"
26 
27 namespace Made {
28 
30 public:
31  void decompress(byte *source, byte *dest, uint32 size);
32 protected:
33  byte *_source, *_dest;
34  uint32 _size;
35  uint16 _bitBuffer;
36  int _bitsLeft;
37  int32 _sample1, _sample2, _sample3, _sample4;
38  bool _writeFlag;
39  bool _eof;
40  int _mode;
41  int getBit();
42  void update0();
43  void update1();
44  void update2();
45  void update3();
46 };
47 
49  uint32 position;
50  byte energy;
51 };
52 
54 
55 
56 // Persistent data for decompressSound(). When calling decompressSound()
57 // repeatedly (for the same stream), pass the same SoundDecoderData object to
58 // ensure decoding properly resumes.
60 public:
62  memset(_soundBuffer, 0x80, sizeof(_soundBuffer));
63  _prevSample = 0;
64  }
65 
66  byte _soundBuffer[1025];
67  int16 _prevSample;
68 };
69 
70 void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCount, SoundEnergyArray *soundEnergyArray = NULL, SoundDecoderData *decoderData = NULL);
71 
72 } // End of namespace Made
73 
74 #endif /* MADE_H */
Definition: sound.h:59
Definition: array.h:52
Definition: console.h:27
Definition: sound.h:48
Definition: sound.h:29