diff options
author | Jamieson Christian | 2003-05-19 05:04:38 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-05-19 05:04:38 +0000 |
commit | 417dc08484c6ecfc0b3aa64a18decfc85f2b95d4 (patch) | |
tree | f177dc64c2151718a25c7bf03e48843e0c973deb /scumm/sound.cpp | |
parent | ff418964800f14c6041b072c8d510005929c19f2 (diff) | |
download | scummvm-rg350-417dc08484c6ecfc0b3aa64a18decfc85f2b95d4.tar.gz scummvm-rg350-417dc08484c6ecfc0b3aa64a18decfc85f2b95d4.tar.bz2 scummvm-rg350-417dc08484c6ecfc0b3aa64a18decfc85f2b95d4.zip |
Proof of concept for XMIDI parser in Humongous games.
You must still uncomment the VAR_SOUNDPARAM setting for this to work...?
svn-id: r7670
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r-- | scumm/sound.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 60e549bbe8..3f2ea63ed1 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -31,6 +31,8 @@ #include "common/config-file.h" #include "common/util.h" +#include "sound/midiparser.h" + Sound::Sound(Scumm *parent) { memset(this,0,sizeof(Sound)); // palmos @@ -174,6 +176,8 @@ void Sound::playSound(int soundID) { int rate; byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; +debug (0, "playSound (%d)", soundID); + debug(3,"playSound #%d (room %d)", soundID, _scumm->getResourceRoomNr(rtSound, soundID)); ptr = _scumm->getResourceAddress(rtSound, soundID); if (ptr) { @@ -244,6 +248,25 @@ void Sound::playSound(int soundID) { // XMI playing stuff goes here // ptr should be pointing to XMI file in memory + // HACK (Jamieson630): Just to see if it works. + static MidiParser *parser = 0; + + MidiDriver *driver = 0; + if (_scumm && _scumm->_imuse) + driver = _scumm->_imuse->getMidiDriver(); + if (driver) { + driver->setTimerCallback (0, 0); + if (parser) { + delete parser; + parser = 0; + } + parser = MidiParser::createParser_XMIDI(); + parser->setMidiDriver (driver); + parser->setTimerRate (driver->getBaseTempo()); + parser->loadMusic (ptr, size); + driver->open(); + driver->setTimerCallback (parser, &MidiParser::timerCallback); + } // FIXME: dumping xmi files for testing, remove when working if (1) { |