aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2015-06-30 16:11:26 +0200
committerMartin Kiewitz2015-06-30 16:11:26 +0200
commitbf180101a696b5def2335ad296dc7949969ebd99 (patch)
treebdf42d661cc1874cd4f1ff08a35de1f276e007d3
parentf7ac1e944a273923735f1a79335cd043040b2c6a (diff)
downloadscummvm-rg350-bf180101a696b5def2335ad296dc7949969ebd99.tar.gz
scummvm-rg350-bf180101a696b5def2335ad296dc7949969ebd99.tar.bz2
scummvm-rg350-bf180101a696b5def2335ad296dc7949969ebd99.zip
GROOVIE: add support for TIMB chunk
also fix MT32 instrument filename (which was "fatFAT.MT" by accident)
-rw-r--r--engines/groovie/music.cpp17
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 &gtlName) :
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 &gtlName)
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 &gtlName)
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