X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=Moosique.java;h=c51336423b7d8297a27032b0c32d834429b44e13;hp=7eafb6c6ab17fd7852996930e4c4d64aec916819;hb=2236a670e9f9c0a83c97b9cd4ae8ffaa0a051519;hpb=0c367374b55f5692cd8af828c2773c61707d6ac6 diff --git a/Moosique.java b/Moosique.java index 7eafb6c..c513364 100644 --- a/Moosique.java +++ b/Moosique.java @@ -24,7 +24,7 @@ public class Moosique { private static String filename, fileArg; private static long editPosition; - private static boolean makeGUI = true, isEdited; + private static boolean makeGUI = true, isEdited = false, drawEmptyTracks = false; private static Thread player; public static final int DEFAULT_RESOLUTION = 96, DEFAULT_TRACKS = 4; @@ -309,6 +309,24 @@ public class Moosique { editPosition += ticks; } + /** + * Shows the given message in the status bar. + * @param text the message to show + */ + public static boolean shouldBeDrawn(Track track) { + if (drawEmptyTracks) return true; + else return (!emptyTracks.contains(track)); + } + + + /** + * Shows the given message in the status bar. + * @param text the message to show + */ + public static void setDrawEmptyTracks(boolean state) { + drawEmptyTracks = state; + } + /** * Loads the MooSequence in the given file. * @param filename the filename to use @@ -362,9 +380,11 @@ public class Moosique { noteOffs.trimToSize(); boolean isEmpty = (noteOns.size() == 0); String text = "Track " + i + " has " + noteOns.size() + "/" + noteOffs.size() + "/" + tracks[i].size(); - if (isEmpty) text += " and will not be removed."; + if (isEmpty) { + text += " and will be removed."; + emptyTracks.add(tracks[i]); + } System.out.println(text); - emptyTracks.add(tracks[i]); // Sorts the note lists by tick position. Comparator c = new Comparator() {