+++ /dev/null
-import javax.sound.midi.*;
-import java.util.*;
-
-/* UPDATES
- Added MooSequence(Sequence seq) constructor.
-*/
-
-/*
- * Functional representation of a MIDI sequence.
- *
- * @author Andersson, Andreen, Lanneskog, Pehrson
- * @version 1
- */
-
-public class MooSequence {
-
- private ArrayList tracks;
-
- /*
- * Creates a MooSequence from the given Sequence.
- */
- public MooSequence(Sequence seq) {
-
- }
-
- /*
- * 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
- */
- public Sequence getSequence() {
- Sequence seq = new Sequence(Sequencer.PPQ, 96, tracks.size());
- Track t;
- for (int i = 0; i < tracks.size(); i++) {
- t = tracks.get(i);
- for (int j = 0; j < t.notes.size(); j++) {
- t.add(t.notes.get(j).getNoteOnEvent());
- t.add(t.notes.get(j).getNoteOffEvent()); }
- }
- }
- }
-
- /*
- * 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
+++ /dev/null
-import javax.sound.midi.*;
-
-/*
- * Functional representation of a MIDI track.
- *
- * @author Andersson, Andreen, Lanneskog, Pehrson
- * @version 1
- */
-
-public class MooTrack {
-
- private Collection notes;
- private int channel;
- private int instrument;
- private boolean solo = false;
- private boolean mute = false;
-
- /*
- * Creates an empty MooTrack.
- */
- public MooTrack () {
- notes = new Collection();
- setInstrument(0);
- // Find the first available channel
- }
-
- /*
- * Sets the MIDI instrument of the current track.
- * @param instr the number of the MIDI instrument (0-127)
- */
- public void setInstrument(int instr) {
- instrument = instr;
- }
-
- /*
- * Sets the MIDI channel of the current track.
- * @param chan the number of the MIDI channel (1-16)
- */
- public void setChannel(int chan) {
- channel = chan;
- }
-
- /*
- * Returns the MIDI channel of the current track.
- * @return the number of the channel
- */
- public int getChannel() {
- return channel;
- }
-
- /*
- * Returns the number of notes in the current track.
- * @return the number of notes
- */
- public int getNumberOfNotes() {
- return notes.size();
- }
-
- /*
- * Adds the given note to the current track.
- * @param note the MooNote to add
- */
- public void addNote(MooNote note) {
- notes.add(note);
- }
-
- /*
- * Deletes the given note from the current track.
- * @param note the MooNote to delete
- */
- public void deleteNote(MooNote note) {
- notes.remove(note);
- }
-
- /*
- * Returns the note of the given index.
- * @param note the index of the note
- */
- public MooNote getNote(int note) {
- return notes.get(note);
- }
-
- /*
- * Makes the current track solo.
- * @param set if the track should be solo
- */
- public void setSolo(boolean set) {
- solo = set;
- }
-
- /*
- * Mutes the current track.
- * @param set if the track should be muted
- */
- public void setMute(boolean set) {
- mute = set;
- }
-
- /*
- * Checks if the current track is solo.
- * @return if the track is solo
- */
-
- public boolean isSolo() {
- return solo;
- }
-
- /*
- * Checks if the current track is muted.
- * @return if the track is muted
- */
- public boolean isMute() {
- return mute;
- }
-}
\ No newline at end of file