]> ruin.nu Git - moosique.git/blobdiff - MooSequence.java
Implemented some obvious methods.
[moosique.git] / MooSequence.java
index 8b4c4e797a0cbb42c41dcf520f9d1b685048aee1..2390c4a01da6d8d28f6b7c0084a678fa64f4b3fc 100644 (file)
@@ -1,56 +1,59 @@
 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
         */
@@ -58,10 +61,13 @@ 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