import javax.sound.midi.*;
+import java.util.*;
/*
* Functional representation of a MIDI sequence.
public class MooSequence {
- private Collection tracks;
+ private ArrayList tracks;
/*
* Creates a MooSequence with three tracks.
*/
public MooSequence () {
-
+ tracks = new ArrayList();
+ addTrack(0);
}
/*
* @return the specified track
*/
public MooTrack getTrack(int track) {
-
+ return tracks.get(track);
}
/*
* @return the number of the tracks
*/
public int getNumberOfTracks() {
-
+ return tracks.size();
}
/*
* @param track the number of the track (0-31)
*/
public void addTrack(int track) {
-
+ tracks.add(track, new MooTrack());
}
/*
* @param track the number of the track (0-31)
*/
public void deleteTrack(int track) {
-
+ tracks.remove(track);
}
/*
* Resets the solo and mute settings of all tracks.
*/
public void activateTracks() {
-
+ for (int i = 0; i++; i < tracks.size())
+ tracks[i].setSolo(false);
+ tracks[i].setMute(false);
+ }
}
}
\ No newline at end of file