aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorNicolas Bacca2002-04-21 21:58:21 +0000
committerNicolas Bacca2002-04-21 21:58:21 +0000
commitd9ce5c659cf9cb30b5fe0d1e65219d0b0d763080 (patch)
treec1e46db51a4aa680b4f5ff9e0b77863aa244a998 /sound.cpp
parent635cb77d5acf8cc3a519ad07c5c02c57b804299e (diff)
downloadscummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.tar.gz
scummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.tar.bz2
scummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.zip
Pause SFX, pre-initialized volume
svn-id: r4045
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/sound.cpp b/sound.cpp
index 54d3851d04..3a1dc40a42 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -378,12 +378,19 @@ void Scumm::setupSound()
IMuse *se = _imuse;
if (se) {
se->setBase(res.address[rtSound]);
- if (se->get_music_volume() == 0)
- se->set_music_volume(60);
- se->set_master_volume(125);
+ if (!_soundVolumePreset) {
+ if (se->get_music_volume() == 0)
+ se->set_music_volume(60);
+ se->set_master_volume(125);
+ _sound_volume_music = se->get_music_volume();
+ //_sound_volume_master = (se->get_master_volume() / 127);
+ _sound_volume_master = se->get_master_volume();
- _sound_volume_music = se->get_music_volume();
- _sound_volume_master = (se->get_master_volume() / 127);
+ }
+ else {
+ se->set_music_volume(_sound_volume_music);
+ se->set_master_volume(_sound_volume_master);
+ }
}
_sfxFile = openSfxFile();
}
@@ -579,6 +586,8 @@ void Scumm::playBundleSound(char *sound)
void Scumm::playSfxSound(void *sound, uint32 size, uint rate)
{
+ if (_soundsPaused)
+ return;
_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE);
}
@@ -586,7 +595,8 @@ void Scumm::playSfxSound_MP3(void *sound, uint32 size)
{
#ifdef COMPRESSED_SOUND_FILE
-
+ if (_soundsPaused)
+ return;
_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
#endif
@@ -691,6 +701,9 @@ void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
float frame_size;
mad_timer_t duration;
+ if (_soundsPaused)
+ return;
+
if (!start && !delay) {
_mixer->stop(_mp3_handle);
return;