ScummVM API documentation
rebel_audio.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 SCUMM_INSANE_REBEL_AUDIO_H
23 #define SCUMM_INSANE_REBEL_AUDIO_H
24 
25 #include "audio/mixer.h"
26 #include "common/scummsys.h"
27 
28 namespace Audio {
29 class QueuingAudioStream;
30 }
31 
32 namespace Scumm {
33 
34 class ScummEngine_v7;
35 class SmushPlayer;
36 
37 class RebelAudio {
38 public:
39  RebelAudio();
40 
41  void init(ScummEngine_v7 *vm, int sampleRate);
42  void reset();
43  void terminate();
44  int sampleRate() const { return _sampleRate; }
45 
46  void queueData(int trackIdx, const uint8 *data, int32 size, int volume, int pan, int sampleRate = 0);
47  void processFrame(SmushPlayer *player, int16 feedSize);
48 
49 private:
50  static const int kMaxTracks = 4;
51 
52  bool processAudioCodes(SmushPlayer *player, int idx, int32 &tmpFeedSize, int &mixVolume);
53 
54  ScummEngine_v7 *_vm;
55  Audio::QueuingAudioStream *_streams[kMaxTracks];
56  Audio::SoundHandle _handles[kMaxTracks];
57  bool _trackActive[kMaxTracks];
58  int _sampleRate;
59 };
60 
61 } // End of namespace Scumm
62 
63 #endif
Definition: rebel_audio.h:37
Definition: mixer.h:49
Definition: audiostream.h:370
Definition: actor.h:30
Definition: system.h:38