From 54819a5448f8db1fd4588ebced63a390b9d0134f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 11 Dec 2011 05:11:28 +0100 Subject: CINE: Fall back to AdLib, in case a user tries to use the MT-32 output with an GM device. The driver is really specific to the Roland MT-32 right now, since it uses MT-32 specific sysEx messages to setup instruments etc. --- engines/cine/sound.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index 1fb18a9885..35c379baee 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -27,6 +27,7 @@ #include "common/textconsole.h" #include "common/timer.h" #include "common/mutex.h" +#include "common/config-manager.h" #include "cine/cine.h" #include "cine/sound.h" @@ -899,17 +900,22 @@ void PCSoundFxPlayer::unload() { PCSound::PCSound(Audio::Mixer *mixer, CineEngine *vm) - : Sound(mixer, vm) { + : Sound(mixer, vm), _soundDriver(0) { const MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB); const MusicType musicType = MidiDriver::getMusicType(dev); if (musicType == MT_MT32 || musicType == MT_GM) { - MidiDriver *driver = MidiDriver::createMidi(dev); - if (driver && driver->open() == 0) { - driver->sendMT32Reset(); - _soundDriver = new MidiSoundDriverH32(driver); + const bool isMT32 = (musicType == MT_MT32 || ConfMan.getBool("native_mt32")); + if (isMT32) { + MidiDriver *driver = MidiDriver::createMidi(dev); + if (driver && driver->open() == 0) { + driver->sendMT32Reset(); + _soundDriver = new MidiSoundDriverH32(driver); + } else { + warning("Could not create MIDI output, falling back to AdLib"); + } } else { - warning("Could not create MIDI output falling back to AdLib"); + warning("General MIDI output devices are not supported, falling back to AdLib"); } } -- cgit v1.2.3