X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooGUI.java;h=2ae23a64849221afc93de30cefd997f47f958ef4;hp=3ecb3081ec6f2aeb9e5c99fc943dca2ca42a00cf;hb=HEAD;hpb=1d2d2bfd14ba0addab97692527d4414d3a87e13d diff --git a/MooGUI.java b/MooGUI.java index 3ecb308..2ae23a6 100644 --- a/MooGUI.java +++ b/MooGUI.java @@ -19,6 +19,7 @@ public class MooGUI extends JFrame { private MooView view; private JLabel statusBar; private java.util.Timer timer; + private boolean updateView = false; public static final int statusResetDelay = 3000; public static final Font FONT = new Font("Helvetica", Font.PLAIN, 10); public static final Color bgColor = new Color(192, 224, 255); @@ -119,8 +120,10 @@ public class MooGUI extends JFrame { * Changes the sequence of the GUI. * @param sequence the MIDI sequence to visualize */ - public void setSequence(Sequence sequence) { + public void setSequence(Sequence sequence, File file) { seq = sequence; + if (file != null) setTitle("Moosique - " + file.getName()); + else setTitle("Moosique"); view.setTracks(seq.getTracks(), true); toolbar.resetProgInd(); } @@ -138,11 +141,15 @@ public class MooGUI extends JFrame { * Calls on the main view to update the track views, * and on the toolbar to update the progress indicator. */ - public void update(long tickPosition){ - view.update(tickPosition); + public synchronized void update(long tickPosition){ + if (updateView) view.update(tickPosition); toolbar.updateProgInd(tickPosition); } + public MooView getView() { + return view; + } + /** * Creates an action for a specific octave. * @param increase true for increase, false for decrease @@ -155,6 +162,9 @@ public class MooGUI extends JFrame { return octaveAction; } + /** + * Advances the current progress counter by printing a "." to the System output. + */ private void advanceStatus() { System.out.print("."); }