1 import javax.sound.midi.*;
5 * Functional representation of a MIDI sequence.
7 * @author Andersson, Andreen, Lanneskog, Pehrson
11 public class MooSequence {
13 private ArrayList tracks;
16 * Creates a MooSequence with three tracks.
18 public MooSequence () {
19 tracks = new ArrayList();
24 * Returns a pointer to the specified track.
25 * @param track the number of the track (0-31)
26 * @return the specified track
28 public MooTrack getTrack(int track) {
29 return tracks.get(track);
33 * Returns the number of tracks in the current sequence.
34 * @return the number of the tracks
36 public int getNumberOfTracks() {
41 * Creates a new track after the specified track.
42 * @param track the number of the track (0-31)
44 public void addTrack(int track) {
45 tracks.add(track, new MooTrack());
49 * Deletes the specified track.
50 * @param track the number of the track (0-31)
52 public void deleteTrack(int track) {
57 * Returns the Java Sequence object of the current sequence.
60 public Sequence getSequence() {
65 * Resets the solo and mute settings of all tracks.
67 public void activateTracks() {
68 for (int i = 0; i++; i < tracks.size())
69 tracks[i].setSolo(false);
70 tracks[i].setMute(false);