[Scummvm-cvs-logs] SF.net SVN: scummvm:[35336] scummvm/trunk/sound/midiparser.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Dec 13 13:45:53 CET 2008


Revision: 35336
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35336&view=rev
Author:   lordhoto
Date:     2008-12-13 12:45:53 +0000 (Sat, 13 Dec 2008)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/sound/midiparser.cpp

Modified: scummvm/trunk/sound/midiparser.cpp
===================================================================
--- scummvm/trunk/sound/midiparser.cpp	2008-12-13 12:31:39 UTC (rev 35335)
+++ scummvm/trunk/sound/midiparser.cpp	2008-12-13 12:45:53 UTC (rev 35336)
@@ -285,7 +285,18 @@
 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 @@
 }
 
 void MidiParser::stopPlaying() {
-	if (_smartJump)
-		hangAllActiveNotes();
-	else
-		allNotesOff();
+	allNotesOff();
 	resetTracking();
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list