From dc3ea6f2e118fe8fef122d9f6a4915431dcc6941 Mon Sep 17 00:00:00 2001 From: Lenni0451 <20379977+Lenni0451@users.noreply.github.com> Date: Wed, 8 May 2024 19:41:25 +0200 Subject: [PATCH] Removed useless variable --- .../net/raphimc/noteblocktool/frames/SongPlayerFrame.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java b/src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java index a9c2562..e37dff6 100644 --- a/src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java +++ b/src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java @@ -85,7 +85,6 @@ public static void close() { private final JLabel soundCount = new JLabel("Sounds: 0/" + DECIMAL_FORMAT.format(this.maxSoundsSpinner.getValue())); private final JLabel progressLabel = new JLabel("Current Position: 00:00:00"); private SoundSystem soundSystem; - private float volume = 1F; private SongPlayerFrame(final ListFrame.LoadedSong song, final SongView view) { this.song = song; @@ -140,8 +139,7 @@ private void initComponents() { this.volumeSlider.setMajorTickSpacing(25); this.volumeSlider.setMinorTickSpacing(5); this.volumeSlider.addChangeListener(e -> { - this.volume = this.volumeSlider.getValue() / 100F; - if (this.soundSystem != null) this.soundSystem.setMasterVolume(this.volume); + if (this.soundSystem != null) this.soundSystem.setMasterVolume(this.volumeSlider.getValue() / 100F); lastVolume = this.volumeSlider.getValue(); }); }); @@ -216,7 +214,7 @@ private void initComponents() { if (this.soundSystem != null) this.soundSystem.stopSounds(); } else { if (this.initSoundSystem()) { - this.soundSystem.setMasterVolume(this.volume); + this.soundSystem.setMasterVolume(this.volumeSlider.getValue() / 100F); this.songPlayer.play(); } }