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 DARKSEED_SOUND_H
23 #define DARKSEED_SOUND_H
24 
25 #include "darkseed/music.h"
26 
27 #include "audio/mixer.h"
28 #include "common/array.h"
29 #include "common/error.h"
30 #include "common/serializer.h"
31 
32 namespace Darkseed {
33 enum class MusicId : uint8 {
34  kNone = 0,
35  kLab,
36  kVictory,
37  kCemetry,
38  kLeech,
39  kExt,
40  kQuiet,
41  kPackage,
42  kDth,
43  kLibrary,
44  kRadio,
45  kOutdoor,
46  kTown,
47 };
48 
49 enum class StartMusicId : uint8 {
50  kCredits = 0,
51  kAlien,
52  kImplant,
53  kLaunch,
54  kNight2,
55  kNight3,
56  kBook,
57  kDoll
58 };
59 
60 class Sound {
61  Audio::Mixer *_mixer;
62  Audio::SoundHandle _speechHandle;
63  Audio::SoundHandle _sfxHandle;
64  MusicPlayer *_musicPlayer;
65  Common::Array<uint8> _didSpeech;
66 
67 public:
68  explicit Sound(Audio::Mixer *mixer);
69  ~Sound();
70 
71  int init();
72 
74 
75  bool isMuted() const;
76  void playTosSpeech(int tosIdx);
77  void stopSpeech();
78  bool isPlayingSpeech() const;
79  bool isPlayingSfx() const;
80  bool isPlayingMusic();
81  void resetSpeech();
82  void playMusic(MusicId musicId, bool loop = true);
83  void playMusic(StartMusicId musicId);
84  void playMusic(Common::String const &filename, bool loop = false);
85  void stopMusic();
86  void playSfx(uint8 sfxId, int unk1, int unk2);
87  void stopSfx();
88  void syncSoundSettings();
89  void killAllSound();
90 private:
91  void playDosCDSfx(int sfxId);
92  void playFloppySpeech(int tosIdx);
93 };
94 
95 } // namespace Darkseed
96 
97 #endif // DARKSEED_SOUND_H
Definition: music.h:35
Definition: str.h:59
Definition: error.h:84
Definition: serializer.h:79
Definition: mixer.h:49
Definition: mixer.h:59
Definition: adlib_worx.h:27
Definition: sound.h:60