aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp84
1 files changed, 58 insertions, 26 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index e7888cf095..b59278a4f1 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -26,11 +26,11 @@
#include "gui/themebrowser.h"
#include "gui/chooser.h"
#include "gui/message.h"
-#include "gui/GuiManager.h"
+#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
#include "gui/options.h"
-#include "gui/PopUpWidget.h"
-#include "gui/TabWidget.h"
+#include "gui/widgets/popup.h"
+#include "gui/widgets/tab.h"
#include "common/fs.h"
#include "common/config-manager.h"
@@ -80,8 +80,6 @@ static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1
static const char *outputRateLabels[] = { _s("<default>"), _s("8 kHz"), _s("11kHz"), _s("22 kHz"), _s("44 kHz"), _s("48 kHz"), 0 };
static const int outputRateValues[] = { 0, 8000, 11025, 22050, 44100, 48000, -1 };
-
-
OptionsDialog::OptionsDialog(const Common::String &domain, int x, int y, int w, int h)
: Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _tabWidget(0) {
init();
@@ -92,22 +90,40 @@ OptionsDialog::OptionsDialog(const Common::String &domain, const Common::String
init();
}
+OptionsDialog::~OptionsDialog() {
+ delete _subToggleGroup;
+}
+
void OptionsDialog::init() {
_enableGraphicSettings = false;
_gfxPopUp = 0;
+ _gfxPopUpDesc = 0;
_renderModePopUp = 0;
+ _renderModePopUpDesc = 0;
_fullscreenCheckbox = 0;
_aspectCheckbox = 0;
+ _disableDitheringCheckbox = 0;
_enableAudioSettings = false;
_midiPopUp = 0;
+ _midiPopUpDesc = 0;
_oplPopUp = 0;
+ _oplPopUpDesc = 0;
_outputRatePopUp = 0;
+ _outputRatePopUpDesc = 0;
_enableMIDISettings = false;
_gmDevicePopUp = 0;
+ _gmDevicePopUpDesc = 0;
+ _soundFont = 0;
+ _soundFontButton = 0;
+ _soundFontClearButton = 0;
_multiMidiCheckbox = 0;
+ _midiGainDesc = 0;
+ _midiGainSlider = 0;
+ _midiGainLabel = 0;
_enableMT32Settings = false;
_mt32Checkbox = 0;
_mt32DevicePopUp = 0;
+ _mt32DevicePopUpDesc = 0;
_enableGSCheckbox = 0;
_enableVolumeSettings = false;
_musicVolumeDesc = 0;
@@ -192,6 +208,7 @@ void OptionsDialog::open() {
// Aspect ratio setting
_aspectCheckbox->setState(ConfMan.getBool("aspect_ratio", _domain));
#endif // SMALL_SCREEN_DEVICE
+ _disableDitheringCheckbox->setState(ConfMan.getBool("disable_dithering", _domain));
}
// Audio options
@@ -213,14 +230,8 @@ void OptionsDialog::open() {
}
if (_multiMidiCheckbox) {
- if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device")) {
- if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
- if (!loadMusicDeviceSetting(_gmDevicePopUp, Common::String(), MT_GM))
- _gmDevicePopUp->setSelected(0);
- } else {
- _gmDevicePopUp->setSelected(0);
- }
- }
+ if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device"))
+ _gmDevicePopUp->setSelected(0);
// Multi midi setting
_multiMidiCheckbox->setState(ConfMan.getBool("multi_midi", _domain));
@@ -244,14 +255,8 @@ void OptionsDialog::open() {
// MT-32 options
if (_mt32DevicePopUp) {
- if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device")) {
- if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
- if (!loadMusicDeviceSetting(_mt32DevicePopUp, Common::String(), MT_MT32))
- _mt32DevicePopUp->setSelected(0);
- } else {
- _mt32DevicePopUp->setSelected(0);
- }
- }
+ if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device"))
+ _mt32DevicePopUp->setSelected(0);
// Native mt32 setting
_mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain));
@@ -309,6 +314,7 @@ void OptionsDialog::close() {
if (_enableGraphicSettings) {
ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain);
ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
+ ConfMan.setBool("disable_dithering", _disableDitheringCheckbox->getState(), _domain);
bool isSet = false;
@@ -332,6 +338,7 @@ void OptionsDialog::close() {
} else {
ConfMan.removeKey("fullscreen", _domain);
ConfMan.removeKey("aspect_ratio", _domain);
+ ConfMan.removeKey("disable_dithering", _domain);
ConfMan.removeKey("gfx_mode", _domain);
ConfMan.removeKey("render_mode", _domain);
}
@@ -518,6 +525,7 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) {
_fullscreenCheckbox->setEnabled(enabled);
_aspectCheckbox->setEnabled(enabled);
#endif
+ _disableDitheringCheckbox->setEnabled(enabled);
}
void OptionsDialog::setAudioSettingsState(bool enabled) {
@@ -657,6 +665,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
// Aspect ratio checkbox
_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for 320x200 games"));
+ _disableDitheringCheckbox = new CheckboxWidget(boss, prefix + "grDisableDitheringCheckbox", _("EGA undithering"), _("Enable undithering in EGA games that support it"));
_enableGraphicSettings = true;
}
@@ -679,7 +688,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType());
if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS // global dialog - skip useless FM-Towns, C64, Amiga, AppleIIGS options there
- && d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS)
+ && d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS && d->getMusicType() != MT_PC98)
|| (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified
|| (_guioptions & deviceGuiOption) // flag is present
// HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set,
@@ -719,13 +728,25 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
// Populate
const MusicPlugin::List p = MusicMan.getPlugins();
+ // Make sure the null device is the first one in the list to avoid undesired
+ // auto detection for users who don't have a saved setting yet.
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
MusicDevices i = (**m)->getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
- if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") {
+ if (d->getMusicDriverId() == "null")
+ _gmDevicePopUp->appendEntry(_("Don't use General MIDI music"), d->getHandle());
+ }
+ }
+ // Now we add the other devices.
+ for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (**m)->getDevices();
+ for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
+ if (d->getMusicType() >= MT_GM) {
if (d->getMusicType() != MT_MT32)
_gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
- }
+ } else if (d->getMusicDriverId() == "auto") {
+ _gmDevicePopUp->appendEntry(_("Use first available device"), d->getHandle());
+ }
}
}
@@ -769,12 +790,23 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi
_enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack"));
const MusicPlugin::List p = MusicMan.getPlugins();
+ // Make sure the null device is the first one in the list to avoid undesired
+ // auto detection for users who don't have a saved setting yet.
+ for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (**m)->getDevices();
+ for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
+ if (d->getMusicDriverId() == "null")
+ _mt32DevicePopUp->appendEntry(_("Don't use Roland MT-32 music"), d->getHandle());
+ }
+ }
+ // Now we add the other devices.
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
MusicDevices i = (**m)->getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
- if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") {
+ if (d->getMusicType() >= MT_GM)
_mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
- }
+ else if (d->getMusicDriverId() == "auto")
+ _mt32DevicePopUp->appendEntry(_("Use first available device"), d->getHandle());
}
}