]> ruin.nu Git - moosique.git/blobdiff - MooTrackView.java
no message
[moosique.git] / MooTrackView.java
index 0c48df37ad736b7ccc2d2dbc6c3c9545c498f7d4..2f96085e25f6a362ea22b4d34e28045ac7177736 100644 (file)
@@ -29,6 +29,7 @@ public class MooTrackView extends JPanel {
        private Rectangle box;
        private int ticksPerSixteenth, popupY = 0;
        private boolean leftMouseButtonPressed = false;
+       private static boolean snapToSixteenths = true;
        protected static int viewLength = 0;
        protected static int extraHeight = 0;
        public static final int NOTE_HEIGHT = 10, NOTE_WIDTH = 40, VIEW_WIDTH = 200;
@@ -79,9 +80,6 @@ public class MooTrackView extends JPanel {
         * Creates note elements for all MooNotes in the track, and places them in the appropriate place.
         */
        public void placeNoteElements() {
-               // Converts the track.
-               Moosique.convertTrack(track);
-
                // Empties the container
                removeAll();
                coords = new ArrayList(track.size() / 2);
@@ -134,9 +132,8 @@ public class MooTrackView extends JPanel {
                x = insets.left;
                y = insets.top + (int)((mn.getTick() * NOTE_HEIGHT) / ticksPerSixteenth);
                height = (mn.getDuration() * NOTE_HEIGHT) / ticksPerSixteenth;
-               System.out.println("y=i(" + insets.top + ")+t(" + mn.getTick() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + y);
-               System.out.println("h=t(" + mn.getDuration() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + height);
                if (height == 0) height = NOTE_HEIGHT;
+               if (snapToSixteenths && height < NOTE_HEIGHT) height = NOTE_HEIGHT;
                r = new Rectangle(x, y, NOTE_WIDTH, height);
 
                // Places the element in the appropriate place.