Esempio n. 1
0
 public void Restart() {
   if (player != null && !player.getSourceLocation().equals(null)
       || !player.getSourceLocation().equals("")) {
     player.stop();
     player.play();
   }
 }
Esempio n. 2
0
 /**
  * Constructs a new MusicPlayer object, to use the specified music file.
  *
  * @param filePath - path to the music file.
  * @param volume - volume the file should be played at.
  */
 public MP3MusicPlayer(String filename) {
   super(filename);
   try {
     player = new Player();
     //  player.setCurrentVolume(volume);
     player.setSourceLocation(filename);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Esempio n. 3
0
 /** Pauses the music file. */
 public void Pause() {
   if (player != null && !player.getSourceLocation().equals(null)
       || !player.getSourceLocation().equals("")) {
     player.pause();
   }
 }