private static String filename, fileArg;
private static long position;
private static boolean makeGUI = true;
+ private static boolean playing = false;
/**
* Starts the application.
* Starts playback of the current sequence.
*/
public static void play() {
+ playing = true;
sequencer.setTickPosition(position);
sequencer.start();
}
* Pauses playback of the current sequence.
*/
public static void pause() {
+ playing = false;
sequencer.stop();
}
* Resumes playback of the current sequence.
*/
public static void resume() {
+ playing = true;
sequencer.start();
}
* Stops playback of the current sequence.
*/
public static void stop() {
+ playing = false;
sequencer.stop();
sequencer.setTickPosition(position);
}
+ /**
+ * Pauses if playing and resumes if stopped.
+ */
+ public static void resumepause()
+ {
+ if (playing)
+ pause();
+ else
+ resume();
+ }
+
/**
* Rewinds the current sequence the given number of measures.
* @param measures the number of measures to rewind
if (synthesizer.isOpen()) synthesizer.close();
System.exit(0);
}
-}
\ No newline at end of file
+}