org.tritonus.midi.device.java
Class JavaSequencer

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

public class JavaSequencer
extends TSequencer
implements java.lang.Runnable

Sequencer implementation in pure Java.


Nested Class Summary
static interface JavaSequencer.Clock
          Interface for sequencer clocks.
 
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
JavaSequencer(MidiDevice.Info info)
           
 
Method Summary
 JavaSequencer.Clock getClock()
          Obtain the clock used by this sequencer.
 long getTickPosition()
           
 boolean isRecording()
           
 void recordDisable(Track track)
           
 void recordEnable(Track track)
           
 void recordEnable(Track track, int nChannel)
           
 void run()
           
 void setClock(JavaSequencer.Clock clock)
          Set the clock this sequencer should use.
 void setMicrosecondPosition(long lPosition)
           
 void setSequence(Sequence sequence)
           
 void setTickPosition(long lPosition)
           
 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, isRunning, removeControllerEventListener, removeMetaEventListener, setLatency, setLoopCount, setLoopEndPoint, setLoopStartPoint, setMasterSyncMode, setSequence, setSlaveSyncMode, setTempoFactor, setTempoInBPM, setTempoInMPQ, setTrackMute, setTrackSolo, start, stop
 
Methods inherited from class org.tritonus.share.midi.TMidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getMicrosecondPosition, getReceiver, getReceivers, getTransmitter, 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.Sequencer
getMicrosecondPosition
 
Methods inherited from interface javax.sound.midi.MidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceiver, getReceivers, getTransmitter, getTransmitters, isOpen, open
 

Constructor Detail

JavaSequencer

public JavaSequencer(MidiDevice.Info info)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

setSequence

public void setSequence(Sequence sequence)
                 throws InvalidMidiDataException
Specified by:
setSequence in interface Sequencer
Overrides:
setSequence in class TSequencer
Throws:
InvalidMidiDataException

setMicrosecondPosition

public void setMicrosecondPosition(long lPosition)
Specified by:
setMicrosecondPosition in interface Sequencer

setTickPosition

public void setTickPosition(long lPosition)
Specified by:
setTickPosition in interface Sequencer

getTickPosition

public long getTickPosition()
Specified by:
getTickPosition in interface Sequencer

recordDisable

public void recordDisable(Track track)
Specified by:
recordDisable in interface Sequencer

recordEnable

public void recordEnable(Track track)

recordEnable

public void recordEnable(Track track,
                         int nChannel)
Specified by:
recordEnable in interface Sequencer

isRecording

public boolean isRecording()
Specified by:
isRecording in interface Sequencer

stopRecording

public void stopRecording()
Specified by:
stopRecording in interface Sequencer

startRecording

public void startRecording()
Specified by:
startRecording in interface Sequencer

setClock

public void setClock(JavaSequencer.Clock clock)
Set the clock this sequencer should use.

Parameters:
clock - the Clock to be used
Throws:
java.lang.IllegalStateException - if the sequencer is not closed

getClock

public JavaSequencer.Clock getClock()
Obtain the clock used by this sequencer.

Returns:
the clock currently set for this sequencer