]> ruin.nu Git - moosique.git/commitdiff
no message
authorEinar Pehrson <einarp@itstud.chalmers.se>
Wed, 21 May 2003 06:25:17 +0000 (06:25 +0000)
committerEinar Pehrson <einarp@itstud.chalmers.se>
Wed, 21 May 2003 06:25:17 +0000 (06:25 +0000)
MooTrackView.java

index 0c48df37ad736b7ccc2d2dbc6c3c9545c498f7d4..96bfd006fc521ff7a5718a7e0bbdb6a8cfe95567 100644 (file)
@@ -28,7 +28,7 @@ public class MooTrackView extends JPanel {
        private Insets insets;
        private Rectangle box;
        private int ticksPerSixteenth, popupY = 0;
        private Insets insets;
        private Rectangle box;
        private int ticksPerSixteenth, popupY = 0;
-       private boolean leftMouseButtonPressed = false;
+       private boolean leftMouseButtonPressed = false, quantizeRecording = false;
        protected static int viewLength = 0;
        protected static int extraHeight = 0;
        public static final int NOTE_HEIGHT = 10, NOTE_WIDTH = 40, VIEW_WIDTH = 200;
        protected static int viewLength = 0;
        protected static int extraHeight = 0;
        public static final int NOTE_HEIGHT = 10, NOTE_WIDTH = 40, VIEW_WIDTH = 200;
@@ -52,7 +52,7 @@ public class MooTrackView extends JPanel {
                setLayout(null);
                setPreferredSize(new Dimension(VIEW_WIDTH, 140 * NOTE_HEIGHT));
 
                setLayout(null);
                setPreferredSize(new Dimension(VIEW_WIDTH, 140 * NOTE_HEIGHT));
 
-               placeNoteElements();
+               placeNoteElements(false);
 
                // Creates panel pop-up menu.
                popup = new JPopupMenu();
 
                // Creates panel pop-up menu.
                popup = new JPopupMenu();
@@ -78,7 +78,7 @@ public class MooTrackView extends JPanel {
        /**
         * Creates note elements for all MooNotes in the track, and places them in the appropriate place.
         */
        /**
         * Creates note elements for all MooNotes in the track, and places them in the appropriate place.
         */
-       public void placeNoteElements() {
+       public void placeNoteElements(boolean quantize) {
                // Converts the track.
                Moosique.convertTrack(track);
 
                // Converts the track.
                Moosique.convertTrack(track);
 
@@ -132,10 +132,12 @@ public class MooTrackView extends JPanel {
 
                // Calculates coordinates.
                x = insets.left;
 
                // Calculates coordinates.
                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 (quantizeRecording) {
+               
+               } else {
+                       y = insets.top + (int)((mn.getTick() * NOTE_HEIGHT) / ticksPerSixteenth);
+                       height = (mn.getDuration() * NOTE_HEIGHT) / ticksPerSixteenth;
+               }
                if (height == 0) height = NOTE_HEIGHT;
                r = new Rectangle(x, y, NOTE_WIDTH, height);
 
                if (height == 0) height = NOTE_HEIGHT;
                r = new Rectangle(x, y, NOTE_WIDTH, height);