View Single Post
Join Date: Jan 2007
Posts: 706
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 84
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Java program cd player need some help please

 
0
  #5
Oct 24th, 2008
well.. I see no

  1. public boolean isRunning(){
  2. ...
  3. }

in that track list, so what you can do, is keep a local boolean, which you set to true when you start playing a song. so you can do:

  1. private boolean isPlaying = false;
  2. private Track track;
  3.  
  4. ...
  5.  
  6. public void play(){
  7. if (!isPlaying){
  8. this.isPlaying = true;
  9. track.play();
  10. }
  11. }
  12.  
  13. public void stop(){
  14. if ( isPlaying){
  15. this.isPlaying = false;
  16. track.stop();
  17. }
  18. }
Reply With Quote