[Scummvm-cvs-logs] SF.net SVN: scummvm:[55018] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Wed Dec 22 23:25:52 CET 2010
Revision: 55018
http://scummvm.svn.sourceforge.net/scummvm/?rev=55018&view=rev
Author: strangerke
Date: 2010-12-22 22:25:52 +0000 (Wed, 22 Dec 2010)
Log Message:
-----------
HUGO: Implement syncSoundSettings()
Modified Paths:
--------------
scummvm/trunk/engines/hugo/hugo.cpp
scummvm/trunk/engines/hugo/hugo.h
scummvm/trunk/engines/hugo/sound.cpp
scummvm/trunk/engines/hugo/sound.h
Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2010-12-22 22:18:21 UTC (rev 55017)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2010-12-22 22:25:52 UTC (rev 55018)
@@ -1276,4 +1276,12 @@
int8 HugoEngine::getTPS() {
return ((_config.turboFl) ? TURBO_TPS : _normalTPS);
}
+
+void HugoEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
+ _sound->syncVolume();
+}
+
+
} // End of namespace Hugo
Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h 2010-12-22 22:18:21 UTC (rev 55017)
+++ scummvm/trunk/engines/hugo/hugo.h 2010-12-22 22:25:52 UTC (rev 55018)
@@ -215,6 +215,7 @@
void setNewScreen(int screen);
void shutdown();
void storeBoundary(int x1, int x2, int y);
+ void syncSoundSettings();
int getMouseX() const {
return _mouseX;
Modified: scummvm/trunk/engines/hugo/sound.cpp
===================================================================
--- scummvm/trunk/engines/hugo/sound.cpp 2010-12-22 22:18:21 UTC (rev 55017)
+++ scummvm/trunk/engines/hugo/sound.cpp 2010-12-22 22:25:52 UTC (rev 55018)
@@ -305,6 +305,9 @@
/* Sound disabled */
if (!_config.soundFl || !_vm->_mixer->isReady())
return;
+
+ syncVolume();
+
//
// // See if last wave still playing - if so, check priority
// if (waveOutUnprepareHeader(hwav, lphdr, sizeof(WAVEHDR)) == WAVERR_STILLPLAYING)
@@ -319,8 +322,7 @@
return;
Audio::AudioStream *stream = Audio::makeRawStream(sound_p, size, 11025, Audio::FLAG_UNSIGNED);
- _vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, stream);
-
+ _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream);
}
/**
@@ -330,4 +332,16 @@
_midiPlayer->open();
}
+void SoundHandler::syncVolume() {
+ int soundVolume;
+
+ if (ConfMan.getBool("sfx_mute") || ConfMan.getBool("mute"))
+ soundVolume = -1;
+ else
+ soundVolume = MIN(255, ConfMan.getInt("sfx_volume"));
+
+ _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolume);
+ _midiPlayer->syncVolume();
+}
+
} // End of namespace Hugo
Modified: scummvm/trunk/engines/hugo/sound.h
===================================================================
--- scummvm/trunk/engines/hugo/sound.h 2010-12-22 22:18:21 UTC (rev 55017)
+++ scummvm/trunk/engines/hugo/sound.h 2010-12-22 22:25:52 UTC (rev 55018)
@@ -97,6 +97,7 @@
void playMusic(int16 tune);
void playSound(int16 sound, stereo_t channel, byte priority);
void initSound();
+ void syncVolume();
private:
HugoEngine *_vm;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list