diff options
-rw-r--r-- | engines/groovie/music.cpp | 17 |
1 files 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 |