aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-06-15 07:24:10 +0200
committerTorbjörn Andersson2015-06-15 07:24:10 +0200
commit1fc1d5cc88c5c2bc703642fc66f979bbe9164816 (patch)
tree822024a8fd7fa744b1ab059104f1e7edfc0a92a1
parent142812e843f9ecb8fbe76b3d32e89b5a17674511 (diff)
downloadscummvm-rg350-1fc1d5cc88c5c2bc703642fc66f979bbe9164816.tar.gz
scummvm-rg350-1fc1d5cc88c5c2bc703642fc66f979bbe9164816.tar.bz2
scummvm-rg350-1fc1d5cc88c5c2bc703642fc66f979bbe9164816.zip
SHERLOCK: Use standard MIDI drivers for Rose Tattoo
As far as I understand, the Rose Tattoo music is standard XMIDI, so it can be played on any GM device. The music now sounds like I remember it from DOSBox. (I'm currently limited to AdLib music in DOSBox, so I can't make any proper comparison.) AdLib support currently depends on ScummVM's GM -> AdLib conversion, so that does not match the original. I'm not sure about MT-32, but since I have no reason to believe that there is MT-32 specific music - at least not in the way the Serrated Scalpel MT-32 driver expects - we can probably rely on our default driver to a reasonable job of it.
-rw-r--r--engines/sherlock/music.cpp52
1 files changed, 33 insertions, 19 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 29e122f09c..7cf80537f3 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -218,29 +218,40 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
if (_vm->_interactiveFl)
_vm->_res->addToCache("MUSIC.LIB");
- _midiParser = (IS_SERRATED_SCALPEL) ? new MidiParser_SH() : MidiParser::createParser_XMIDI();
+ MidiDriver::DeviceHandle dev;
- MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
- _musicType = MidiDriver::getMusicType(dev);
+ if (IS_SERRATED_SCALPEL) {
+ _midiParser = new MidiParser_SH();
+ dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
+ _musicType = MidiDriver::getMusicType(dev);
- switch (_musicType) {
- case MT_ADLIB:
- _midiDriver = MidiDriver_AdLib_create();
- break;
- case MT_MT32:
- _midiDriver = MidiDriver_MT32_create();
- break;
- case MT_GM:
- if (ConfMan.getBool("native_mt32")) {
+ switch (_musicType) {
+ case MT_ADLIB:
+ _midiDriver = MidiDriver_AdLib_create();
+ break;
+ case MT_MT32:
_midiDriver = MidiDriver_MT32_create();
- _musicType = MT_MT32;
+ break;
+ case MT_GM:
+ if (ConfMan.getBool("native_mt32")) {
+ _midiDriver = MidiDriver_MT32_create();
+ _musicType = MT_MT32;
+ }
+ break;
+ default:
+ // Create default one
+ // I guess we shouldn't do this anymore
+ //_midiDriver = MidiDriver::createMidi(dev);
+ break;
}
- break;
- default:
- // Create default one
- // I guess we shouldn't do this anymore
- //_driver = MidiDriver::createMidi(dev);
- break;
+ } else {
+ // TODO: AdLib support uses ScummVM's builtin GM to AdLib
+ // conversion. This won't match the original.
+
+ _midiParser = MidiParser::createParser_XMIDI();
+ dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
+ _musicType = MT_GM;
+ _midiDriver = MidiDriver::createMidi(dev);
}
if (_midiDriver) {
@@ -400,6 +411,9 @@ bool Music::playMusic(const Common::String &name) {
MidiDriver_MT32_newMusicData(_midiDriver, dataPos, dataSize);
break;
+ case MT_GM:
+ break;
+
default:
// should never happen
break;