Skip to content

Update libraryController.java SIMON DAVID #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions mp3app/src/main/java/com/example/mp3app/libraryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,41 @@ protected void toplaylist() throws IOException {

@FXML
protected void playtrack(){
if (mediaPlayer != null && mediaPlayer.getStatus() == MediaPlayer.Status.PLAYING) {
mediaPlayer.pause();
} else {
playCurrentTrack();
}


}
@FXML
protected void pausetrack(){
if (mediaPlayer != null && mediaPlayer.getStatus() == MediaPlayer.Status.PLAYING) {
mediaPlayer.pause();
}

}
@FXML

protected void nexttrack(){
if (currentTrackIndex < songs.size() - 1) {
currentTrackIndex++;
playCurrentTrack();
}

}
@FXML
protected void previoustrack(){
if (currentTrackIndex > 0) {
currentTrackIndex--;
playCurrentTrack();
}

}
@FXML
protected void shuffletrack(){


}
@FXML
Expand All @@ -90,6 +108,9 @@ protected void shuflleandplay(){
}
@FXML
protected void sorttrack(){

}
public void addSong(String title, String artist, String album) {
String songDetails = "Title: " + title + ", Artist: " + artist + ", Album: " + album;
songs.add(songDetails);

}
}