org.tritonus.share.midi
Class TSequencer
java.lang.Object
org.tritonus.share.midi.TMidiDevice
org.tritonus.share.midi.TSequencer
- All Implemented Interfaces:
- MidiDevice, Sequencer
- Direct Known Subclasses:
- AlsaSequencer, JavaSequencer, TPreloadingSequencer
public abstract class TSequencer
- extends TMidiDevice
- implements Sequencer
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 |
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.