]> ruin.nu Git - moosique.git/blobdiff - Moosique.java
Fixed the scroll mode. Major performance issue.
[moosique.git] / Moosique.java
index 7eafb6c6ab17fd7852996930e4c4d64aec916819..c51336423b7d8297a27032b0c32d834429b44e13 100644 (file)
@@ -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() {