diff options
author | athrxx | 2011-06-05 18:26:25 +0200 |
---|---|---|
committer | athrxx | 2011-06-05 18:29:13 +0200 |
commit | 43075248aaef68ab9eef39c8988854f00eb694b0 (patch) | |
tree | e407a94d11c6075cf935f274a5864e549a26b0c9 /audio/softsynth/mt32.cpp | |
parent | 75297cb124c72a40d079a9bb0bb372993de8acbb (diff) | |
download | scummvm-rg350-43075248aaef68ab9eef39c8988854f00eb694b0.tar.gz scummvm-rg350-43075248aaef68ab9eef39c8988854f00eb694b0.tar.bz2 scummvm-rg350-43075248aaef68ab9eef39c8988854f00eb694b0.zip |
AUDIO: fix device detection (missing rom files for MT-32 emu)
This is an attempt to fix the problem Max described in his devel mail.
The presence of the rom files will now be checked in detectDevice().
In case of failure there will be fallback attempts.
The user will get notified of the detection failure if he has expressly selected the device that failed.
Please test with your platform / engine (with or without rom files).
Diffstat (limited to 'audio/softsynth/mt32.cpp')
-rw-r--r-- | audio/softsynth/mt32.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp index 27a5a629c4..2ffce306f1 100644 --- a/audio/softsynth/mt32.cpp +++ b/audio/softsynth/mt32.cpp @@ -20,6 +20,7 @@ */ #include "common/scummsys.h" +#include "common/system.h" #ifdef USE_MT32EMU @@ -547,6 +548,7 @@ public: } MusicDevices getDevices() const; + bool checkDevice(MidiDriver::DeviceHandle) const; Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const; }; @@ -556,6 +558,16 @@ MusicDevices MT32EmuMusicPlugin::getDevices() const { return devices; } +bool MT32EmuMusicPlugin::checkDevice(MidiDriver::DeviceHandle) const { + if (!((Common::File::exists("MT32_CONTROL.ROM") && Common::File::exists("MT32_PCM.ROM")) || + (Common::File::exists("CM32L_CONTROL.ROM") && Common::File::exists("CM32L_PCM.ROM")))) { + warning("The MT-32 emulator requires the following 2 files (not bundled with ScummVM:\n either 'MT32_CONTROL.ROM' and 'MT32_PCM.ROM' or 'CM32L_CONTROL.ROM' and 'CM32L_PCM.ROM'"); + return false; + } + + return true; +} + Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const { if (ConfMan.hasKey("extrapath")) SearchMan.addDirectory("extrapath", ConfMan.get("extrapath")); |