X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooToolbar.java;fp=MooToolbar.java;h=c7aee25aeea2f9c6344dc90365241bdd4905af09;hb=d141cda7d1eafa31fe389bccf7b52f193dfc4aa4;hp=c1244f575e81b717e8db764427727b2d0362fd06;hpb=c83e74facf762222fe4578f175408cc50d360518;p=moosique.git diff --git a/MooToolbar.java b/MooToolbar.java index c1244f5..c7aee25 100644 --- a/MooToolbar.java +++ b/MooToolbar.java @@ -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)); } /**