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 BBVS_SOUND_H
23 #define BBVS_SOUND_H
24 
25 #include "audio/mixer.h"
26 #include "common/array.h"
27 
28 namespace Audio {
29 class RewindableAudioStream;
30 }
31 
32 namespace Bbvs {
33 
34 class Sound {
35 public:
36  Sound();
37  ~Sound();
38  void load(const Common::Path &filename);
39  void play(bool loop);
40  void stop();
41  bool isPlaying();
42 protected:
44  Audio::SoundHandle _handle;
45  // Keep the filename for debugging purposes
46  Common::Path _filename;
47 };
48 
49 class SoundMan {
50 public:
51  ~SoundMan();
52  void loadSound(const Common::Path &fileName);
53  void playSound(uint index, bool loop = false);
54  void stopSound(uint index);
55  bool isSoundPlaying(uint index);
56  bool isAnySoundPlaying(uint *indices, uint count);
57  void unloadSounds();
58  void stopAllSounds();
59 protected:
60  Common::Array<Sound*> _sounds;
61 };
62 
63 } // End of namespace Bbvs
64 
65 #endif // BBVS_SOUND_H
Definition: array.h:52
Definition: path.h:52
Definition: mixer.h:49
Definition: bbvs.h:42
Definition: sound.h:34
Definition: audiostream.h:109
Definition: sound.h:49
Definition: system.h:38