Skip to content

Commit

Permalink
ditek#12 fix: When playback is paused, cancel any pending play events
Browse files Browse the repository at this point in the history
  • Loading branch information
ditek committed Aug 9, 2019
1 parent 728b1eb commit 45ca67c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/com/midisheetmusic/MidiPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,14 @@ public void Pause() {
if (midifile == null || sheet == null || numberTracks() == 0) {
return;
}

// Cancel pending play events
timer.removeCallbacks(DoPlay);

if (playstate == playing) {
playstate = initPause;
}
if (playstate == midi) {
else if (playstate == midi) {
playstate = paused;
}
}
Expand Down

0 comments on commit 45ca67c

Please sign in to comment.