diff options
author | Johannes Schickel | 2008-12-13 12:45:53 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-12-13 12:45:53 +0000 |
commit | 223a57a563746b0ced90428d4405dbe9fdd62d0e (patch) | |
tree | 95d7619240f74fc82657fd95d9909bfc710e3c95 | |
parent | 9555ea8bc9efe3f921b1d935fd9346d70945b9f4 (diff) | |
download | scummvm-rg350-223a57a563746b0ced90428d4405dbe9fdd62d0e.tar.gz scummvm-rg350-223a57a563746b0ced90428d4405dbe9fdd62d0e.tar.bz2 scummvm-rg350-223a57a563746b0ced90428d4405dbe9fdd62d0e.zip |
Cleanup.
svn-id: r35336
-rw-r--r-- | sound/midiparser.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp index 093cde614a..648ad2fe1b 100644 --- a/sound/midiparser.cpp +++ b/sound/midiparser.cpp @@ -285,7 +285,18 @@ void MidiParser::resetTracking() { bool MidiParser::setTrack(int track) { if (track < 0 || track >= _num_tracks) return false; - else if (track == _active_track && _position._play_pos) + // We allow restarting the track via setTrack when + // it isn't playing anymore. This allows us to reuse + // a MidiParser when a track has been played and will + // be restarted via setTrack by the client again. + // This isn't exactly how setTrack behaved before though, + // the old MidiParser code did not allow setTrack to be + // used to restart a track, which was already finished. + // + // TODO: Check if any engine has problem with this + // handling, if so we need to find a better way to handle + // track restarts. (KYRA relies on this working) + else if (track == _active_track && !isPlaying()) return true; if (_smartJump) @@ -302,10 +313,7 @@ bool MidiParser::setTrack(int track) { } void MidiParser::stopPlaying() { - if (_smartJump) - hangAllActiveNotes(); - else - allNotesOff(); + allNotesOff(); resetTracking(); } |