import javax.sound.midi.*;
+import java.util.*;
-/**
+/*
* Functional representation of a MIDI sequence.
+ *
* @author Andersson, Andreen, Lanneskog, Pehrson
- * @version 1.1
+ * @version 1
*/
public class MooSequence {
- private Collection tracks;
+ private ArrayList tracks;
- /**
+ /*
* Creates a MooSequence with three tracks.
*/
public MooSequence () {
-
+ tracks = new ArrayList();
+ addTrack(0);
}
- /**
+ /*
* Returns a pointer to the specified track.
* @param track the number of the track (0-31)
* @return the specified track
*/
public MooTrack getTrack(int track) {
-
+ return tracks.get(track);
}
- /**
+ /*
* Returns the number of tracks in the current sequence.
* @return the number of the tracks
*/
public int getNumberOfTracks() {
-
+ return tracks.size();
}
- /**
+ /*
* Creates a new track after the specified track.
* @param track the number of the track (0-31)
*/
public void addTrack(int track) {
-
+ tracks.add(track, new MooTrack());
}
- /**
+ /*
* Deletes the specified track.
* @param track the number of the track (0-31)
*/
public void deleteTrack(int track) {
-
+ tracks.remove(track);
}
- /**
+ /*
* Returns the Java Sequence object of the current sequence.
* @return a Sequence
*/
}
- /**
+ /*
* 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