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 MM_SHARED_XEEN_SOUND_H
23#define MM_SHARED_XEEN_SOUND_H
24
25#include "audio/mididrv.h"
26#include "audio/mixer.h"
27#include "audio/audiostream.h"
28#include "mm/shared/xeen/file.h"
29#include "mm/shared/xeen/sound_driver.h"
30
31namespace MM {
32namespace Shared {
33namespace Xeen {
34
35class Sound {
36private:
37 SoundDriver *_SoundDriver;
38 const byte *_effectsData;
39 Common::Array<uint16> _effectsOffsets;
40 Common::Array<uint16> _patchesOffsetsMT32;
41 const byte *_songData;
42 Audio::Mixer *_mixer;
43 Audio::SoundHandle _soundHandle;
44 byte _musicPercent;
45 int _musicVolume, _sfxVolume;
46private:
50 void loadEffectsData();
51
55 void update();
56
60 void updateVolume();
61public:
62 bool _fxOn;
63 bool _musicOn;
64 Common::Path _currentMusic;
65 int _musicSide;
66 bool _subtitles;
67 MusicType musicType;
68public:
69 Sound(Audio::Mixer *mixer);
70 virtual ~Sound();
71
75 void playFX(uint effectId);
76
80 void stopFX(bool force = false);
81
85 int songCommand(uint commandId, byte musicVolume = 0, byte sfxVolume = 0);
86
90 void stopSong() {
91 _currentMusic.clear();
92 songCommand(STOP_SONG);
93 }
94
98 void setMusicPercent(byte percent);
99
104
108 void playSong(const Common::Path &name, int param = 0);
109
113 bool isMusicPlaying() const;
114
118 void setMusicOn(bool isOn);
119
123 void setFxOn(bool isOn);
124
129
134
138 void playSound(Common::SeekableReadStream &s, int unused = 0);
139
143 void playSound(const Common::Path &name, int unused = 0);
144#ifdef ENABLE_XEEN
148 void playSound(const Common::Path &name, int ccNum, int unused);
149#endif
154 void stopSound();
155
160 bool isSoundPlaying() const;
161
165#ifdef ENABLE_XEEN
166 void playVoice(const Common::Path &name, int ccMode = -1);
167#else
168 void playVoice(const Common::Path &name);
169#endif
170};
171
172} // namespace Xeen
173} // namespace Shared
174} // namespace MM
175
176#endif
Definition: mixer.h:70
Definition: mixer.h:49
Definition: path.h:52
void clear()
Definition: path.h:279
Definition: stream.h:745
Definition: sound_driver.h:56
Definition: sound.h:35
void setFxOn(bool isOn)
void playSound(Common::SeekableReadStream &s, int unused=0)
void stopSong()
Definition: sound.h:90
void playSong(const Common::Path &name, int param=0)
bool isSoundPlaying() const
int songCommand(uint commandId, byte musicVolume=0, byte sfxVolume=0)
void playFX(uint effectId)
void stopFX(bool force=false)
bool isMusicPlaying() const
void playSong(Common::SeekableReadStream &stream)
void playVoice(const Common::Path &name)
void playSound(const Common::Path &name, int unused=0)
void setMusicOn(bool isOn)
void setMusicPercent(byte percent)
MusicType
Definition: mididrv.h:44
Definition: detection.h:27