diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mididrv.cpp | 23 | ||||
-rw-r--r-- | sound/mididrv.h | 32 | ||||
-rw-r--r-- | sound/musicplugin.cpp | 2 | ||||
-rw-r--r-- | sound/null.cpp | 7 | ||||
-rw-r--r-- | sound/null.h | 2 | ||||
-rw-r--r-- | sound/softsynth/pcspk.cpp | 2 |
6 files changed, 44 insertions, 24 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index d185626f62..0fa64e8b03 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -95,7 +95,7 @@ MusicType MidiDriver::getMusicType(MidiDriver::DeviceHandle handle) { } } - return MT_NULL; + return MT_AUTO; } Common::String MidiDriver::getDeviceString(DeviceHandle handle, DeviceStringType type) { @@ -139,6 +139,11 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { if (flags & MDT_PCJR) return hdl; break; + + case MT_CMS: + if (flags & MDT_CMS) + return hdl; + break; case MT_ADLIB: if (flags & MDT_ADLIB) @@ -150,14 +155,20 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { return hdl; break; + case MT_PC98: + if (flags & MDT_PC98) + return hdl; + break; + case MT_GM: case MT_GS: case MT_MT32: if (flags & MDT_MIDI) return hdl; + break; + case MT_NULL: - if (getDeviceString(hdl, MidiDriver::kDriverId).equals("null")) - return 0; + return hdl; default: break; @@ -172,7 +183,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { if ((flags & MDT_MIDI) && (l == 1)) { // If a preferred MT32 or GM device has been selected that device gets returned hdl = getDeviceHandle(ConfMan.get((flags & MDT_PREFER_MT32) ? "mt32_device" : ((flags & MDT_PREFER_GM) ? "gm_device" : "auto"), Common::ConfigManager::kApplicationDomain)); - if (getMusicType(hdl) != MT_NULL) { + if (getMusicType(hdl) != MT_AUTO) { if (flags & MDT_PREFER_MT32) // If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h) _forceTypeMT32 = true; @@ -203,7 +214,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { } } - MusicType tp = MT_NULL; + MusicType tp = MT_AUTO; if (flags & MDT_TOWNS) tp = MT_TOWNS; else if (flags & MDT_ADLIB) @@ -211,7 +222,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { else if (flags & MDT_PCSPK) tp = MT_PCSPK; else - tp = MT_NULL; + tp = MT_AUTO; for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); m++) { MusicDevices i = (**m)->getDevices(); diff --git a/sound/mididrv.h b/sound/mididrv.h index ee8ef449f0..de3a38f87d 100644 --- a/sound/mididrv.h +++ b/sound/mididrv.h @@ -50,14 +50,17 @@ namespace Common { class String; } * Music types that music drivers can implement and engines can rely on. */ enum MusicType { - MT_NULL = 0, // Null / Auto - MT_PCSPK = 1, // PC Speaker - MT_PCJR = 2, // PCjr - MT_ADLIB = 3, // AdLib - MT_TOWNS = 4, // FM-TOWNS - MT_GM = 5, // General MIDI - MT_MT32 = 6, // MT-32 - MT_GS = 7 // Roland GS + MT_AUTO = 0, // Auto + MT_NULL, // Null + MT_PCSPK, // PC Speaker + MT_PCJR, // PCjr + MT_CMS, // CMS + MT_ADLIB, // AdLib + MT_TOWNS, // FM-TOWNS + MT_PC98, // PC98 + MT_GM, // General MIDI + MT_MT32, // MT-32 + MT_GS // Roland GS }; /** @@ -75,12 +78,13 @@ enum MidiDriverFlags { MDT_PCSPK = 1 << 0, // PC Speaker: Maps to MD_PCSPK and MD_PCJR MDT_CMS = 1 << 1, // Creative Music System / Gameblaster: Maps to MD_CMS MDT_PCJR = 1 << 2, // Tandy/PC Junior driver - MDT_ADLIB = 1 << 3, // AdLib: Maps to MD_ADLIB - MDT_TOWNS = 1 << 4, // FM-TOWNS: Maps to MD_TOWNS - MDT_MIDI = 1 << 5, // Real MIDI - MDT_PREFER_MIDI = 1 << 6, // Real MIDI output is preferred - MDT_PREFER_MT32 = 1 << 7, // MT-32 output is preferred - MDT_PREFER_GM = 1 << 8 // GM output is preferred + MDT_ADLIB = 1 << 3, // AdLib: Maps to MT_ADLIB + MDT_TOWNS = 1 << 4, // FM-TOWNS: Maps to MT_TOWNS + MDT_PC98 = 1 << 5, // FM-TOWNS: Maps to MT_PC98 + MDT_MIDI = 1 << 6, // Real MIDI + MDT_PREFER_MIDI = 1 << 7, // Real MIDI output is preferred + MDT_PREFER_MT32 = 1 << 8, // MT-32 output is preferred + MDT_PREFER_GM = 1 << 9 // GM output is preferred }; /** diff --git a/sound/musicplugin.cpp b/sound/musicplugin.cpp index 7b5b6608ea..8078094616 100644 --- a/sound/musicplugin.cpp +++ b/sound/musicplugin.cpp @@ -60,7 +60,5 @@ Common::String MusicDevice::getCompleteId() { } MidiDriver::DeviceHandle MusicDevice::getHandle() { - if (_musicDriverId.equals("auto") || _musicDriverId.equals("null")) - return 0; return (MidiDriver::DeviceHandle)Common::hashit(getCompleteId().c_str()); } diff --git a/sound/null.cpp b/sound/null.cpp index c61add2c02..9be545ab76 100644 --- a/sound/null.cpp +++ b/sound/null.cpp @@ -45,8 +45,15 @@ public: const char *getId() const { return "auto"; } + MusicDevices getDevices() const; }; +MusicDevices AutoMusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, _s(""), MT_AUTO)); + return devices; +} + //#if PLUGIN_ENABLED_DYNAMIC(NULL) //REGISTER_PLUGIN_DYNAMIC(NULL, PLUGIN_TYPE_MUSIC, NullMusicPlugin); //#else diff --git a/sound/null.h b/sound/null.h index f8d0a91e2d..d9343701fa 100644 --- a/sound/null.h +++ b/sound/null.h @@ -53,4 +53,4 @@ public: Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const; }; -#endif
\ No newline at end of file +#endif diff --git a/sound/softsynth/pcspk.cpp b/sound/softsynth/pcspk.cpp index 8f66578a0b..fae2b7eef3 100644 --- a/sound/softsynth/pcspk.cpp +++ b/sound/softsynth/pcspk.cpp @@ -184,4 +184,4 @@ MusicDevices PCjrMusicPlugin::getDevices() const { //REGISTER_PLUGIN_DYNAMIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin); //#else REGISTER_PLUGIN_STATIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin); -//#endif
\ No newline at end of file +//#endif |