[Scummvm-cvs-logs] scummvm master -> 7ecf553e24ce6d8267e66bb903388ff55805e418
m-kiewitz
m_kiewitz at users.sourceforge.net
Sun Jun 28 01:17:29 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7ecf553e24 GROOVIE: add support for Miles Audio MIDI driver
Commit: 7ecf553e24ce6d8267e66bb903388ff55805e418
https://github.com/scummvm/scummvm/commit/7ecf553e24ce6d8267e66bb903388ff55805e418
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-28T01:16:43+02:00
Commit Message:
GROOVIE: add support for Miles Audio MIDI driver
- currently optional, to enable set milesAudioEnabled to true
Changed paths:
engines/groovie/music.cpp
engines/groovie/music.h
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 2c164e0..795a6e6 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 >lName)
// 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 >lName)
_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 4853840..dcb91d4 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:
More information about the Scummvm-git-logs
mailing list