]> ruin.nu Git - moosique.git/blobdiff - Moosique.java
Changed window size and TrackView generation. Updated Toolbar listeners, and cleaned...
[moosique.git] / Moosique.java
index c2006faff375c1c093596acc32fe5c2e5f988e2e..b7c92c30f9af86ad1c7efeadbe8a390853ec7b72 100644 (file)
@@ -78,7 +78,7 @@ public class Moosique {
        }
 
        /** 
-        * Returns a pointer to the current sequence.
+        * Returns the current sequence.
         * @return the current sequence
         */
        public static Sequence getSequence() {
@@ -86,7 +86,15 @@ public class Moosique {
        }
 
        /** 
-        * Returns a pointer to the MidiChannels of the selected synthesizer.
+        * Returns the current sequencer.
+        * @return the current sequencer
+        */
+       public static Sequencer getSequencer() {
+               return sequencer;
+       }
+
+       /** 
+        * Returns the MidiChannels of the selected synthesizer.
         * @return the available MidiChannels
         */
        public static MidiChannel[] getChannels() {
@@ -94,7 +102,7 @@ public class Moosique {
        }
 
        /** 
-        * Returns a pointer to the currently active MidiChannel.
+        * Returns the currently active MidiChannel.
         * @return the active MidiChannel
         */
        public static MidiChannel getActiveChannel() {
@@ -173,7 +181,7 @@ public class Moosique {
         * @param measures      the number of measures to rewind
         */
        public static void rewind(long ticks) {
-               position -= ticks;
+               setPosition(position - ticks);
        }
 
        /** 
@@ -181,7 +189,7 @@ public class Moosique {
         * @param measures      the number of measures to fast forward
         */
        public static void forward(long ticks) {
-               position += ticks;
+               setPosition(position + ticks);
        }
 
        /** 
@@ -244,16 +252,19 @@ public class Moosique {
 
        /** 
         * Saves the current sequence to the given filename
-        * @param filename      the filename to use
+        * @param file  the filename to use
         */
-       public static void saveAs(String filename) throws IOException {
-               MidiSystem.write(seq, 1, new File(filename));
+       public static void saveAs(String file) {
+               try {
+                       MidiSystem.write(seq, 1, new File(filename));
+               } catch (IOException e) {}
+               filename = file;
        }
 
        /** 
         * Saves the current sequence to the previously given filename.
         */
-       public static void save() throws IOException {
+       public static void save() {
                saveAs(filename);
        }