From 7873888f72ceb6a026eacac0d791f81cfee80a7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Feb 2012 01:32:11 +0300 Subject: Replace setuo audio page to new class. --- src/sound.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index 913b55656..25b37d578 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -69,6 +69,8 @@ Sound::~Sound() config.removeListener("playBattleSound", this); config.removeListener("playGuiSound", this); config.removeListener("playMusic", this); + config.removeListener("sfxVolume", this); + config.removeListener("musicVolume", this); // Unlink the callback function. Mix_HookMusicFinished(nullptr); @@ -82,6 +84,10 @@ void Sound::optionChanged(const std::string &value) mPlayGui = config.getBoolValue("playGuiSound"); else if (value == "playMusic") mPlayMusic = config.getBoolValue("playMusic"); + else if (value == "sfxVolume") + setSfxVolume(config.getIntValue("sfxVolume")); + else if (value == "musicVolume") + setMusicVolume(config.getIntValue("musicVolume")); } void Sound::init() @@ -98,6 +104,8 @@ void Sound::init() config.addListener("playBattleSound", this); config.addListener("playGuiSound", this); config.addListener("playMusic", this); + config.addListener("sfxVolume", this); + config.addListener("musicVolume", this); if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) { -- cgit v1.2.3-70-g09d2