* 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));
}
/**
* 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();
}