diff options
author | Willem Jan Palenstijn | 2010-01-02 20:20:36 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-01-02 20:20:36 +0000 |
commit | 13a242838fc9ad8c25fd6e250b0931d8564460a4 (patch) | |
tree | cf5027f07259f85e53d67ebecbba5ceb17a6de96 /sound | |
parent | 0b3d3c37a590b116e280f0ffefc26cd3d27b16fd (diff) | |
download | scummvm-rg350-13a242838fc9ad8c25fd6e250b0931d8564460a4.tar.gz scummvm-rg350-13a242838fc9ad8c25fd6e250b0931d8564460a4.tar.bz2 scummvm-rg350-13a242838fc9ad8c25fd6e250b0931d8564460a4.zip |
SCI/new music code: Don't stop notes when looping for a hold
svn-id: r46897
Diffstat (limited to 'sound')
-rw-r--r-- | sound/midiparser.cpp | 24 | ||||
-rw-r--r-- | sound/midiparser.h | 2 |
2 files changed, 14 insertions, 12 deletions
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp index 5aa458a792..99319461e9 100644 --- a/sound/midiparser.cpp +++ b/sound/midiparser.cpp @@ -353,7 +353,7 @@ void MidiParser::hangAllActiveNotes() { } } -bool MidiParser::jumpToTick(uint32 tick, bool fireEvents) { +bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes) { if (_active_track >= _num_tracks) return false; @@ -402,18 +402,20 @@ bool MidiParser::jumpToTick(uint32 tick, bool fireEvents) { } } - if (!_smartJump || !currentPos._play_pos) { - allNotesOff(); - } else { - EventInfo targetEvent(_next_event); - Tracker targetPosition(_position); + if (stopNotes) { + if (!_smartJump || !currentPos._play_pos) { + allNotesOff(); + } else { + EventInfo targetEvent(_next_event); + Tracker targetPosition(_position); - _position = currentPos; - _next_event = currentEvent; - hangAllActiveNotes(); + _position = currentPos; + _next_event = currentEvent; + hangAllActiveNotes(); - _next_event = targetEvent; - _position = targetPosition; + _next_event = targetEvent; + _position = targetPosition; + } } _abort_parse = true; diff --git a/sound/midiparser.h b/sound/midiparser.h index 2e0824c943..0ba12ce2b1 100644 --- a/sound/midiparser.h +++ b/sound/midiparser.h @@ -379,7 +379,7 @@ public: void stopPlaying(); bool setTrack(int track); - bool jumpToTick(uint32 tick, bool fireEvents = false); + bool jumpToTick(uint32 tick, bool fireEvents = false, bool stopNotes = true); uint32 getPPQN() { return _ppqn; } virtual uint32 getTick() { return _position._play_tick; } |