// Builds GUI, unless n-flag is set.
if (makeGUI) {
- System.out.print("Building GUI...");
+ System.out.print("Building GUI.");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}
*/
public static void resume() {
gui.update(0);
+ try {
+ sequencer.setSequence(seq);
+ } catch (InvalidMidiDataException e) {}
sequencer.start();
// Disables input to volatile components
}
/**
- * Shows the given message in the status bar.
- * @param text the message to show
+ * Returns whether the given track should be drawn
+ * @return true if the given track should be drawn
*/
public static boolean shouldBeDrawn(Track track) {
if (drawEmptyTracks) return true;
/**
- * Shows the given message in the status bar.
- * @param text the message to show
+ * Sets whether empty tracks should be drawn
+ * @param state true if empty tracks should be drawn
*/
public static void setDrawEmptyTracks(boolean state) {
drawEmptyTracks = state;
}
noteOns.trimToSize();
noteOffs.trimToSize();
- boolean isEmpty = (noteOns.size() == 0);
- String text = "Track " + i + " has " + noteOns.size() + "/" + noteOffs.size() + "/" + tracks[i].size();
- if (isEmpty) {
- text += " and will be removed.";
- emptyTracks.add(tracks[i]);
- }
- System.out.println(text);
+ if (noteOns.size() == 0) emptyTracks.add(tracks[i]);
// Sorts the note lists by tick position.
Comparator c = new Comparator() {
Collections.sort(noteOns, c);
Collections.sort(noteOffs, c);
- // For each NoteOn event, finds its NoteOff event and replaces it with a MooNote.
+ // Replaces each NoteOn event it with a MooNote containing a reference to the NoteOff event.
Iterator iOn = noteOns.iterator(), iOff;
MidiEvent on, off = null, nextOff;
ShortMessage onMsg, nextOffMsg;
iOn.remove();
}
}
-
// Sends sequence to GUI and sequencer, then returns
if (gui != null) gui.setSequence(seq);
try {