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