X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooGUI.java;h=57759c9961699ba3d118e211a213ad0a9627854c;hp=3ecb3081ec6f2aeb9e5c99fc943dca2ca42a00cf;hb=d1996d82793d7049115f5280ba8651b818e52e3c;hpb=1d2d2bfd14ba0addab97692527d4414d3a87e13d diff --git a/MooGUI.java b/MooGUI.java index 3ecb308..57759c9 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 = true; 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,8 +141,8 @@ 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); } @@ -155,6 +158,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("."); }