diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-25 01:32:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-25 01:32:11 +0300 |
commit | 7873888f72ceb6a026eacac0d791f81cfee80a7c (patch) | |
tree | 802a6dd05788bf2d27b55f276a4984a29bc5976b /src/sound.cpp | |
parent | 490a93a1d7a347ab586637bf9d8163e114285a02 (diff) | |
download | ManaVerse-7873888f72ceb6a026eacac0d791f81cfee80a7c.tar.gz ManaVerse-7873888f72ceb6a026eacac0d791f81cfee80a7c.tar.bz2 ManaVerse-7873888f72ceb6a026eacac0d791f81cfee80a7c.tar.xz ManaVerse-7873888f72ceb6a026eacac0d791f81cfee80a7c.zip |
Replace setuo audio page to new class.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |