public class SequencerImpl extends Object implements Sequencer
Sequencer implementationSequencer.SyncModeMidiDevice.InfoLOOP_CONTINUOUSLY| Constructor and Description |
|---|
SequencerImpl()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
addControllerEventListener(ControllerEventListener listener,
int[] controllers)
|
boolean |
addMetaEventListener(MetaEventListener listener)
Add
EventListener for MetaMessage |
void |
close()
Close the
MidiDevice. |
MidiDevice.Info |
getDeviceInfo()
Get the device information
|
int |
getLoopCount()
Get the count of loop.
|
long |
getLoopEndPoint()
Get the end point(ticks) of loop.
|
long |
getLoopStartPoint()
Get start point(ticks) of loop.
|
Sequencer.SyncMode |
getMasterSyncMode()
Get the
Sequencer.SyncMode for master. |
Sequencer.SyncMode[] |
getMasterSyncModes()
Get the available
Sequencer.SyncMode for master. |
int |
getMaxReceivers()
Get the number of the
Receivers. |
int |
getMaxTransmitters()
Get the number of the
Transmitters. |
long |
getMicrosecondLength()
Get the
Sequence length in microseconds. |
long |
getMicrosecondPosition()
Get the current microsecond position.
|
Receiver |
getReceiver()
Get the default
Receiver. |
List<Receiver> |
getReceivers()
Get the all of
Receivers. |
Sequence |
getSequence()
Get the
Sequence |
Sequencer.SyncMode |
getSlaveSyncMode()
Get the
Sequencer.SyncMode for slave. |
Sequencer.SyncMode[] |
getSlaveSyncModes()
Get the available
Sequencer.SyncMode for slave. |
float |
getTempoFactor()
Get the tempo factor.
|
float |
getTempoInBPM()
Get the tempo in the Beats per minute.
|
float |
getTempoInMPQ()
Get the tempos in the microseconds per quarter note.
|
long |
getTickLength()
Get the
Sequence length in ticks. |
long |
getTickPosition()
Get the current tick position.
|
boolean |
getTrackMute(int track)
Get if the track is mute on the playback.
|
boolean |
getTrackSolo(int track)
Get if the track is solo on the playback.
|
Transmitter |
getTransmitter()
Get the default
Transmitter. |
List<Transmitter> |
getTransmitters()
Get the all of
Transmitters. |
boolean |
isOpen()
Check if the
MidiDevice opened. |
boolean |
isRecording()
Get if the
Sequencer is recording. |
boolean |
isRunning()
Get if the
Sequencer is playing OR recording. |
void |
open()
Open the
MidiDevice. |
void |
recordDisable(Track track)
Set the
Track to disable recording |
void |
recordEnable(Track track,
int channel)
Set the
Track to enable recording on the specified channel. |
int[] |
removeControllerEventListener(ControllerEventListener listener,
int[] controllers)
Remove
EventListener for ShortMessage.CONTROL_CHANGE |
void |
removeMetaEventListener(MetaEventListener listener)
Remove
EventListener for MetaMessage |
void |
setLoopCount(int count)
Set count of loop.
|
void |
setLoopEndPoint(long tick)
Set end point(ticks) of loop.
|
void |
setLoopStartPoint(long tick)
Set start point(ticks) of loop.
|
void |
setMasterSyncMode(Sequencer.SyncMode sync)
Set the
Sequencer.SyncMode for master. |
void |
setMicrosecondPosition(long microseconds)
Set the current microsecond position.
|
void |
setSequence(InputStream stream)
Load a
Sequence from stream. |
void |
setSequence(Sequence sequence)
|
void |
setSlaveSyncMode(Sequencer.SyncMode sync)
Set the
Sequencer.SyncMode for slave. |
void |
setTempoFactor(float factor)
Set the tempo factor.
|
void |
setTempoInBPM(float bpm)
Set the tempo in the Beats per minute.
|
void |
setTempoInMPQ(float mpq)
Set the tempos in the microseconds per quarter note.
|
void |
setTickPosition(long tick)
Set the current tick position.
|
void |
setTrackMute(int track,
boolean mute)
Set the track to mute on the playback.
|
void |
setTrackSolo(int track,
boolean solo)
Set track to solo on the playback.
|
void |
start()
Start playing (starting at current sequencer position)
|
void |
startRecording()
Start recording (starting at current sequencer position)
|
void |
stop()
Stop playing AND recording.
|
void |
stopRecording()
Stop recording.
|
@NonNull public MidiDevice.Info getDeviceInfo()
MidiDevicegetDeviceInfo in interface MidiDevicepublic void open()
throws MidiUnavailableException
MidiDeviceMidiDevice. This method must be called at getting the new instance.open in interface MidiDeviceMidiUnavailableExceptionpublic void close()
MidiDeviceMidiDevice. This method must be called at finishing to use the instance.close in interface MidiDevicepublic boolean isOpen()
MidiDeviceMidiDevice opened.isOpen in interface MidiDevicepublic int getMaxReceivers()
MidiDeviceReceivers.getMaxReceivers in interface MidiDeviceReceivers.public int getMaxTransmitters()
MidiDeviceTransmitters.getMaxTransmitters in interface MidiDeviceTransmitters.@NonNull public Receiver getReceiver() throws MidiUnavailableException
MidiDeviceReceiver.getReceiver in interface MidiDeviceReceiver.MidiUnavailableException@NonNull public List<Receiver> getReceivers()
MidiDeviceReceivers.getReceivers in interface MidiDeviceReceivers.@NonNull public Transmitter getTransmitter() throws MidiUnavailableException
MidiDeviceTransmitter.getTransmitter in interface MidiDeviceTransmitter.MidiUnavailableException@NonNull public List<Transmitter> getTransmitters()
MidiDeviceTransmitters.getTransmitters in interface MidiDeviceTransmitters.@NonNull public int[] addControllerEventListener(@NonNull ControllerEventListener listener, @NonNull int[] controllers)
SequenceraddControllerEventListener in interface Sequencerlistener - event listenercontrollers - controller codes@NonNull public int[] removeControllerEventListener(@NonNull ControllerEventListener listener, @NonNull int[] controllers)
SequencerEventListener for ShortMessage.CONTROL_CHANGEremoveControllerEventListener in interface Sequencerlistener - event listenercontrollers - controller codespublic boolean addMetaEventListener(@NonNull MetaEventListener listener)
SequencerEventListener for MetaMessageaddMetaEventListener in interface Sequencerlistener - event listenerpublic void removeMetaEventListener(@NonNull MetaEventListener listener)
SequencerEventListener for MetaMessageremoveMetaEventListener in interface Sequencerlistener - event listenerpublic int getLoopCount()
SequencergetLoopCount in interface SequencerSequencer.LOOP_CONTINUOUSLY: play loops eternallypublic void setLoopCount(int count)
SequencersetLoopCount in interface Sequencercount - Sequencer.LOOP_CONTINUOUSLY: play loops eternallypublic long getLoopStartPoint()
SequencergetLoopStartPoint in interface Sequencerpublic void setLoopStartPoint(long tick)
SequencersetLoopStartPoint in interface Sequencertick - 0: start of Sequencepublic long getLoopEndPoint()
SequencergetLoopEndPoint in interface Sequencerpublic void setLoopEndPoint(long tick)
SequencersetLoopEndPoint in interface Sequencertick - -1: end of Sequence@NonNull public Sequencer.SyncMode getMasterSyncMode()
SequencerSequencer.SyncMode for master.getMasterSyncMode in interface SequencerSequencer.SyncMode for master.public void setMasterSyncMode(@NonNull Sequencer.SyncMode sync)
SequencerSequencer.SyncMode for master.setMasterSyncMode in interface Sequencersync - the Sequencer.SyncMode for master.@NonNull public Sequencer.SyncMode[] getMasterSyncModes()
SequencerSequencer.SyncMode for master.getMasterSyncModes in interface SequencerSequencer.SyncMode for master.public long getMicrosecondPosition()
SequencergetMicrosecondPosition in interface MidiDevicegetMicrosecondPosition in interface Sequencerpublic void setMicrosecondPosition(long microseconds)
SequencersetMicrosecondPosition in interface Sequencermicroseconds - the current microsecond positionpublic long getMicrosecondLength()
SequencerSequence length in microseconds.getMicrosecondLength in interface SequencerSequence length in microsecondspublic Sequence getSequence()
SequencerSequencegetSequence in interface SequencerSequencepublic void setSequence(@NonNull InputStream stream) throws IOException, InvalidMidiDataException
SequencerSequence from stream.setSequence in interface Sequencerstream - sequence sourceIOExceptionInvalidMidiDataExceptionpublic void setSequence(@Nullable Sequence sequence) throws InvalidMidiDataException
SequencersetSequence in interface Sequencersequence - the SequenceInvalidMidiDataException@NonNull public Sequencer.SyncMode getSlaveSyncMode()
SequencerSequencer.SyncMode for slave.getSlaveSyncMode in interface SequencerSequencer.SyncMode for slave.public void setSlaveSyncMode(@NonNull Sequencer.SyncMode sync)
SequencerSequencer.SyncMode for slave.setSlaveSyncMode in interface Sequencersync - the Sequencer.SyncMode for slave.@NonNull public Sequencer.SyncMode[] getSlaveSyncModes()
SequencerSequencer.SyncMode for slave.getSlaveSyncModes in interface SequencerSequencer.SyncMode for slave.public float getTempoFactor()
SequencergetTempoFactor in interface Sequencerpublic void setTempoFactor(float factor)
SequencerSequence's tempo.setTempoFactor in interface Sequencerfactor - public float getTempoInBPM()
SequencergetTempoInBPM in interface Sequencerpublic void setTempoInBPM(float bpm)
SequencersetTempoInBPM in interface Sequencerbpm - the tempo in the Beats per minutepublic float getTempoInMPQ()
SequencergetTempoInMPQ in interface Sequencerpublic void setTempoInMPQ(float mpq)
SequencersetTempoInMPQ in interface Sequencermpq - the tempos in the microseconds per quarter notepublic long getTickLength()
SequencerSequence length in ticks.getTickLength in interface SequencerSequence length in tickspublic long getTickPosition()
SequencergetTickPosition in interface Sequencerpublic void setTickPosition(long tick)
SequencersetTickPosition in interface Sequencertick - the current tick positionpublic boolean getTrackMute(int track)
SequencergetTrackMute in interface Sequencertrack - the track numberpublic void setTrackMute(int track,
boolean mute)
SequencersetTrackMute in interface Sequencertrack - the track numbermute - true to set mute the trackpublic boolean getTrackSolo(int track)
SequencergetTrackSolo in interface Sequencertrack - the track numberpublic void setTrackSolo(int track,
boolean solo)
SequencersetTrackSolo in interface Sequencertrack - the track numbersolo - true to set solo the trackpublic void recordDisable(@Nullable Track track)
SequencerTrack to disable recordingrecordDisable in interface Sequencertrack - the Track to disable recordingpublic void recordEnable(@NonNull Track track, int channel)
SequencerTrack to enable recording on the specified channel.recordEnable in interface Sequencertrack - the Trackchannel - the channel, 0-15public void startRecording()
Sequencer
Current Sequence's events are sent to the all Transmitter.
Received events art also sent to the all Transmitter.
startRecording in interface Sequencerpublic boolean isRecording()
SequencerSequencer is recording.isRecording in interface SequencerSequencer is recordingpublic void stopRecording()
SequencerstopRecording in interface Sequencerpublic void start()
Sequencerpublic boolean isRunning()
SequencerSequencer is playing OR recording.