diff options
author | Eugene Sandulenko | 2010-06-15 10:56:12 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-06-15 10:56:12 +0000 |
commit | 67bc7115804b6f256f776fc761f7fffffa901c31 (patch) | |
tree | 56ca91c3a8a3ab0fb3d7154f9fb43fecae0aba90 /sound/mididrv.cpp | |
parent | 2bcafcb02dd406a36fd0a11c6b0df742840a9a7e (diff) | |
download | scummvm-rg350-67bc7115804b6f256f776fc761f7fffffa901c31.tar.gz scummvm-rg350-67bc7115804b6f256f776fc761f7fffffa901c31.tar.bz2 scummvm-rg350-67bc7115804b6f256f776fc761f7fffffa901c31.zip |
GUI: Implement MIDI drivers as GUI options.
Proper version of patch #2988641: "GSoC: Select drivers in GUI
based on output types". So far only SCUMM engine supports this
feature.
svn-id: r49783
Diffstat (limited to 'sound/mididrv.cpp')
-rw-r--r-- | sound/mididrv.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index f7198056b4..c6e208ae47 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -31,6 +31,27 @@ #include "common/util.h" #include "sound/mididrv.h" +static const uint32 GUIOMapping[] = { + MDT_PCSPK, Common::GUIO_MIDIPCSPK, + MDT_CMS, Common::GUIO_MIDICMS, + MDT_PCJR, Common::GUIO_MIDIPCJR, + MDT_ADLIB, Common::GUIO_MIDIADLIB, + MDT_TOWNS, Common::GUIO_MIDITOWNS, + MDT_MIDI, Common::GUIO_MIDI, + 0, 0 +}; + +uint32 MidiDriver::midiDriverFlags2GUIO(uint32 flags) { + uint32 res = 0; + + for (int i = 0; GUIOMapping[i] || GUIOMapping[i + 1]; i += 2) { + if (flags & GUIOMapping[i]) + res |= GUIOMapping[i + 1]; + } + + return res; +} + /** Internal list of all available 'midi' drivers. */ static const MidiDriverDescription s_musicDrivers[] = { |