X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Moosique.java;h=5d6ed9716b569d472141910edfb0e41358c21d74;hb=c83e74facf762222fe4578f175408cc50d360518;hp=b7c92c30f9af86ad1c7efeadbe8a390853ec7b72;hpb=97d462f234af2325fb0707b8bd35cec1ee429dd5;p=moosique.git diff --git a/Moosique.java b/Moosique.java index b7c92c3..5d6ed97 100644 --- a/Moosique.java +++ b/Moosique.java @@ -1,6 +1,6 @@ import javax.sound.midi.*; -import javax.swing.*; import java.io.*; +import javax.swing.*; /** * Moosique - The MIDI Tracker @@ -56,16 +56,23 @@ public class Moosique { //If a filename is given as the command-line argument, attempts to load a sequence from the file. if (fileArg != null) { System.out.print("Loading MIDI sequence from " + fileArg + "..."); - if (!load(fileArg)) clearSequence(); - System.out.println("Done"); + if (!load(fileArg)) { + System.out.println("Failed"); + clearSequence(); + } else { + System.out.println("Done"); + } } else { // Otherwise creates a new empty one. clearSequence(); } - // If n-flag is set, plays song and then exits. Otherwise builds GUI. + // Builds GUI, unless n-flag is set. if (makeGUI) { System.out.print("Building GUI..."); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) {} gui = new MooGUI(seq); System.out.println("Done"); } else { @@ -77,6 +84,14 @@ public class Moosique { } } + /** + * Returns the GUI. + * @return the GUI + */ + public static MooGUI getGUI() { + return gui; + } + /** * Returns the current sequence. * @return the current sequence @@ -204,7 +219,6 @@ public class Moosique { } catch (InvalidMidiDataException e) { return false; } catch (IOException e) { - JOptionPane.showMessageDialog(null, "Error 404", "File Not Found", JOptionPane.ERROR_MESSAGE); return false; }