public void execute(int globalTime) { if (!ap.isPlaying()) { int playAt = globalTime - timeStamp; ap.play(playAt); println("gTime is " + globalTime + " delTime is " + playAt); } }
/** 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; }
/** 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; }
public boolean isPlaying() { return song.isPlaying(); }