[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.112,1.113 options.cpp,1.73,1.74 options.h,1.26,1.27
Eugene Sandulenko
sev at users.sourceforge.net
Tue Apr 12 17:13:29 CEST 2005
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29566/gui
Modified Files:
launcher.cpp options.cpp options.h
Log Message:
Patches #1164217 "Updated GS Support + Percussion Remapping Patch" and
#1181750 "Updated Native MIDI documentation". Thanks _tom a lot.
Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- launcher.cpp 10 Apr 2005 14:33:44 -0000 1.112
+++ launcher.cpp 13 Apr 2005 00:11:41 -0000 1.113
@@ -61,6 +61,7 @@
kCmdGlobalGraphicsOverride = 'OGFX',
kCmdGlobalAudioOverride = 'OSFX',
+ kCmdGlobalMIDIOverride = 'OMID',
kCmdGlobalVolumeOverride = 'OVOL',
kCmdExtraBrowser = 'PEXT',
@@ -128,6 +129,7 @@
CheckboxWidget *_globalGraphicsOverride;
CheckboxWidget *_globalAudioOverride;
+ CheckboxWidget *_globalMIDIOverride;
CheckboxWidget *_globalVolumeOverride;
};
@@ -215,7 +217,7 @@
yoffset += 18;
//
- // 2) The graphics tab
+ // 3) The graphics tab
//
tab->addTab("Gfx");
yoffset = vBorder;
@@ -226,7 +228,7 @@
yoffset = addGraphicControls(tab, yoffset);
//
- // 3) The audio tab
+ // 4) The audio tab
//
tab->addTab("Audio");
yoffset = vBorder;
@@ -234,10 +236,21 @@
_globalAudioOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global audio settings", kCmdGlobalAudioOverride);
yoffset += 16;
+ yoffset = addAudioControls(tab, yoffset);
+
+ //
+ // 5) The MIDI tab
+ //
+ tab->addTab("MIDI");
+ yoffset = vBorder;
+
+ _globalMIDIOverride = new CheckboxWidget(tab, x, yoffset, w, 16, "Override global MIDI settings", kCmdGlobalMIDIOverride);
+ yoffset += 16;
+
yoffset = addMIDIControls(tab, yoffset);
//
- // 3) The volume tab
+ // 6) The volume tab
//
tab->addTab("Volume");
yoffset = vBorder;
@@ -269,10 +282,14 @@
_globalGraphicsOverride->setState(e);
e = ConfMan.hasKey("music_driver", _domain) ||
- ConfMan.hasKey("multi_midi", _domain) ||
- ConfMan.hasKey("native_mt32", _domain);
+ ConfMan.hasKey("subtitles", _domain);
_globalAudioOverride->setState(e);
+ e = ConfMan.hasKey("multi_midi", _domain) ||
+ ConfMan.hasKey("native_mt32", _domain)||
+ ConfMan.hasKey("enable_gs", _domain);
+ _globalMIDIOverride->setState(e);
+
e = ConfMan.hasKey("music_volume", _domain) ||
ConfMan.hasKey("sfx_volume", _domain) ||
ConfMan.hasKey("speech_volume", _domain);
@@ -342,6 +359,10 @@
setAudioSettingsState(data != 0);
draw();
break;
+ case kCmdGlobalMIDIOverride:
+ setMIDISettingsState(data != 0);
+ draw();
+ break;
case kCmdGlobalVolumeOverride:
setVolumeSettingsState(data != 0);
draw();
Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- options.cpp 10 Apr 2005 14:33:44 -0000 1.73
+++ options.cpp 13 Apr 2005 00:11:42 -0000 1.74
@@ -78,7 +78,9 @@
_enableGraphicSettings(false),
_gfxPopUp(0), _renderModePopUp(0), _fullscreenCheckbox(0), _aspectCheckbox(0),
_enableAudioSettings(false),
- _multiMidiCheckbox(0), _mt32Checkbox(0), _subCheckbox(0),
+ _subCheckbox(0),
+ _enableMIDISettings(false),
+ _multiMidiCheckbox(0), _mt32Checkbox(0), _enableGSCheckbox(0),
_enableVolumeSettings(false),
_musicVolumeSlider(0), _musicVolumeLabel(0),
_sfxVolumeSlider(0), _sfxVolumeLabel(0),
@@ -131,7 +133,7 @@
#endif
}
- if (_multiMidiCheckbox) {
+ if (_subCheckbox) {
// Music driver
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
int i = 0;
@@ -145,15 +147,22 @@
}
_midiPopUp->setSelected(md->name ? i : 0);
+ // Subtitles setting
+ _subCheckbox->setState(ConfMan.getBool("subtitles", _domain));
+ }
+
+ if (_multiMidiCheckbox) {
+
// Multi midi setting
_multiMidiCheckbox->setState(ConfMan.getBool("multi_midi", _domain));
// Native mt32 setting
_mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain));
- // Subtitles setting
- _subCheckbox->setState(ConfMan.getBool("subtitles", _domain));
+ // GS extensions setting
+ _enableGSCheckbox->setState(ConfMan.getBool("enable_gs", _domain));
}
+
if (_musicVolumeSlider) {
int vol;
@@ -204,10 +213,8 @@
}
}
- if (_multiMidiCheckbox) {
+ if (_subCheckbox) {
if (_enableAudioSettings) {
- ConfMan.set("multi_midi", _multiMidiCheckbox->getState(), _domain);
- ConfMan.set("native_mt32", _mt32Checkbox->getState(), _domain);
ConfMan.set("subtitles", _subCheckbox->getState(), _domain);
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
while (md->name && md->id != (int)_midiPopUp->getSelectedTag())
@@ -217,13 +224,23 @@
else
ConfMan.removeKey("music_driver", _domain);
} else {
- ConfMan.removeKey("multi_midi", _domain);
- ConfMan.removeKey("native_mt32", _domain);
ConfMan.removeKey("music_driver", _domain);
ConfMan.removeKey("subtitles", _domain);
}
}
+ if (_multiMidiCheckbox) {
+ if (_enableMIDISettings) {
+ ConfMan.set("multi_midi", _multiMidiCheckbox->getState(), _domain);
+ ConfMan.set("native_mt32", _mt32Checkbox->getState(), _domain);
+ ConfMan.set("enable_gs", _enableGSCheckbox->getState(), _domain);
+ } else {
+ ConfMan.removeKey("multi_midi", _domain);
+ ConfMan.removeKey("native_mt32", _domain);
+ ConfMan.removeKey("enable_gs", _domain);
+ }
+ }
+
// Save config file
ConfMan.flushToDisk();
}
@@ -269,9 +286,15 @@
_enableAudioSettings = enabled;
_midiPopUp->setEnabled(enabled);
+ _subCheckbox->setEnabled(enabled);
+}
+
+void OptionsDialog::setMIDISettingsState(bool enabled) {
+ _enableMIDISettings = enabled;
+
_multiMidiCheckbox->setEnabled(enabled);
_mt32Checkbox->setEnabled(enabled);
- _subCheckbox->setEnabled(enabled);
+ _enableGSCheckbox->setEnabled(enabled);
}
void OptionsDialog::setVolumeSettingsState(bool enabled) {
@@ -330,13 +353,13 @@
return yoffset;
}
-int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) {
+int OptionsDialog::addAudioControls(GuiObject *boss, int yoffset) {
const int x = 10;
const int w = _w - 20;
// The MIDI mode popup & a label
_midiPopUp = new PopUpWidget(boss, x-5, yoffset, w+5, kLineHeight, "Music driver: ", 100);
- yoffset += 16;
+ yoffset += 18;
// Populate it
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
@@ -345,25 +368,39 @@
md++;
}
+ // Subtitles on/off
+ _subCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Display subtitles");
+ yoffset += 16;
+
+ yoffset += 18;
+
+ _enableAudioSettings = true;
+
+ return yoffset;
+}
+
+int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) {
+ const int x = 10;
+ const int w = _w - 20;
+
// SoundFont
new ButtonWidget(boss, x, yoffset, kButtonWidth + 14, 16, "SoundFont: ", kChooseSoundFontCmd, 0);
_soundFont = new StaticTextWidget(boss, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft);
-
yoffset += 18;
-
+
// Multi midi setting
_multiMidiCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Mixed Adlib/MIDI mode");
- yoffset += 15;
+ yoffset += 16;
// Native mt32 setting
_mt32Checkbox = new CheckboxWidget(boss, x, yoffset, w, 16, "True Roland MT-32 (disable GM emulation)");
- yoffset += 15;
+ yoffset += 16;
- // Subtitles on/off
- _subCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Display subtitles");
- yoffset += 15;
+ // GS Extensions setting
+ _enableGSCheckbox = new CheckboxWidget(boss, x, yoffset, w, 16, "Enable Roland GS Mode");
+ yoffset += 16;
- _enableAudioSettings = true;
+ _enableMIDISettings = true;
return yoffset;
}
@@ -417,13 +454,19 @@
//
tab->addTab("Audio");
yoffset = vBorder;
- yoffset = addMIDIControls(tab, yoffset);
+ yoffset = addAudioControls(tab, yoffset);
yoffset = addVolumeControls(tab, yoffset);
// TODO: cd drive setting
+ //
+ // 3) The MIDI tab
+ //
+ tab->addTab("MIDI");
+ yoffset = vBorder;
+ yoffset = addMIDIControls(tab, yoffset);
//
- // 3) The miscellaneous tab
+ // 4) The miscellaneous tab
//
tab->addTab("Paths");
yoffset = vBorder;
Index: options.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- options.h 10 Apr 2005 14:33:44 -0000 1.26
+++ options.h 13 Apr 2005 00:11:42 -0000 1.27
@@ -59,11 +59,13 @@
StaticTextWidget *_soundFont;
int addGraphicControls(GuiObject *boss, int yoffset);
+ int addAudioControls(GuiObject *boss, int yoffset);
int addMIDIControls(GuiObject *boss, int yoffset);
int addVolumeControls(GuiObject *boss, int yoffset);
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
+ void setMIDISettingsState(bool enabled);
void setVolumeSettingsState(bool enabled);
private:
@@ -81,9 +83,15 @@
//
bool _enableAudioSettings;
PopUpWidget *_midiPopUp;
+ CheckboxWidget *_subCheckbox;
+
+ //
+ // MIDI controls
+ //
+ bool _enableMIDISettings;
CheckboxWidget *_multiMidiCheckbox;
CheckboxWidget *_mt32Checkbox;
- CheckboxWidget *_subCheckbox;
+ CheckboxWidget *_enableGSCheckbox;
//
// Volume controls
More information about the Scummvm-git-logs
mailing list