Skip to content

Commit 1f411e4

Browse files
committed
Stop sounds when pausing a song
1 parent 5fc6564 commit 1f411e4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ private void initComponents() {
199199
if (this.songPlayer.isRunning()) {
200200
this.songPlayer.stop();
201201
this.songPlayer.setTick(0);
202-
if (this.soundSystem != null) this.soundSystem.stopSounds();
203202
} else {
204203
if (this.initSoundSystem()) {
205204
this.soundSystem.setMasterVolume(this.volumeSlider.getValue() / 100F);

src/main/java/net/raphimc/noteblocktool/util/SoundSystemSongPlayer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public void start() {
4949
throw new UnsupportedOperationException("Use start(SoundSystem) instead");
5050
}
5151

52+
@Override
53+
public void stop() {
54+
super.stop();
55+
this.soundSystem.stopSounds();
56+
}
57+
5258
@Override
5359
protected void createTickTask(final long initialDelay) {
5460
super.createTickTask(initialDelay);

0 commit comments

Comments
 (0)