]> ruin.nu Git - moosique.git/commitdiff
Fixed some bugs
authorEinar Pehrson <einarp@itstud.chalmers.se>
Sun, 11 May 2003 23:50:47 +0000 (23:50 +0000)
committerEinar Pehrson <einarp@itstud.chalmers.se>
Sun, 11 May 2003 23:50:47 +0000 (23:50 +0000)
MooToolbar.java
MooTrackView.java
MooView.java

index c1244f575e81b717e8db764427727b2d0362fd06..c7aee25aeea2f9c6344dc90365241bdd4905af09 100644 (file)
@@ -71,12 +71,15 @@ public class MooToolbar extends JToolBar {
         * Updates the progress indicator.
         */
        public void updateProgInd() {
-               int pos = Moosique.getSequencer().getTickPosition();
-               int ticksPerBeat = Moosique.getSequencer().getResolution();
+               long pos = Moosique.getSequencer().getTickPosition();
+               int ticksPerBeat = Moosique.getSequence().getResolution();
                int beatsPerMeasure = 4;
-               measureValue.setText(pos / (beatsPerMeasure * ticksPerBeat));
-               beatsValue.setText((pos - measures * beatsPerMeasure * ticksPerBeat) / ticksPerBeat);
-               ticksValue.setText(pos - measures * beatsPerMeasure * ticksPerBeat - beats * ticksPerBeat);
+               long measures = pos / (beatsPerMeasure * ticksPerBeat);
+               long beats = (pos - measures * beatsPerMeasure * ticksPerBeat) / ticksPerBeat;
+               long ticks = pos - measures * beatsPerMeasure * ticksPerBeat - beats * ticksPerBeat;
+               measureValue.setText(Long.toString(measures));
+               beatsValue.setText(Long.toString(beats));
+               ticksValue.setText(Long.toString(ticks));
        }
 
        /**
index 4e4f0027161da12374c71d308f5124438d1bcd3b..fafab990ba77b4fc47f260e40e929f1ee7e06610 100644 (file)
@@ -50,6 +50,14 @@ public class MooTrackView extends JPanel implements ActionListener {
        public Track getTrack() {
                return track;
        }
+       
+
+       /** 
+        * Updates the track view.
+        */
+       public void update() {
+       
+       }
 
        class NoteArea extends JPanel {
 
index 76391f9d20caf3d170c3a90fc29509e7eca5ee92..5f8c15ea598acc356224cbd0b61897f1a197b6c1 100644 (file)
@@ -41,7 +41,7 @@ public class MooView extends JScrollPane {
         * Calls on each track view to update itself.
         */
        public void update() {
-               Component[] comps = c.getComponents();
+               Component[] comps = getComponents();
                for (int i = 0; i < comps.length; i++) {
                        ((MooTrackView)comps[i]).update();
                }