aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx/player
diff options
context:
space:
mode:
authorWalter van Niftrik2009-05-05 01:51:39 +0000
committerWalter van Niftrik2009-05-05 01:51:39 +0000
commit274d890f5b9430c44fdaa24a2c67faf54fd4cb18 (patch)
tree0ea097b60e98af27a544383fda42d0f582e93b15 /engines/sci/sfx/player
parente1208f7b2bb578bac6dc265b2bd8ec4eaafe4a2b (diff)
downloadscummvm-rg350-274d890f5b9430c44fdaa24a2c67faf54fd4cb18.tar.gz
scummvm-rg350-274d890f5b9430c44fdaa24a2c67faf54fd4cb18.tar.bz2
scummvm-rg350-274d890f5b9430c44fdaa24a2c67faf54fd4cb18.zip
SCI: Support for 0x4e control changes in new adlib driver, and some cleanup.
svn-id: r40312
Diffstat (limited to 'engines/sci/sfx/player')
-rw-r--r--engines/sci/sfx/player/player.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/sci/sfx/player/player.cpp b/engines/sci/sfx/player/player.cpp
index 90d99c8092..e2ad9e5213 100644
--- a/engines/sci/sfx/player/player.cpp
+++ b/engines/sci/sfx/player/player.cpp
@@ -156,8 +156,12 @@ static int player_add_iterator(SongIterator *it, uint32 start_time) {
SIMSG_SEND(it, SIMSG_SET_PLAYMASK(mididrv->getPlayMask()));
SIMSG_SEND(it, SIMSG_SET_RHYTHM(mididrv->hasRhythmChannel()));
- current_time = Audio::Timestamp(g_system->getMillis(), 1000000 / tempo);
- wakeup_time = Audio::Timestamp(start_time, SFX_TICKS_PER_SEC);
+ if (play_it == NULL) {
+ // Resync with clock
+ current_time = Audio::Timestamp(g_system->getMillis(), 1000000 / tempo);
+ wakeup_time = Audio::Timestamp(start_time, SFX_TICKS_PER_SEC);
+ }
+
play_it = sfx_iterator_combine(play_it, it);
play_it_done = 0;
mutex->unlock();
@@ -171,9 +175,12 @@ static int player_fade_out(void) {
}
static int player_stop(void) {
+ debug(3, "Player: Stopping song iterator %p", (void *)play_it);
mutex->lock();
delete play_it;
play_it = NULL;
+ for (int i = 0; i < MIDI_CHANNELS; i++)
+ static_cast<MidiDriver *>(mididrv)->send(0xb0 + i, SCI_MIDI_CHANNEL_NOTES_OFF, 0);
mutex->unlock();
return SFX_OK;