View Javadoc

1   package com.jamesbryangraves.bob.midi;
2   
3   import java.util.Queue;
4   import java.util.concurrent.LinkedBlockingQueue;
5   
6   import javax.sound.midi.MidiEvent;
7   import javax.sound.midi.Transmitter;
8   
9   public class BobMidiTrack {
10  	
11  	private int channel;
12  	private Transmitter transmitter;
13  	private LinkedBlockingQueue<MidiEvent> midiEvents = new LinkedBlockingQueue<MidiEvent>();
14  	
15  	public int getChannel() {
16  		return channel;
17  	}
18  	public void setChannel(int channel) {
19  		this.channel = channel;
20  	}
21  
22  	public Transmitter getTransmitter() {
23  		return transmitter;
24  	}
25  	
26  	public void setTransmitter(Transmitter transmitter) {
27  		this.transmitter = transmitter;
28  	}
29  	
30  	public boolean add(MidiEvent event) {
31  		return midiEvents.offer(event);
32  	}
33  	
34  	public boolean remove(MidiEvent event) {
35  		return midiEvents.remove(event);
36  	}
37  	
38  	public int size() {
39  		return midiEvents.size();
40  	}
41  	
42  	public Queue<MidiEvent> getMidiEvents() {
43  		return midiEvents;
44  	}
45  	
46  	public void setMidiEvents(LinkedBlockingQueue<MidiEvent> midiEvents) {
47  		this.midiEvents = midiEvents;
48  	}
49  	
50  }