diff options
Diffstat (limited to 'queen')
-rw-r--r-- | queen/music.cpp | 7 | ||||
-rw-r--r-- | queen/music.h | 3 | ||||
-rw-r--r-- | queen/queen.cpp | 10 |
3 files changed, 16 insertions, 4 deletions
diff --git a/queen/music.cpp b/queen/music.cpp index a265cca85e..98054a33d6 100644 --- a/queen/music.cpp +++ b/queen/music.cpp @@ -42,7 +42,7 @@ static const byte mt32_to_gm[128] = { 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x }; - MusicPlayer::MusicPlayer(MidiDriver *driver, byte *data, uint32 size) : _driver(driver), _isPlaying(false), _looping(false), _randomLoop(false), _masterVolume(192), _queuePos(0), _musicData(data), _musicDataSize(size) { + MusicPlayer::MusicPlayer(MidiDriver *driver, byte *data, uint32 size) : _driver(driver), _isPlaying(false), _looping(false), _randomLoop(false), _masterVolume(192), _queuePos(0), _musicData(data), _musicDataSize(size), _passThrough(false) { memset(_channel, 0, sizeof(_channel)); queueClear(); _lastSong = _currentSong = 0; @@ -123,6 +123,11 @@ static const byte mt32_to_gm[128] = { } void MusicPlayer::send(uint32 b) { + if (_passThrough) { + _driver->send(b); + return; + } + byte channel = (byte)(b & 0x0F); if ((b & 0xFFF0) == 0x07B0) { // Adjust volume changes by master volume diff --git a/queen/music.h b/queen/music.h index 5076d5fba5..8ecdaf9b80 100644 --- a/queen/music.h +++ b/queen/music.h @@ -45,6 +45,7 @@ public: void queueTuneList(int16 tuneList); bool queueSong(uint16 songNum); void queueClear(); + void setPassThrough(bool b) { _passThrough = b; } //MidiDriver interface implementation int open(); @@ -77,6 +78,7 @@ protected: MidiChannel *_channel[16]; byte _channelVolume[16]; bool _nativeMT32; + bool _passThrough; Common::RandomSource _rnd; @@ -104,6 +106,7 @@ public: void queueTuneList(int16 tuneList) { _player->queueTuneList(tuneList); } void playMusic() { _player->playMusic(); } void stopSong() { _player->stopMusic(); } + void setPassThrough(bool b) { _player->setPassThrough(b); } void toggleVChange(); void setVolume(int vol) { _player->setVolume(vol); } diff --git a/queen/queen.cpp b/queen/queen.cpp index 79b63ed241..038755043e 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -347,14 +347,18 @@ void QueenEngine::initialise(void) { _logic = new LogicGame(this); } - MidiDriver *driver = GameDetector::createMidi(GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE)); + int midiDriver = GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE); + MidiDriver *driver = GameDetector::createMidi(midiDriver); if (!driver) driver = MidiDriver_ADLIB_create(_mixer); - else if (ConfMan.getBool("native_mt32")) + else if (ConfMan.getBool("native_mt32") || (midiDriver == MD_MT32)) driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); _music = new Music(driver, this); - _music->hasNativeMT32(ConfMan.getBool("native_mt32")); + _music->hasNativeMT32(ConfMan.getBool("native_mt32") || (midiDriver == MD_MT32)); + + if (midiDriver == MD_MT32) + _music->setPassThrough(true); _sound = Sound::giveSound(_mixer, this, _resource->compression()); _walk = new Walk(this); |