X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooView.java;h=4f36de3ce0a5d06e20b894cdfbac6d6035579a4f;hb=f97b2830039d5217536a815e08b987c783501975;hp=620478ca09b8857983b2cba25d4618e1612b21c1;hpb=0f75f154c6485f6428617af221a282ba03ee20ae;p=moosique.git diff --git a/MooView.java b/MooView.java index 620478c..4f36de3 100644 --- a/MooView.java +++ b/MooView.java @@ -18,10 +18,10 @@ public class MooView extends JScrollPane { /** * Creates the main view */ - public MooView(Track[] tracks) { + public MooView(Sequence seq) { super(VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED); + tracks = seq.getTracks(); - this.tracks = tracks; trackPanel = new JPanel(new GridLayout(1,3), true); createTrackViews(); @@ -42,11 +42,17 @@ public class MooView extends JScrollPane { trackPanel.validate(); } - public void update(Track[] tracks) { - this.tracks = tracks; + public void setSequence(Sequence seq) { + tracks = seq.getTracks(); createTrackViews(); } + public void update() { + // Calls on each track view to update itself. + for (int i = 0; i < trackViews.length; i++) { + //trackViews[i].update(); + } + } /** * Creates a view for the given track and adds it to the main view. * @param track the track for which to add a view @@ -62,4 +68,4 @@ public class MooView extends JScrollPane { public void removeTrackView(Track track) { } -} \ No newline at end of file +}