Exemple #1
0
 public void execute(int globalTime) {
   if (!ap.isPlaying()) {
     int playAt = globalTime - timeStamp;
     ap.play(playAt);
     println("gTime is " + globalTime + " delTime is " + playAt);
   }
 }
Exemple #2
0
  /** Returns true if the song has been played through, otherwise false */
  public boolean isEndOfSong() {
    if (songOver) return true;

    if (!song.isPlaying() && !ourPause) { // If song is not playing and we did not pause
      songOver = true;
      return true;
    } else return false;
  }
Exemple #3
0
 /** Fades the song out, then pauses the song. */
 public void pauseSong() {
   if (!fadeEnter) {
     songPause = System.currentTimeMillis();
     setGainShift(-30);
     fadeEnter = true;
   }
   if (song.isPlaying() && (System.currentTimeMillis() - songPause) >= songFade) {
     song.pause();
   }
   ourPause = true;
 }
Exemple #4
0
 public boolean isPlaying() {
   return song.isPlaying();
 }