diff options
author | Florian Kagerer | 2010-10-24 19:15:17 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-10-24 19:15:17 +0000 |
commit | 0db700a3dced67c607c9e9719ea22347612ead40 (patch) | |
tree | 90f85aaf41fe60a21be4b0d5834bb195af6ad56e /gui | |
parent | f37252e6cfacf1a1546265ffc7895e499a2b7e54 (diff) | |
download | scummvm-rg350-0db700a3dced67c607c9e9719ea22347612ead40.tar.gz scummvm-rg350-0db700a3dced67c607c9e9719ea22347612ead40.tar.bz2 scummvm-rg350-0db700a3dced67c607c9e9719ea22347612ead40.zip |
GUI/LAUNCHER: improved MIDI device selection (also #3088438)
This fixes an issue with the <default> setting in the GM and MT-32 device tabs that has caused some complaints and discussions on -devel. It might also be what bug #3088438 is about.
With a <default> setting ScummVM would just use the first available MIDI device (even if this is the not really well working MT-32 emulator). This <default> setting was also indeed set by default - making it even more annoying.
Now there is a new setting for both the GM and MT-32 device tabs ("Don't use GM/MT-32 music").
This will cause MIDI device detection to be skipped and the best of the other devices (Adlib etc.) to be used. This new setting is used as default. So users who haven't specified anything will get Adlib, PC Speaker etc. (if supported by the engine) even if the engine prefers Midi.
There is a new "Use first available device" setting which will have the same effect as the "<default>" setting we had before.
svn-id: r53771
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index e7888cf095..40c6e64126 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -679,7 +679,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 +719,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 +781,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()); } } |