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 WAYNESWORLD_SOUND_H
23 #define WAYNESWORLD_SOUND_H
24 
25 #include "common/scummsys.h"
26 #include "audio/midiplayer.h"
27 
28 #define MAX_SOUNDS 20
29 
30 namespace Audio {
31 class AudioStream;
32 class SoundHandle;
33 }
34 
35 namespace WaynesWorld {
36 
37 class WaynesWorldEngine;
38 
39 class SoundManager {
40  Audio::AudioStream *_stream;
41  Common::String _filename;
42 
43 private:
44  WaynesWorldEngine *_vm;
45  Audio::Mixer *_mixer;
46  Audio::SoundHandle *_effectsHandle;
47  char _abtLookupTable[256] = {0};
48 
49  byte decompDelta1(int16 *curVal, byte **src, byte **dst, byte count);
50  byte decompDelta2(int16 *curVal, byte **src, byte **dst, byte count);
51  byte decompDelta4(int16 *curVal, byte **src, byte **dst, byte count);
52 
53  byte* abtDecomp(Common::File *fd, int *size, int *freq);
54 
55 public:
57  ~SoundManager();
58 
59  void playSound(const char *filename, bool flag);
60  bool isSFXPlaying();
61 
62  void syncVolume();
63 
64  void stopSound();
65 };
66 
68 private:
69  //WaynesWorldEngine *_vm;
70  byte *_music;
71 
72  // MidiDriver_BASE interface implementation
73  void send(uint32 b) override;
74 
75 public:
77  ~MusicManager() override;
78 
79  bool checkMidiDone();
80 
81  void midiRepeat();
82  void stopSong();
83 
84  void playMusic(const char *filename, bool loop = false);
85 
86  void setLoop(bool loop);
87 };
88 } // End of namespace WaynesWorld
89 
90 #endif /* WAYNESWORLD_SOUND_H*/
Definition: midiplayer.h:63
Definition: str.h:59
Definition: sound.h:39
Definition: detection.h:25
Definition: waynesworld.h:112
Definition: mixer.h:49
Definition: mixer.h:70
Definition: file.h:47
Definition: audiostream.h:50
Definition: sound.h:67
Definition: system.h:38