aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-07-21 20:37:46 +0000
committerJohannes Schickel2010-07-21 20:37:46 +0000
commit41190f8a7bf74087b113227fb831780d647ade05 (patch)
tree166884e1c5e4d01941e749a34395f8c8241c3280
parent781aee909bd029f51fe8348dc1158f6835fc7d5b (diff)
downloadscummvm-rg350-41190f8a7bf74087b113227fb831780d647ade05.tar.gz
scummvm-rg350-41190f8a7bf74087b113227fb831780d647ade05.tar.bz2
scummvm-rg350-41190f8a7bf74087b113227fb831780d647ade05.zip
GUI: Properly show external MIDI devices.
Formerly in case a game only specified GUIO_MIDIMT32, only the MT-32 Emulator was shown, since that is the only device which is of type MT_MT32. All external MIDI devices are currently only flagged with MT_GM. svn-id: r51107
-rw-r--r--gui/options.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index 0553e5910a..ed56630a62 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -657,9 +657,15 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
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) {
+ const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType());
+
if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS) // global dialog - skip useless FM-Towns option there
|| (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified
- || _guioptions & (MidiDriver::musicType2GUIO(d->getMusicType())) // flag is present
+ || (_guioptions & deviceGuiOption) // flag is present
+ // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set,
+ // else we would not show for example external devices connected via ALSA, since they are always
+ // marked as General MIDI device.
+ || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32))
|| d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device
_midiPopUp->appendEntry(d->getCompleteName(), d->getHandle());