diff options
Diffstat (limited to 'engines/sci/sound/music.cpp')
-rw-r--r-- | engines/sci/sound/music.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 874f0a381e..cf084f81eb 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -166,8 +166,6 @@ void SciMusic::pauseAll(bool pause) { } void SciMusic::stopAll() { - Common::StackLock lock(_mutex); - const MusicList::iterator end = _playList.end(); for (MusicList::iterator i = _playList.begin(); i != end; ++i) { soundStop(*i); @@ -199,6 +197,24 @@ MusicEntry *SciMusic::getSlot(reg_t obj) { return NULL; } +// We return the currently active music slot for SCI0 +MusicEntry *SciMusic::getActiveSci0MusicSlot() { + const MusicList::iterator end = _playList.end(); + MusicEntry *highestPrioritySlot = NULL; + for (MusicList::iterator i = _playList.begin(); i != end; ++i) { + MusicEntry *playSlot = *i; + if (playSlot->pMidiParser) { + if (playSlot->status == kSoundPlaying) + return playSlot; + if (playSlot->status == kSoundPaused) { + if ((!highestPrioritySlot) || (highestPrioritySlot->priority < playSlot->priority)) + highestPrioritySlot = playSlot; + } + } + } + return highestPrioritySlot; +} + void SciMusic::setReverb(byte reverb) { Common::StackLock lock(_mutex); _pMidiDrv->setReverb(reverb); |