I am working on a small sound player which plays songs. I am using the TinySound library https://github.com/finnkuusisto/TinySound. And as I can see from the API, it does come with a method called .done() which tells me wheter a Music object is finished playing or not, but how can I test for it while playing?
I have currently created a JFrame with buttons and a Jlist which displays the songs, but I understand that if I try some sort of while loop to listen for wheter or not the song is finished I wont be able to use the other buttons such as stop, pause etc.
I was thinking somewhere along this line (pseudo code):
while(theSong.playing()){
if(theSong.done()){
playNext();
}
}
The problem is that when entering the while loop, I am not able to use any other functions in my program. If anyone wants to see some sample code, please let me know!
Sindre M