Pausing now resets the highlighting to the current song. If another entry is then selected before pressing play then that song will be played rather than resuming the paused song.
This commit is contained in:
parent
fb611c3062
commit
d125759c06
@ -40,7 +40,6 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
|
||||
public PlayerGUI() {
|
||||
createUI();
|
||||
DatabaseManager.init();
|
||||
resetTree();
|
||||
Thread seekBarUpdater = new Thread(() -> {
|
||||
boolean running = true;
|
||||
@ -58,6 +57,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
DatabaseManager.init();
|
||||
PlayerGUI playerGUI = new PlayerGUI();
|
||||
JFrame frame = new JFrame();
|
||||
frame.setContentPane(playerGUI.mainPanel);
|
||||
@ -347,7 +347,10 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
toolBar.add(playButton);
|
||||
JButton pauseButton = new JButton("Pause");
|
||||
pauseButton.setMnemonic('E');
|
||||
pauseButton.addActionListener(e -> player.pause());
|
||||
pauseButton.addActionListener(e -> {
|
||||
player.pause();
|
||||
setSongHighlighting(player.getCurrentSong()); // Resume won't function if a different song is selected.
|
||||
});
|
||||
toolBar.add(pauseButton);
|
||||
JButton stopButton = new JButton("Stop");
|
||||
stopButton.setMnemonic('S');
|
||||
|
Loading…
Reference in New Issue
Block a user