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() {
|
public PlayerGUI() {
|
||||||
createUI();
|
createUI();
|
||||||
DatabaseManager.init();
|
|
||||||
resetTree();
|
resetTree();
|
||||||
Thread seekBarUpdater = new Thread(() -> {
|
Thread seekBarUpdater = new Thread(() -> {
|
||||||
boolean running = true;
|
boolean running = true;
|
||||||
@ -58,6 +57,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
DatabaseManager.init();
|
||||||
PlayerGUI playerGUI = new PlayerGUI();
|
PlayerGUI playerGUI = new PlayerGUI();
|
||||||
JFrame frame = new JFrame();
|
JFrame frame = new JFrame();
|
||||||
frame.setContentPane(playerGUI.mainPanel);
|
frame.setContentPane(playerGUI.mainPanel);
|
||||||
@ -347,7 +347,10 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
|||||||
toolBar.add(playButton);
|
toolBar.add(playButton);
|
||||||
JButton pauseButton = new JButton("Pause");
|
JButton pauseButton = new JButton("Pause");
|
||||||
pauseButton.setMnemonic('E');
|
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);
|
toolBar.add(pauseButton);
|
||||||
JButton stopButton = new JButton("Stop");
|
JButton stopButton = new JButton("Stop");
|
||||||
stopButton.setMnemonic('S');
|
stopButton.setMnemonic('S');
|
||||||
|
Loading…
Reference in New Issue
Block a user