aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-04-05 18:24:36 +0000
committerPaweł Kołodziejski2004-04-05 18:24:36 +0000
commitf141ad488b1fd4d96214cb35e0ab4034173efb81 (patch)
tree88bc5d0055ef63fc6afa9180620c3a35c5e661f4 /gui
parent781809ee2be3c1ad15e3e9a62296f27241ac9cd0 (diff)
downloadscummvm-rg350-f141ad488b1fd4d96214cb35e0ab4034173efb81.tar.gz
scummvm-rg350-f141ad488b1fd4d96214cb35e0ab4034173efb81.tar.bz2
scummvm-rg350-f141ad488b1fd4d96214cb35e0ab4034173efb81.zip
added voice group volume to scumm engine for imuse digital and implemeted volume groups control
svn-id: r13468
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp3
-rw-r--r--gui/options.cpp28
-rw-r--r--gui/options.h3
3 files changed, 29 insertions, 5 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 8b2e6a6327..6edb87c27a 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -225,7 +225,8 @@ void EditGameDialog::open() {
e = ConfMan.hasKey("master_volume", _domain) ||
ConfMan.hasKey("music_volume", _domain) ||
- ConfMan.hasKey("sfx_volume", _domain);
+ ConfMan.hasKey("sfx_volume", _domain) ||
+ ConfMan.hasKey("voice_volume", _domain);
_globalVolumeOverride->setState(e);
// TODO: game path
diff --git a/gui/options.cpp b/gui/options.cpp
index c96f23dc67..5d2d9981e7 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -49,6 +49,7 @@ enum {
kMasterVolumeChanged = 'mavc',
kMusicVolumeChanged = 'muvc',
kSfxVolumeChanged = 'sfvc',
+ kVoiceVolumeChanged = 'vcvc',
kChooseSaveDirCmd = 'chos'
};
@@ -62,7 +63,8 @@ OptionsDialog::OptionsDialog(const String &domain, int x, int y, int w, int h)
_enableVolumeSettings(false),
_masterVolumeSlider(0), _masterVolumeLabel(0),
_musicVolumeSlider(0), _musicVolumeLabel(0),
- _sfxVolumeSlider(0), _sfxVolumeLabel(0) {
+ _sfxVolumeSlider(0), _sfxVolumeLabel(0),
+ _voiceVolumeSlider(0), _voiceVolumeLabel(0) {
}
@@ -137,6 +139,10 @@ void OptionsDialog::open() {
vol = ConfMan.getInt("sfx_volume", _domain);
_sfxVolumeSlider->setValue(vol);
_sfxVolumeLabel->setValue(vol);
+
+ vol = ConfMan.getInt("voice_volume", _domain);
+ _voiceVolumeSlider->setValue(vol);
+ _voiceVolumeLabel->setValue(vol);
}
}
@@ -161,10 +167,12 @@ void OptionsDialog::close() {
ConfMan.set("master_volume", _masterVolumeSlider->getValue(), _domain);
ConfMan.set("music_volume", _musicVolumeSlider->getValue(), _domain);
ConfMan.set("sfx_volume", _sfxVolumeSlider->getValue(), _domain);
+ ConfMan.set("voice_volume", _voiceVolumeSlider->getValue(), _domain);
} else {
ConfMan.removeKey("master_volume", _domain);
ConfMan.removeKey("music_volume", _domain);
ConfMan.removeKey("sfx_volume", _domain);
+ ConfMan.removeKey("voice_volume", _domain);
}
}
@@ -209,6 +217,10 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_sfxVolumeLabel->setValue(_sfxVolumeSlider->getValue());
_sfxVolumeLabel->draw();
break;
+ case kVoiceVolumeChanged:
+ _voiceVolumeLabel->setValue(_voiceVolumeSlider->getValue());
+ _voiceVolumeLabel->draw();
+ break;
case kOKCmd:
setResult(1);
close();
@@ -246,6 +258,8 @@ void OptionsDialog::setVolumeSettingsState(bool enabled) {
_musicVolumeLabel->setEnabled(enabled);
_sfxVolumeSlider->setEnabled(enabled);
_sfxVolumeLabel->setEnabled(enabled);
+ _voiceVolumeSlider->setEnabled(enabled);
+ _voiceVolumeLabel->setEnabled(enabled);
}
int OptionsDialog::addGraphicControls(GuiObject *boss, int yoffset) {
@@ -335,6 +349,12 @@ int OptionsDialog::addVolumeControls(GuiObject *boss, int yoffset) {
_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
yoffset += 16;
+ _voiceVolumeSlider = new SliderWidget(boss, 5, yoffset, 185, 12, "Voice volume: ", 100, kVoiceVolumeChanged);
+ _voiceVolumeLabel = new StaticTextWidget(boss, 200, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft);
+ _voiceVolumeSlider->setMinValue(0); _voiceVolumeSlider->setMaxValue(255);
+ _voiceVolumeLabel->setFlags(WIDGET_CLEARBG);
+ yoffset += 16;
+
_enableVolumeSettings = true;
return yoffset;
@@ -344,13 +364,13 @@ int OptionsDialog::addVolumeControls(GuiObject *boss, int yoffset) {
GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector)
- : OptionsDialog(Common::ConfigManager::kApplicationDomain, 10, 20, 320 - 2 * 10, 200 - 2 * 20) {
+ : OptionsDialog(Common::ConfigManager::kApplicationDomain, 10, 20, 320 - 2 * 10, 200 - 1 * 20) {
- const int vBorder = 5;
+ const int vBorder = 4;
int yoffset;
// The tab widget
- TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2*vBorder);
+ TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2 * vBorder);
//
// 1) The graphics tab
diff --git a/gui/options.h b/gui/options.h
index 9f6c6bf852..0ef6c266f2 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -90,6 +90,9 @@ private:
SliderWidget *_sfxVolumeSlider;
StaticTextWidget *_sfxVolumeLabel;
+
+ SliderWidget *_voiceVolumeSlider;
+ StaticTextWidget *_voiceVolumeLabel;
};