]> ruin.nu Git - moosique.git/blob - Moosique.java
Implemented some obvious methods.
[moosique.git] / Moosique.java
1 import javax.sound.midi.*;
2 import java.io.*;
3 // Import external MIDIFileReader and MIDIFileWriter
4
5 /*
6  * Moosique - The MIDI Tracker
7  * 
8  * Main class that handles initiation, IO and sound FX.
9  * 
10  * @author  Andersson, Andreen, Lanneskog, Pehrson
11  * @version 1
12  */
13  
14 public class Moosique {
15
16         private static MooGUI gui;
17         private static MooSequence mooSeq;
18         private static Sequence seq;
19         private static Sequencer sequencer = null;
20         private static String filename;
21         private static int position;
22
23         /* 
24          * Starts the application.
25          */
26         public static void main (String[] args) {
27                 // Creates song and GUI
28                 seq = new MooSequence();
29                 gui = new MooGUI(mooSeq);
30
31                 // Initializes MIDI sequencer
32                 try {
33                         sequencer = MidiSystem.getSequencer();
34                         sequencer.open();
35                 } catch (MidiUnavailableException e) {
36                         System.exit(0);
37                 }
38         }
39
40         /* 
41          * Returns a pointer to the current sequence.
42          * @return the current sequence
43          */
44         public static MooSequence getSequence() {
45                 return mooSeq;
46         }
47
48         /* 
49          * Starts playback of the current sequence.
50          */
51         public static void play() {
52                 seq = mooSeq.getSequence();
53                 sequencer.setSequence(seq);
54                 sequencer.start();
55         }
56
57         /* 
58          * Pauses playback of the current sequence.
59          */
60         public static void pause() {
61         
62         }
63
64         /* 
65          * Stops playback of the current sequence.
66          */
67         public static void stop() {
68                 sequencer.stop();
69         }
70
71         /* 
72          * Rewinds the current sequence the given number of measures.
73          * @param measures      the number of measures to rewind
74          */
75         public static void rewind(int measures) {
76         
77         }
78
79         /* 
80          * Fast forwards the current sequence the given number of measures.
81          * @param measures      the number of measures to fast forward
82          */
83         public static void forward(int measures) {
84         
85         }
86
87         /* 
88          * Loads the MooSequence in the given file.
89          * @param filename      the filename to use
90          */
91         public static void load(String filename) throws IOException {
92         
93         }
94
95         /* 
96          * Saves the current sequence to the given filename
97          * @param filename      the filename to use
98          */
99         public static void saveAs(String filename) throws IOException {
100                 
101         }
102
103         /* 
104          * Saves the current sequence to the previously given filename.
105          */
106         public static void save() throws IOException {
107         
108         }
109
110         /* 
111          * Exports the current sequence to a standard MIDI file.
112          * @param filename      the filename to use
113          */
114         public static void exportMIDI(String filename) throws IOException {
115         
116         }
117 }