import javax.sound.midi.*;
import java.io.*;
+// Import external MIDIFileReader and MIDIFileWriter
-/**
- * Moosique - The trackers approach to MIDI
- * ugg
+/*
+ * Moosique - The MIDI Tracker
+ *
* Main class that handles initiation, IO and sound FX.
*
* @author Andersson, Andreen, Lanneskog, Pehrson
public class Moosique {
private static MooGUI gui;
- private static MooSequence seq;
+ private static MooSequence mooSeq;
+ private static Sequence seq;
+ private static Sequencer sequencer = null;
private static String filename;
+ private static int position;
- /**
- * Runs the application.
+ /*
+ * Starts the application.
*/
public static void main (String[] args) {
+ // Creates song and GUI
+ seq = new MooSequence();
+ gui = new MooGUI(mooSeq);
+ // Initializes MIDI sequencer
+ try {
+ sequencer = MidiSystem.getSequencer();
+ sequencer.open();
+ } catch (MidiUnavailableException e) {
+ System.exit(0);
+ }
}
- /**
+ /*
* Returns a pointer to the current sequence.
* @return the current sequence
*/
public static MooSequence getSequence() {
-
+ return mooSeq;
}
- /**
+ /*
* Starts playback of the current sequence.
*/
public static void play() {
-
+ seq = mooSeq.getSequence();
+ sequencer.setSequence(seq);
+ sequencer.start();
}
- /**
+ /*
* Pauses playback of the current sequence.
*/
public static void pause() {
}
- /**
+ /*
* Stops playback of the current sequence.
*/
public static void stop() {
-
+ sequencer.stop();
}
- /**
+ /*
* Rewinds the current sequence the given number of measures.
* @param measures the number of measures to rewind
*/
}
- /**
+ /*
* Fast forwards the current sequence the given number of measures.
* @param measures the number of measures to fast forward
*/
}
- /**
+ /*
* Loads the MooSequence in the given file.
* @param filename the filename to use
*/
}
- /**
+ /*
* Saves the current sequence to the given filename
* @param filename the filename to use
*/
}
- /**
+ /*
* Saves the current sequence to the previously given filename.
*/
public static void save() throws IOException {
}
- /**
+ /*
* Exports the current sequence to a standard MIDI file.
* @param filename the filename to use
*/
public static void exportMIDI(String filename) throws IOException {
}
-}
+}
\ No newline at end of file