Because i wan't to create a audio player that support tracklists. I know that i can pull the player to in order to know if the song has terminated, but this is an horrible way to do ( because this means that i need to create another thread than the one the player use)....
The better solution is that the player throw an event or call a callback when the song is terminated. That way, i just need to put the next song in the callback (and i need to put some thread safe stuff)
Generally players work like this... Real time coding is not the better option (it's just my opinion).