summaryrefslogtreecommitdiff
path: root/src/gui/setup_audio.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-14 23:47:22 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-14 23:53:26 +0200
commitbeac98b7d093bca0fa921e5e30c2b766fb0298e9 (patch)
tree74adb5d59e6bd074a8483d14966ab2913fd50cc1 /src/gui/setup_audio.cpp
parent2f04d1c1aa1fca06754eb5c8bad631d4fbfab6df (diff)
downloadmana-beac98b7d093bca0fa921e5e30c2b766fb0298e9.tar.gz
mana-beac98b7d093bca0fa921e5e30c2b766fb0298e9.tar.bz2
mana-beac98b7d093bca0fa921e5e30c2b766fb0298e9.tar.xz
mana-beac98b7d093bca0fa921e5e30c2b766fb0298e9.zip
Cleanup of Sound class, fixing restoring of volumes and music
While a previous commit fixed the restoring of music of the current map in the setup window, this commit makes sure that the Sound class itself will resume a previously playing song when it is re-initialized. Other fixes: * Restore the correct volumes when enabling sound * Play the right audio track during login * Specify which font to use for bold text
Diffstat (limited to 'src/gui/setup_audio.cpp')
-rw-r--r--src/gui/setup_audio.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp
index 3f98c44f..05a9eaa2 100644
--- a/src/gui/setup_audio.cpp
+++ b/src/gui/setup_audio.cpp
@@ -31,8 +31,6 @@
#include "configuration.h"
#include "log.h"
#include "sound.h"
-#include "map.h"
-#include "engine.h"
#include "utils/gettext.h"
@@ -41,8 +39,8 @@ Setup_Audio::Setup_Audio():
mSfxVolume((int)config.getValue("sfxVolume", 100)),
mSoundEnabled(config.getValue("sound", 0)),
mSoundCheckBox(new CheckBox(_("Sound"), mSoundEnabled)),
- mSfxSlider(new Slider(0, 128)),
- mMusicSlider(new Slider(0, 128))
+ mSfxSlider(new Slider(0, sound.getMaxVolume())),
+ mMusicSlider(new Slider(0, sound.getMaxVolume()))
{
setName(_("Audio"));
setDimension(gcn::Rectangle(0, 0, 250, 200));
@@ -96,12 +94,6 @@ void Setup_Audio::apply()
new OkDialog("Sound Engine", err);
logger->log("Warning: %s", err);
}
-
- if (engine)
- {
- Map *currentMap = engine->getCurrentMap();
- sound.playMusic(currentMap->getProperty("music"), -1);
- }
}
else
{
@@ -134,6 +126,6 @@ void Setup_Audio::action(const gcn::ActionEvent &event)
else if (event.getId() == "music")
{
config.setValue("musicVolume", (int) mMusicSlider->getValue());
- sound.setMusicVolume((int)mMusicSlider->getValue());
+ sound.setMusicVolume((int) mMusicSlider->getValue());
}
}