1 import javax.sound.midi.*;
4 * Functional representation of a MIDI track.
6 * @author Andersson, Andreen, Lanneskog, Pehrson
10 public class MooTrack {
12 private Collection notes;
14 private int instrument;
15 private boolean solo = false;
16 private boolean mute = false;
19 * Creates an empty MooTrack.
26 * Sets the MIDI instrument of the current track.
27 * @param instr the number of the MIDI instrument (0-127)
29 public void setInstrument(int instr) {
34 * Sets the MIDI channel of the current track.
35 * @param chan the number of the MIDI channel (1-16)
37 public void setChannel(int chan) {
42 * Returns the MIDI channel of the current track.
43 * @return the number of the channel
45 public int getChannel() {
50 * Returns the number of notes in the current track.
51 * @return the number of notes
53 public int getNumberOfNotes() {
58 * Adds the given note to the current track.
59 * @param note the MooNote to add
61 public void addNote(MooNote note) {
66 * Deletes the given note to the current track.
67 * @param note the MooNote to delete
69 public void deleteNote(MooNote note) {
74 * Returns the note of the given index.
75 * @param note the index of the note
77 public MooNote getNote(int note) {
82 * Makes the current track solo.
83 * @param set if the track should be solo
85 public void solo(boolean set) {
90 * Mutes the current track.
91 * @param set if the track should be muted
93 public void mute(boolean set) {
98 * Checks if the current track is solo.
99 * @return if the track is solo
102 public boolean isSolo() {
107 * Checks if the current track is muted.
108 * @return if the track is muted
110 public boolean isMute() {