summaryrefslogtreecommitdiff
path: root/src/gui/setup_audio.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-28 02:14:15 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-28 03:01:38 +0300
commitc85d939d9b3f6c10288dc86ffa7811408e349657 (patch)
treeb1ca825fde3bad322728df1c9133ec25b74b341e /src/gui/setup_audio.cpp
parent5023a1d0b96071a35547dcc309ce45ba6a17eec1 (diff)
downloadplus-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.gz
plus-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.bz2
plus-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.xz
plus-c85d939d9b3f6c10288dc86ffa7811408e349657.zip
Add different sound effects for different events.
Can be configured in audio tab in settings.
Diffstat (limited to 'src/gui/setup_audio.cpp')
-rw-r--r--src/gui/setup_audio.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp
index 1f7db484c..a4c3110d9 100644
--- a/src/gui/setup_audio.cpp
+++ b/src/gui/setup_audio.cpp
@@ -25,9 +25,11 @@
#include "configuration.h"
#include "sound.h"
+#include "gui/theme.h"
#include "gui/viewport.h"
#include "gui/widgets/layouthelper.h"
+#include "gui/widgets/namesmodel.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/setupitem.h"
@@ -35,6 +37,19 @@
#include "debug.h"
+class SoundsModel : public NamesModel
+{
+public:
+ SoundsModel()
+ {
+ mNames.push_back(gettext("(no sound)"));
+ Theme::fillSoundsList(mNames);
+ }
+
+ virtual ~SoundsModel()
+ { }
+};
+
Setup_Audio::Setup_Audio()
{
setName(_("Audio"));
@@ -44,6 +59,10 @@ Setup_Audio::Setup_Audio()
ContainerPlacer place = h.getPlacer(0, 0);
place(0, 0, mScroll, 10, 10);
+ mSoundModel = new SoundsModel();
+
+ new SetupItemLabel(_("Basic settings"), "", this);
+
new SetupItemCheckBox(_("Enable Audio"), "", "sound", this, "soundEvent");
new SetupItemCheckBox(_("Enable music"), "",
@@ -61,6 +80,31 @@ Setup_Audio::Setup_Audio()
new SetupItemSlider(_("Music volume"), "", "musicVolume",
this, "musicVolumeEvent", 0, sound.getMaxVolume(), 150, true);
+ new SetupItemLabel(_("Sound effects"), "", this);
+
+ new SetupItemSound(_("Information dialog sound"), "",
+ "soundinfo", this, "soundinfoEvent", mSoundModel);
+
+ new SetupItemSound(_("Request dialog sound"), "",
+ "soundrequest", this, "soundrequestEvent", mSoundModel);
+
+ new SetupItemSound(_("Whisper message sound"), "",
+ "soundwhisper", this, "soundwhisperEvent", mSoundModel);
+
+ new SetupItemSound(_("Highlight message sound"), "",
+ "soundhighlight", this, "soundhighlightEvent", mSoundModel);
+
+ new SetupItemSound(_("Global message sound"), "",
+ "soundglobal", this, "soundglobalEvent", mSoundModel);
+
+ new SetupItemSound(_("Error message sound"), "",
+ "sounderror", this, "sounderrorEvent", mSoundModel);
+
+ new SetupItemSound(_("Trade request sound"), "",
+ "soundtrade", this, "soundtradeEvent", mSoundModel);
+
+ new SetupItemLabel(_("Other"), "", this);
+
new SetupItemCheckBox(_("Enable mumble voice chat"), "",
"enableMumble", this, "enableMumbleEvent");
@@ -70,6 +114,12 @@ Setup_Audio::Setup_Audio()
setDimension(gcn::Rectangle(0, 0, 550, 350));
}
+Setup_Audio::~Setup_Audio()
+{
+ delete mSoundModel;
+ mSoundModel = nullptr;
+}
+
void Setup_Audio::apply()
{
SetupTabScroll::apply();