Implemented "Mute All"

svn-id: r45873
This commit is contained in:
Robert Špalek 2009-11-12 22:52:00 +00:00
parent fc0c195ea3
commit 24ccc94f79
2 changed files with 8 additions and 2 deletions

View File

@ -36,7 +36,7 @@
namespace Draci {
MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0), _driver(driver), _pathMask(pathMask), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false), _track(0) {
MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0), _driver(driver), _pathMask(pathMask), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false), _track(-1) {
memset(_channel, 0, sizeof(_channel));
memset(_channelVolume, 255, sizeof(_channelVolume));
_masterVolume = 0;
@ -210,7 +210,7 @@ void MusicPlayer::stop() {
return;
debugC(2, kDraciSoundDebugLevel, "Stopping track %d", _track);
_track = 0;
_track = -1;
_isPlaying = false;
if (_parser) {
_parser->unloadMusic();
@ -232,6 +232,9 @@ void MusicPlayer::resume() {
void MusicPlayer::syncVolume() {
int volume = ConfMan.getInt("music_volume");
if (ConfMan.getBool("mute")) {
volume = -1;
}
debugC(2, kDraciSoundDebugLevel, "Syncing music volume to %d", volume);
setVolume(volume);
}

View File

@ -271,6 +271,9 @@ void Sound::setVolume() {
} else {
_muteSound = _muteVoice = true;
}
if (ConfMan.getBool("mute")) {
_muteSound = _muteVoice = true;
}
_showSubtitles = ConfMan.getBool("subtitles");
_talkSpeed = ConfMan.getInt("talkspeed");
const int soundVolume = ConfMan.getInt("sfx_volume");