diff options
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/music.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sound/music.h | 2 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 5 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.h | 3 |
4 files changed, 12 insertions, 1 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 74dca191a8..fe1d4fdbbb 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -67,8 +67,9 @@ void SciMusic::init() { // Default to MIDI in SCI2.1+ games, as many don't have AdLib support. Common::Platform platform = g_sci->getPlatform(); uint32 dev = MidiDriver::detectDevice((getSciVersion() >= SCI_VERSION_2_1) ? (MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM) : (MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI)); + _musicType = MidiDriver::getMusicType(dev); - switch (MidiDriver::getMusicType(dev)) { + switch (_musicType) { case MT_ADLIB: // FIXME: There's no Amiga sound option, so we hook it up to AdLib if (g_sci->getPlatform() == Common::kPlatformAmiga || platform == Common::kPlatformMacintosh) diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index dfef49e3bf..b10f64aa18 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -155,6 +155,7 @@ public: void soundSetSoundOn(bool soundOnFlag); uint16 soundGetVoices(); uint32 soundGetTempo() const { return _dwTempo; } + MusicType soundGetMusicType() const { return _musicType; } bool soundIsActive(MusicEntry *pSnd) { assert(pSnd->pStreamAud != 0); @@ -218,6 +219,7 @@ private: MusicEntry *_usedChannel[16]; MidiCommandQueue _queuedCommands; + MusicType _musicType; int _driverFirstChannel; }; diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index c85d4c90a6..84aedc8515 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -696,4 +696,9 @@ void SoundCommandParser::pauseAll(bool pause) { _music->pauseAll(pause); } +MusicType SoundCommandParser::getMusicType() const { + assert(_music); + return _music->soundGetMusicType(); +} + } // End of namespace Sci diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index 4f006c20d8..61371d903f 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -27,6 +27,7 @@ #define SCI_SOUNDCMD_H #include "common/list.h" +#include "sound/mididrv.h" // for MusicType #include "sci/engine/state.h" namespace Sci { @@ -67,6 +68,8 @@ public: void processPlaySound(reg_t obj); void processStopSound(reg_t obj, bool sampleFinishedPlaying); + MusicType getMusicType() const; + /** * Synchronizes the current state of the music list to the rest of the engine, so that * the changes that the sound thread makes to the music are registered with the engine |