org.tritonus.midi.device.alsa
Class AlsaSequencer

java.lang.Object
  extended by org.tritonus.share.midi.TMidiDevice
      extended by org.tritonus.share.midi.TSequencer
          extended by org.tritonus.midi.device.alsa.AlsaSequencer
All Implemented Interfaces:
MidiDevice, Sequencer

public class AlsaSequencer
extends TSequencer


Nested Class Summary
 class AlsaSequencer.AlsaSequencerReceiver
           
 class AlsaSequencer.AlsaSequencerTransmitter
           
 class AlsaSequencer.LoaderThread
          Pre-loading events to the sequencer queue.
 class AlsaSequencer.MasterSynchronizer
           
 class AlsaSequencer.PlaybackAlsaMidiInListener
           
 class AlsaSequencer.RecordingAlsaMidiInListener
           
 
Nested classes/interfaces inherited from class org.tritonus.share.midi.TMidiDevice
TMidiDevice.Info, TMidiDevice.TReceiver, TMidiDevice.TTransmitter
 
Nested classes/interfaces inherited from interface javax.sound.midi.Sequencer
Sequencer.SyncMode
 
Nested classes/interfaces inherited from interface javax.sound.midi.MidiDevice
MidiDevice.Info
 
Field Summary
 
Fields inherited from interface javax.sound.midi.Sequencer
LOOP_CONTINUOUSLY
 
Constructor Summary
AlsaSequencer(MidiDevice.Info info)
           
 
Method Summary
 long getMicrosecondPosition()
          Returns the device time in microseconds.
 Receiver getReceiver()
          Creates a new Receiver object associated with this instance.
 long getTickPosition()
           
 Transmitter getTransmitter()
          Creates a new Transmitter object associated with this instance.
 boolean isRecording()
           
 boolean isRunning()
           
 void recordDisable(Track track)
           
 void recordEnable(Track track, int nChannel)
           
 void sendMessageTick(MidiMessage message, long lTick)
          Put a message into the queue.
 void setMicrosecondPosition(long lMicroseconds)
           
 void setTickPosition(long lTick)
           
 void startRecording()
           
 void stopRecording()
           
 
Methods inherited from class org.tritonus.share.midi.TSequencer
addControllerEventListener, addMetaEventListener, getLatency, getLoopCount, getLoopEndPoint, getLoopStartPoint, getMasterSyncMode, getMasterSyncModes, getMicrosecondLength, getSequence, getSlaveSyncMode, getSlaveSyncModes, getTempoFactor, getTempoInBPM, getTempoInMPQ, getTickLength, getTrackMute, getTrackSolo, removeControllerEventListener, removeMetaEventListener, setLatency, setLoopCount, setLoopEndPoint, setLoopStartPoint, setMasterSyncMode, setSequence, setSequence, setSlaveSyncMode, setTempoFactor, setTempoInBPM, setTempoInMPQ, setTrackMute, setTrackSolo, start, stop
 
Methods inherited from class org.tritonus.share.midi.TMidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceivers, getTransmitters, isOpen, open
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sound.midi.MidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceivers, getTransmitters, isOpen, open
 

Constructor Detail

AlsaSequencer

public AlsaSequencer(MidiDevice.Info info)
Method Detail

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Sequencer
Overrides:
isRunning in class TSequencer

startRecording

public void startRecording()

stopRecording

public void stopRecording()

isRecording

public boolean isRecording()

recordEnable

public void recordEnable(Track track,
                         int nChannel)

recordDisable

public void recordDisable(Track track)

getTickPosition

public long getTickPosition()

setTickPosition

public void setTickPosition(long lTick)

getMicrosecondPosition

public long getMicrosecondPosition()
Description copied from class: TMidiDevice
Returns the device time in microseconds. This is a default implementation, telling the application program that the device doesn't track time. If a device wants to give timing information, it has to override this method.

Specified by:
getMicrosecondPosition in interface MidiDevice
Specified by:
getMicrosecondPosition in interface Sequencer
Overrides:
getMicrosecondPosition in class TMidiDevice

setMicrosecondPosition

public void setMicrosecondPosition(long lMicroseconds)

sendMessageTick

public void sendMessageTick(MidiMessage message,
                            long lTick)
Put a message into the queue. This is Claus-Dieter's special method: it puts the message to the ALSA queue for delivery at the specified time. The time has to be given in ticks according to the resolution of the currently active Sequence. For this method to work, the Sequencer has to be started. The message is delivered the same way as messages from a Sequence, i.e. to all registered Transmitters. If the current queue position (as returned by getTickPosition()) is already behind the desired schedule time, the message is ignored.

Parameters:
message - the MidiMessage to put into the queue.
lTick - the desired schedule time in ticks.

getReceiver

public Receiver getReceiver()
                     throws MidiUnavailableException
Description copied from class: TMidiDevice
Creates a new Receiver object associated with this instance. In this implementation, an unlimited number of Receivers per MidiDevice can be created.

Specified by:
getReceiver in interface MidiDevice
Overrides:
getReceiver in class TMidiDevice
Throws:
MidiUnavailableException

getTransmitter

public Transmitter getTransmitter()
                           throws MidiUnavailableException
Description copied from class: TMidiDevice
Creates a new Transmitter object associated with this instance. In this implementation, an unlimited number of Transmitters per MidiDevice can be created.

Specified by:
getTransmitter in interface MidiDevice
Overrides:
getTransmitter in class TMidiDevice
Throws:
MidiUnavailableException