aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie
diff options
context:
space:
mode:
authorMartin Kiewitz2015-06-28 01:16:43 +0200
committerMartin Kiewitz2015-06-28 01:16:43 +0200
commit7ecf553e24ce6d8267e66bb903388ff55805e418 (patch)
treee13eaf178fe05631179af6274d7301a3fda2214d /engines/groovie
parent0655839a4ff2a3805919c0b9bfa8f035d015e641 (diff)
downloadscummvm-rg350-7ecf553e24ce6d8267e66bb903388ff55805e418.tar.gz
scummvm-rg350-7ecf553e24ce6d8267e66bb903388ff55805e418.tar.bz2
scummvm-rg350-7ecf553e24ce6d8267e66bb903388ff55805e418.zip
GROOVIE: add support for Miles Audio MIDI driver
- currently optional, to enable set milesAudioEnabled to true
Diffstat (limited to 'engines/groovie')
-rw-r--r--engines/groovie/music.cpp46
-rw-r--r--engines/groovie/music.h2
2 files changed, 47 insertions, 1 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 2c164e020c..795a6e6f2d 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -36,6 +36,7 @@
#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/midiparser.h"
+#include "audio/miles.h"
namespace Groovie {
@@ -384,7 +385,42 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String &gtlName)
// Create the driver
MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
- _driver = MidiDriver::createMidi(dev);
+ 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
+ _milesAudioMode = false;
+ bool milesAudioEnabled = false;
+
+ if (milesAudioEnabled) {
+ // 7th Guest uses FAT.AD/FAT.OPL/FAT.MT
+ // 11th Hour uses SAMPLE.AD/SAMPLE.OPL/SAMPLE.MT
+ switch (musicType) {
+ case MT_ADLIB:
+ _driver = Audio::MidiDriver_Miles_AdLib_create(gtlName + ".AD", gtlName + ".OPL");
+ break;
+ case MT_MT32:
+ _driver = Audio::MidiDriver_Miles_MT32_create(gtlName + ".MT");
+ break;
+ case MT_GM:
+ if (ConfMan.getBool("native_mt32")) {
+ _driver = Audio::MidiDriver_Miles_MT32_create(gtlName + "FAT.MT");
+ musicType = MT_MT32;
+ }
+ break;
+ }
+ }
+
+ if (_driver) {
+ _milesAudioMode = true;
+ }
+
+ if (!_driver) {
+ // No driver yet? create a generic one
+ _driver = MidiDriver::createMidi(dev);
+ }
+
assert(_driver);
_driver->open(); // TODO: Handle return value != 0 (indicating an error)
@@ -400,6 +436,9 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String &gtlName)
_chanBanks[i] = 0;
}
+ if (_milesAudioMode)
+ return;
+
// Load the Global Timbre Library
if (MidiDriver::getMusicType(dev) == MT_ADLIB) {
// MIDI through AdLib
@@ -433,6 +472,11 @@ MusicPlayerXMI::~MusicPlayerXMI() {
}
void MusicPlayerXMI::send(uint32 b) {
+ if (_milesAudioMode) {
+ MusicPlayerMidi::send(b);
+ return;
+ }
+
if ((b & 0xFFF0) == 0x72B0) { // XMIDI Patch Bank Select 114
// From AIL2's documentation: XMIDI Patch Bank Select controller (114)
// selects a bank to be used when searching the next patches
diff --git a/engines/groovie/music.h b/engines/groovie/music.h
index 4853840673..dcb91d42a8 100644
--- a/engines/groovie/music.h
+++ b/engines/groovie/music.h
@@ -134,6 +134,8 @@ private:
// Output music type
uint8 _musicType;
+ bool _milesAudioMode;
+
// Timbres
class Timbre {
public: