]> ruin.nu Git - moosique.git/blobdiff - MooToolbar.java
Fixed some bugs
[moosique.git] / MooToolbar.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));
        }
 
        /**