[Scummvm-cvs-logs] SF.net SVN: scummvm: [26056] scummvm/trunk/gui
sev at users.sourceforge.net
sev at users.sourceforge.net
Sat Mar 10 14:39:39 CET 2007
Revision: 26056
http://scummvm.svn.sourceforge.net/scummvm/?rev=26056&view=rev
Author: sev
Date: 2007-03-10 05:39:38 -0800 (Sat, 10 Mar 2007)
Log Message:
-----------
Implement FR #1559561: "GUI: output sample rate widgets"
Modified Paths:
--------------
scummvm/trunk/gui/options.cpp
scummvm/trunk/gui/options.h
scummvm/trunk/gui/theme-config.cpp
scummvm/trunk/gui/themes/modern.ini
Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp 2007-03-10 13:30:15 UTC (rev 26055)
+++ scummvm/trunk/gui/options.cpp 2007-03-10 13:39:38 UTC (rev 26056)
@@ -63,6 +63,8 @@
static const char *savePeriodLabels[] = { "Never", "every 5 mins", "every 10 mins", "every 15 mins", "every 30 mins", 0 };
static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
+static const char *outputRateLabels[] = { "Default", "22 kHz", "8 kHz", "11kHz", "44 kHz", "48 kHz", 0 };
+static const int outputRateValues[] = { 0, 22050, 8000, 11025, 44100, 48000, -1 };
@@ -90,6 +92,7 @@
_aspectCheckbox = 0;
_enableAudioSettings = false;
_midiPopUp = 0;
+ _outputRatePopUp = 0;
_enableMIDISettings = false;
_multiMidiCheckbox = 0;
_mt32Checkbox = 0;
@@ -173,6 +176,15 @@
_midiPopUp->setSelected(md->name ? i : 0);
}
+ if (_outputRatePopUp) {
+ _outputRatePopUp->setSelected(1);
+ int value = ConfMan.getInt("output_rate", _domain);
+ for (int i = 0; outputRateLabels[i]; i++) {
+ if (value == outputRateValues[i])
+ _outputRatePopUp->setSelected(i);
+ }
+ }
+
if (_multiMidiCheckbox) {
// Multi midi setting
@@ -298,6 +310,17 @@
}
}
+ if (_outputRatePopUp) {
+ if (_enableAudioSettings) {
+ if (_outputRatePopUp->getSelectedTag() != 0)
+ ConfMan.setInt("output_rate", _outputRatePopUp->getSelectedTag(), _domain);
+ else
+ ConfMan.removeKey("output_rate", _domain);
+ } else {
+ ConfMan.removeKey("output_rate", _domain);
+ }
+ }
+
// MIDI options
if (_multiMidiCheckbox) {
if (_enableMIDISettings) {
@@ -424,6 +447,7 @@
_enableAudioSettings = enabled;
_midiPopUp->setEnabled(enabled);
+ _outputRatePopUp->setEnabled(enabled);
}
void OptionsDialog::setMIDISettingsState(bool enabled) {
@@ -521,6 +545,13 @@
md++;
}
+ // Sample rate settings
+ _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate: ", labelWidth);
+
+ for (int i = 0; outputRateLabels[i]; i++) {
+ _outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]);
+ }
+
_enableAudioSettings = true;
}
@@ -612,6 +643,8 @@
if (_midiPopUp)
_midiPopUp->changeLabelWidth(labelWidth);
+ if (_outputRatePopUp)
+ _outputRatePopUp->changeLabelWidth(labelWidth);
if (_gfxPopUp)
_gfxPopUp->changeLabelWidth(labelWidth);
if (_renderModePopUp)
@@ -764,10 +797,14 @@
String themePath(_themePath->getLabel());
if (!themePath.empty() && (themePath != "None"))
ConfMan.set("themepath", themePath, _domain);
+ else
+ ConfMan.removeKey("themepath", _domain);
String extraPath(_extraPath->getLabel());
if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
+ else
+ ConfMan.removeKey("extrapath", _domain);
ConfMan.setInt("autosave_period", _autosavePeriodPopUp->getSelectedTag(), _domain);
}
Modified: scummvm/trunk/gui/options.h
===================================================================
--- scummvm/trunk/gui/options.h 2007-03-10 13:30:15 UTC (rev 26055)
+++ scummvm/trunk/gui/options.h 2007-03-10 13:39:38 UTC (rev 26056)
@@ -93,6 +93,7 @@
//
bool _enableAudioSettings;
PopUpWidget *_midiPopUp;
+ PopUpWidget *_outputRatePopUp;
//
// MIDI controls
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp 2007-03-10 13:30:15 UTC (rev 26055)
+++ scummvm/trunk/gui/theme-config.cpp 2007-03-10 13:39:38 UTC (rev 26056)
@@ -55,6 +55,32 @@
"def_vcAudioTabSpacing=2\n"
"use=XxY\n"
"\n"
+"# Override audio tab\n"
+"set_parent=gameoptions\n"
+"vBorder=5\n"
+"\n"
+"# audio tab\n"
+"opYoffset=vBorder\n"
+"useWithPrefix=audioControls globaloptions_\n"
+"useWithPrefix=subtitleControls globaloptions_\n"
+"\n"
+"# volume tab\n"
+"opYoffset=vBorder\n"
+"useWithPrefix=volumeControls globaloptions_\n"
+"\n"
+"# audio tab\n"
+"opYoffset=vBorder\n"
+"gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight\n"
+"opYoffset=(opYoffset + buttonHeight + 6)\n"
+"useWithPrefix=audioControls gameoptions_\n"
+"useWithPrefix=subtitleControls gameoptions_\n"
+"\n"
+"# volume tab\n"
+"opYoffset=vBorder\n"
+"gameoptions_volumeCheckbox=gox opYoffset (kFontHeight + 10 + 190) buttonHeight\n"
+"opYoffset=(opYoffset + buttonHeight + 6)\n"
+"useWithPrefix=volumeControls gameoptions_\n"
+"\n"
"TabWidget.tabWidth=0\n"
"TabWidget.tabHeight=16\n"
"TabWidget.titleVPad=2\n"
@@ -348,6 +374,8 @@
"auw=(parent.w - 2 * 10)\n"
"auMidiPopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)\n"
"opYoffset=(opYoffset + buttonHeight + 4)\n"
+"auSampleRatePopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)\n"
+"opYoffset=(opYoffset + buttonHeight + 4)\n"
"\n"
"[volumeControls]\n"
"vctextw=(95 + vcAudioTabIndent)\n"
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2007-03-10 13:30:15 UTC (rev 26055)
+++ scummvm/trunk/gui/themes/modern.ini 2007-03-10 13:39:38 UTC (rev 26056)
@@ -466,6 +466,8 @@
auw=(parent.w - aux - 30)
auMidiPopup=(aux) (opYoffset - 1) (auw + 5) kPopUpHeight
opYoffset=(opYoffset + buttonHeight + 4)
+auSampleRatePopup=(aux) (opYoffset - 1) (auw + 5) kPopUpHeight
+opYoffset=(opYoffset + buttonHeight + 4)
[volumeControls]
vctextw=110
@@ -553,6 +555,7 @@
pix_checkbox_empty="checkbox_empty320.bmp"
pix_checkbox_checked="checkbox_checked320.bmp"
pix_cursor_image="cursor320.bmp"
+def_volumeControlsInAudio=false
# NES resoltuion
[256x240]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list