diff --git a/src/main/java/musicplayer/Player.java b/src/main/java/musicplayer/Player.java index 123086f..c8a4160 100644 --- a/src/main/java/musicplayer/Player.java +++ b/src/main/java/musicplayer/Player.java @@ -18,6 +18,7 @@ public class Player { private Thread thread; private Song currentSong; private PlayerCallbackInterface callbackInterface; + private int currentVolume = 100; /** * Manages GStreamer based playback operations. @@ -40,6 +41,7 @@ public class Player { }); callbackThing.start(); }); + currentVolume = getVolume(); } /** @@ -62,6 +64,7 @@ public class Player { playBin.setURI(songFile.toURI()); internalThread = new InternalThread(); thread = new Thread(internalThread); + setVolume(currentVolume); playBin.play(); thread.start(); while (true) { @@ -115,6 +118,7 @@ public class Player { * @param volume New volume in percent. */ public void setVolume(int volume){ + currentVolume = volume; playBin.setVolumePercent(volume); }