From d141cda7d1eafa31fe389bccf7b52f193dfc4aa4 Mon Sep 17 00:00:00 2001 From: Einar Pehrson Date: Sun, 11 May 2003 23:50:47 +0000 Subject: [PATCH] Fixed some bugs --- MooToolbar.java | 13 ++++++++----- MooTrackView.java | 8 ++++++++ MooView.java | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) 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)); } /** diff --git a/MooTrackView.java b/MooTrackView.java index 4e4f002..fafab99 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -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 { diff --git a/MooView.java b/MooView.java index 76391f9..5f8c15e 100644 --- a/MooView.java +++ b/MooView.java @@ -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(); } -- 2.39.2