[Scummvm-cvs-logs] scummvm master -> 54819a5448f8db1fd4588ebced63a390b9d0134f

lordhoto lordhoto at gmail.com
Sun Dec 11 05:12:56 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
54819a5448 CINE: Fall back to AdLib, in case a user tries to use the MT-32 output with an GM device.


Commit: 54819a5448f8db1fd4588ebced63a390b9d0134f
    https://github.com/scummvm/scummvm/commit/54819a5448f8db1fd4588ebced63a390b9d0134f
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-10T20:11:28-08:00

Commit Message:
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.

Changed paths:
    engines/cine/sound.cpp



diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index 1fb18a9..35c379b 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");
 		}
 	}
 






More information about the Scummvm-git-logs mailing list