]> ruin.nu Git - moosique.git/blob - MooSequence.java
Implemented some obvious methods.
[moosique.git] / MooSequence.java
1 import javax.sound.midi.*;
2 import java.util.*;
3
4 /*
5  * Functional representation of a MIDI sequence.
6  *
7  * @author  Andersson, Andreen, Lanneskog, Pehrson
8  * @version 1
9  */
10  
11 public class MooSequence {
12
13         private ArrayList tracks;
14
15         /* 
16          * Creates a MooSequence with three tracks.
17          */
18         public MooSequence () {
19                 tracks = new ArrayList();
20                 addTrack(0);
21         }
22
23         /* 
24          * Returns a pointer to the specified track.
25          * @param track         the number of the track (0-31)
26          * @return the specified track
27          */
28         public MooTrack getTrack(int track) {
29                 return tracks.get(track);
30         }
31
32         /* 
33          * Returns the number of tracks in the current sequence.
34          * @return the number of the tracks
35          */
36         public int getNumberOfTracks() {
37                 return tracks.size();
38         }
39
40         /* 
41          * Creates a new track after the specified track.
42          * @param track         the number of the track (0-31)
43          */
44         public void addTrack(int track) {
45                 tracks.add(track, new MooTrack());
46         }
47
48         /* 
49          * Deletes the specified track.
50          * @param track         the number of the track (0-31)
51          */
52         public void deleteTrack(int track) {
53                 tracks.remove(track);
54         }
55
56         /* 
57          * Returns the Java Sequence object of the current sequence.
58          * @return a Sequence
59          */
60         public Sequence getSequence() {
61         
62         }
63
64         /* 
65          * Resets the solo and mute settings of all tracks.
66          */
67         public void activateTracks() {
68                 for (int i = 0; i++; i < tracks.size())
69                         tracks[i].setSolo(false);
70                         tracks[i].setMute(false);
71                 }
72         }
73 }