From bf180101a696b5def2335ad296dc7949969ebd99 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 30 Jun 2015 16:11:26 +0200 Subject: GROOVIE: add support for TIMB chunk also fix MT32 instrument filename (which was "fatFAT.MT" by accident) --- engines/groovie/music.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index f72e3e4e5a..c00290b155 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -380,18 +380,16 @@ bool MusicPlayerMidi::loadParser(Common::SeekableReadStream *stream, bool loop) MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String >lName) : MusicPlayerMidi(vm) { - // Create the parser - _midiParser = MidiParser::createParser_XMIDI(); // Create the driver MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM); MusicType musicType = MidiDriver::getMusicType(dev); _driver = NULL; - // new Miles Audio support, to enable set milesAudioEnabled to true - // Attention: MT32 timbre file currently not supported, work in progress + // new Miles Audio support, to disable set milesAudioEnabled to false _milesAudioMode = false; - bool milesAudioEnabled = false; + bool milesAudioEnabled = true; + MidiParser::XMidiNewTimbreListProc newTimbreListProc = NULL; if (milesAudioEnabled) { // 7th Guest uses FAT.AD/FAT.OPL/FAT.MT @@ -405,13 +403,17 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String >lName) break; case MT_GM: if (ConfMan.getBool("native_mt32")) { - _driver = Audio::MidiDriver_Miles_MT32_create(gtlName + "FAT.MT"); + _driver = Audio::MidiDriver_Miles_MT32_create(gtlName + ".MT"); musicType = MT_MT32; } break; default: break; } + + if (musicType == MT_MT32) { + newTimbreListProc = Audio::MidiDriver_Miles_MT32_processXMIDITimbreChunk; + } } if (_driver) { @@ -425,6 +427,9 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String >lName) assert(_driver); + // Create the parser + _midiParser = MidiParser::createParser_XMIDI(NULL, NULL, newTimbreListProc, _driver); + _driver->open(); // TODO: Handle return value != 0 (indicating an error) // Set the parser's driver -- cgit v1.2.3