Skip to content

Commit

Permalink
Pausing music when none is playing stops timer (#46)
Browse files Browse the repository at this point in the history
If you pause music, nothing should ever play. If no music was playing, it shouldn't be able to play a music (display would be broken otherwise).
  • Loading branch information
charlyb01 committed Dec 6, 2023
1 parent fa2b85e commit ea2681c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ private void handleMusic(CallbackInfo ci) {
ci.cancel();
}
}

// Stop decrementing if music paused
if (MusicControlClient.isPaused &&
(this.current == null
|| (this.client != null && !this.client.getSoundManager().isPlaying(this.current)))) {
this.timeUntilNextSong++;
}
}

private void displayMusic() {
Expand Down

0 comments on commit ea2681c

Please sign in to comment.