X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooSequence.java;h=2390c4a01da6d8d28f6b7c0084a678fa64f4b3fc;hb=ade446bcfe30be5e4a058926387763f72fc3d4a7;hp=b37424e244022317a2e8a16b166f3bce256e3ac1;hpb=4e7d6f8b7dd7fbcef2282674b5442d78cf220489;p=moosique.git diff --git a/MooSequence.java b/MooSequence.java index b37424e..2390c4a 100644 --- a/MooSequence.java +++ b/MooSequence.java @@ -1,4 +1,5 @@ import javax.sound.midi.*; +import java.util.*; /* * Functional representation of a MIDI sequence. @@ -9,13 +10,14 @@ import javax.sound.midi.*; public class MooSequence { - private Collection tracks; + private ArrayList tracks; /* * Creates a MooSequence with three tracks. */ public MooSequence () { - + tracks = new ArrayList(); + addTrack(0); } /* @@ -24,7 +26,7 @@ public class MooSequence { * @return the specified track */ public MooTrack getTrack(int track) { - + return tracks.get(track); } /* @@ -32,7 +34,7 @@ public class MooSequence { * @return the number of the tracks */ public int getNumberOfTracks() { - + return tracks.size(); } /* @@ -40,7 +42,7 @@ public class MooSequence { * @param track the number of the track (0-31) */ public void addTrack(int track) { - + tracks.add(track, new MooTrack()); } /* @@ -48,7 +50,7 @@ public class MooSequence { * @param track the number of the track (0-31) */ public void deleteTrack(int track) { - + tracks.remove(track); } /* @@ -63,6 +65,9 @@ public class MooSequence { * 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