Skip to content

Commit

Permalink
new commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Tressos-Aristomenis committed Sep 14, 2018
1 parent 870089e commit 7b843fa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/GameGUI/GameGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ public void run() {
}

@FXML
public void resumeTrack() {
public void resumeTrack() {
MY_MEDIA_PLAYER.play();
}

@FXML
public void pauseTrack() {
public void pauseTrack() {
MY_MEDIA_PLAYER.pause();
}

Expand All @@ -253,8 +253,16 @@ public void playNextTrack() {

MY_MEDIA_PLAYER = new MediaPlayer(currentTrack); // create new media player with another track.
MY_MEDIA_PLAYER.play();
MY_MEDIA_PLAYER.setVolume(volumeSlider.getValue() / 100.0);

nowPlayingLabel.setText(ResourceLoader.TRACKLIST[randomTrackNumber].getName());

MY_MEDIA_PLAYER.setOnEndOfMedia(new Runnable() {
@Override
public void run() {
playNextTrack();
}
});
}

public void updateScore(Player winner) {
Expand Down

0 comments on commit 7b843fa

Please sign in to comment.