org.tritonus.share.midi
Class TSequencer

java.lang.Object
  extended by org.tritonus.share.midi.TMidiDevice
      extended by org.tritonus.share.midi.TSequencer
All Implemented Interfaces:
MidiDevice, Sequencer
Direct Known Subclasses:
AlsaSequencer, JavaSequencer, TPreloadingSequencer

public abstract class TSequencer
extends TMidiDevice
implements Sequencer


Nested Class Summary
 
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
 
Method Summary
 int[] addControllerEventListener(ControllerEventListener listener, int[] anControllers)
           
 boolean addMetaEventListener(MetaEventListener listener)
           
 int getLatency()
          Get the preloading intervall.
 int getLoopCount()
           
 long getLoopEndPoint()
           
 long getLoopStartPoint()
           
 Sequencer.SyncMode getMasterSyncMode()
           
 Sequencer.SyncMode[] getMasterSyncModes()
           
 long getMicrosecondLength()
           
 Sequence getSequence()
           
 Sequencer.SyncMode getSlaveSyncMode()
           
 Sequencer.SyncMode[] getSlaveSyncModes()
           
 float getTempoFactor()
           
 float getTempoInBPM()
           
 float getTempoInMPQ()
           
 long getTickLength()
           
 boolean getTrackMute(int nTrack)
           
 boolean getTrackSolo(int nTrack)
           
 boolean isRunning()
           
 int[] removeControllerEventListener(ControllerEventListener listener, int[] anControllers)
           
 void removeMetaEventListener(MetaEventListener listener)
           
 void setLatency(int nMilliseconds)
          Sets the preloading intervall.
 void setLoopCount(int nLoopCount)
           
 void setLoopEndPoint(long lTick)
           
 void setLoopStartPoint(long lTick)
           
 void setMasterSyncMode(Sequencer.SyncMode syncMode)
           
 void setSequence(java.io.InputStream inputStream)
           
 void setSequence(Sequence sequence)
           
 void setSlaveSyncMode(Sequencer.SyncMode syncMode)
           
 void setTempoFactor(float fFactor)
           
 void setTempoInBPM(float fBPM)
           
 void setTempoInMPQ(float fMPQ)
          Sets the tempo.
 void setTrackMute(int nTrack, boolean bMute)
           
 void setTrackSolo(int nTrack, boolean bSolo)
           
 void start()
           
 void 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, getTickPosition, isRecording, recordDisable, recordEnable, setMicrosecondPosition, setTickPosition, startRecording, stopRecording
 
Methods inherited from interface javax.sound.midi.MidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceiver, getReceivers, getTransmitter, getTransmitters, isOpen, open
 

Method Detail

setSequence

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

setSequence

public void setSequence(java.io.InputStream inputStream)
                 throws InvalidMidiDataException,
                        java.io.IOException
Specified by:
setSequence in interface Sequencer
Throws:
InvalidMidiDataException
java.io.IOException

getSequence

public Sequence getSequence()
Specified by:
getSequence in interface Sequencer

setLoopStartPoint

public void setLoopStartPoint(long lTick)
Specified by:
setLoopStartPoint in interface Sequencer

getLoopStartPoint

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

setLoopEndPoint

public void setLoopEndPoint(long lTick)
Specified by:
setLoopEndPoint in interface Sequencer

getLoopEndPoint

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

setLoopCount

public void setLoopCount(int nLoopCount)
Specified by:
setLoopCount in interface Sequencer

getLoopCount

public int getLoopCount()
Specified by:
getLoopCount in interface Sequencer

start

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

stop

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

isRunning

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

getTempoInBPM

public float getTempoInBPM()
Specified by:
getTempoInBPM in interface Sequencer

setTempoInBPM

public void setTempoInBPM(float fBPM)
Specified by:
setTempoInBPM in interface Sequencer

getTempoInMPQ

public float getTempoInMPQ()
Specified by:
getTempoInMPQ in interface Sequencer

setTempoInMPQ

public void setTempoInMPQ(float fMPQ)
Sets the tempo. Implementation classes are required to call this method for changing the tempo in reaction to a tempo change event.

Specified by:
setTempoInMPQ in interface Sequencer

setTempoFactor

public void setTempoFactor(float fFactor)
Specified by:
setTempoFactor in interface Sequencer

getTempoFactor

public float getTempoFactor()
Specified by:
getTempoFactor in interface Sequencer

getTickLength

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

getMicrosecondLength

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

addMetaEventListener

public boolean addMetaEventListener(MetaEventListener listener)
Specified by:
addMetaEventListener in interface Sequencer

removeMetaEventListener

public void removeMetaEventListener(MetaEventListener listener)
Specified by:
removeMetaEventListener in interface Sequencer

addControllerEventListener

public int[] addControllerEventListener(ControllerEventListener listener,
                                        int[] anControllers)
Specified by:
addControllerEventListener in interface Sequencer

removeControllerEventListener

public int[] removeControllerEventListener(ControllerEventListener listener,
                                           int[] anControllers)
Specified by:
removeControllerEventListener in interface Sequencer

getMasterSyncMode

public Sequencer.SyncMode getMasterSyncMode()
Specified by:
getMasterSyncMode in interface Sequencer

setMasterSyncMode

public void setMasterSyncMode(Sequencer.SyncMode syncMode)
Specified by:
setMasterSyncMode in interface Sequencer

getMasterSyncModes

public Sequencer.SyncMode[] getMasterSyncModes()
Specified by:
getMasterSyncModes in interface Sequencer

getSlaveSyncMode

public Sequencer.SyncMode getSlaveSyncMode()
Specified by:
getSlaveSyncMode in interface Sequencer

setSlaveSyncMode

public void setSlaveSyncMode(Sequencer.SyncMode syncMode)
Specified by:
setSlaveSyncMode in interface Sequencer

getSlaveSyncModes

public Sequencer.SyncMode[] getSlaveSyncModes()
Specified by:
getSlaveSyncModes in interface Sequencer

getTrackSolo

public boolean getTrackSolo(int nTrack)
Specified by:
getTrackSolo in interface Sequencer

setTrackSolo

public void setTrackSolo(int nTrack,
                         boolean bSolo)
Specified by:
setTrackSolo in interface Sequencer

getTrackMute

public boolean getTrackMute(int nTrack)
Specified by:
getTrackMute in interface Sequencer

setTrackMute

public void setTrackMute(int nTrack,
                         boolean bMute)
Specified by:
setTrackMute in interface Sequencer

setLatency

public void setLatency(int nMilliseconds)
Sets the preloading intervall. This is the time span between preloading events to an internal queue and playing them. This intervall should be kept constant by the implementation. However, this cannot be guaranteed.


getLatency

public int getLatency()
Get the preloading intervall.

Returns:
the preloading intervall in milliseconds, or -1 if the sequencer doesn't repond to changes in the Sequence at all.