private static String filename, fileArg;
private static long position;
- private static boolean makeGUI = true;
+ private static boolean makeGUI = true, isEdited;
/**
* Starts the application.
}
/**
- * Rewinds the current sequence the given number of measures.
- * @param measures the number of measures to rewind
+ * Returns the current tick position of the sequencer.
+ * @return the tick position
*/
public static long getPosition() {
return position;
}
/**
- * Rewinds the current sequence the given number of measures.
- * @param measures the number of measures to rewind
+ * Sets the current tick position of the sequencer.
+ * @param ticks the tick position
*/
public static void setPosition(long ticks) {
position = ticks;
}
+ /**
+ * Returns true if the current sequence has been edited.
+ * @return the tick position
+ */
+ public static boolean isEdited() {
+ return isEdited;
+ }
+
+ /**
+ * Sets the current sequence as edited, which implies prompts when loading a new sequence.
+ */
+ public static void setEdited() {
+ isEdited = true;
+ }
+
/**
* Rewinds the current sequence the given number of measures.
* @param measures the number of measures to rewind
} catch (IOException e) {
return false;
}
-
- // Sends sequence to GUI and sequencer
- if (gui != null) gui.setSequence(seq);
- try {
- sequencer.setSequence(seq);
- } catch (InvalidMidiDataException e) {}
-
+ isEdited = false;
+
// Searches the sequence for NoteOn events
Track[] tracks = seq.getTracks();
MidiEvent noteOn, noteOff = null, nextEvent;
}
}
}
+ // Sends sequence to GUI and sequencer, then returns
+ if (gui != null) gui.setSequence(seq);
+ try {
+ sequencer.setSequence(seq);
+ } catch (InvalidMidiDataException e) {}
return true;
}