aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-12-11 05:11:28 +0100
committerJohannes Schickel2011-12-11 05:11:28 +0100
commit54819a5448f8db1fd4588ebced63a390b9d0134f (patch)
tree66d13a2bd2bc18bb684ba40c30e626c9f5754ea4 /engines
parent93e817fc6351c2d9216a1a328979c0742b9a90d6 (diff)
downloadscummvm-rg350-54819a5448f8db1fd4588ebced63a390b9d0134f.tar.gz
scummvm-rg350-54819a5448f8db1fd4588ebced63a390b9d0134f.tar.bz2
scummvm-rg350-54819a5448f8db1fd4588ebced63a390b9d0134f.zip
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.
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/sound.cpp18
1 files 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");
}
}