|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Sequencer
A Sequencer object plays MIDI sequences described as Sequence objects. This class provides methods for loading and unloading sequences, as well as basic transport controls.
Nested Class Summary | |
---|---|
static class |
Sequencer.SyncMode
A SyncMode object represents the mechanism by which a MIDI sequencer synchronizes time with a master or slave device. |
Nested classes/interfaces inherited from interface javax.sound.midi.MidiDevice |
---|
MidiDevice.Info |
Method Summary | |
---|---|
int[] |
addControllerEventListener(ControllerEventListener listener,
int[] controllers)
Add a controller event listening object to this sequencer. |
boolean |
addMetaEventListener(MetaEventListener listener)
Add a meta event listening object to this sequencer. |
Sequencer.SyncMode |
getMasterSyncMode()
Get the source of timing information. |
Sequencer.SyncMode[] |
getMasterSyncModes()
Get an array of timing sources supported by this sequencer. |
long |
getMicrosecondLength()
Get the length of the current sequence in microseconds. |
long |
getMicrosecondPosition()
Get the current playback position of the sequencer in microseconds. |
Sequence |
getSequence()
Get the current sequence object for this sequencer. |
Sequencer.SyncMode |
getSlaveSyncMode()
Get the current slave synchronization mode. |
Sequencer.SyncMode[] |
getSlaveSyncModes()
Get an array of slave sync modes supported by this sequencer. |
float |
getTempoFactor()
Get the current scaling factor for the playback tempo. |
float |
getTempoInBPM()
Get the current tempo in beats per minute. |
float |
getTempoInMPQ()
Get the current tempo in microseconds per quarter note. |
long |
getTickLength()
Get the length of the current sequence in MIDI ticks. |
long |
getTickPosition()
Get the current playback position of the sequencer in MIDI ticks. |
boolean |
getTrackMute(int track)
Get the mute state of a specific track. |
boolean |
getTrackSolo(int track)
Get the solo state for a specific track. |
boolean |
isRecording()
Returns true if sequence is recording. |
boolean |
isRunning()
Returns true if the sequence is playing. |
void |
recordDisable(Track track)
Disable recording for a specific track. |
void |
recordEnable(Track track,
int channel)
Enable recording for a specific track using data from a specific channel. |
int[] |
removeControllerEventListener(ControllerEventListener listener,
int[] controllers)
Remove a controller listener from this sequencer for the specified controller numbers. |
void |
removeMetaEventListener(MetaEventListener listener)
Remove a meta event listener from this sequencer. |
void |
setMasterSyncMode(Sequencer.SyncMode sync)
Set the source of timing information. |
void |
setMicrosecondPosition(long microsecond)
Set the current playback position of the sequencer in microseconds. |
void |
setSequence(InputStream istream)
Set the sequence for this sequencer. |
void |
setSequence(Sequence seq)
Set the Sequence object for this sequencer. |
void |
setSlaveSyncMode(Sequencer.SyncMode sync)
Set the slave synchronization mode for this sequencer. |
void |
setTempoFactor(float factor)
Set a scaling factor for the playback tempo, which is 1.0 by default. |
void |
setTempoInBPM(float bpm)
Sets the current tempo in beats per minute. |
void |
setTempoInMPQ(float mpq)
Sets the current tempo in microseconds per quarter note. |
void |
setTickPosition(long tick)
Set the current playback position of the sequencer in MIDI ticks. |
void |
setTrackMute(int track,
boolean mute)
Sets the mute state for a specific track. |
void |
setTrackSolo(int track,
boolean solo)
Sets the solo state for a specific track. |
void |
start()
Start playback of the current sequence. |
void |
startRecording()
Start playback and record of MIDI events. |
void |
stop()
Stop playback of the current sequence. |
void |
stopRecording()
Stop recording, although continue playing. |
Methods inherited from interface javax.sound.midi.MidiDevice |
---|
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getReceiver, getTransmitter, isOpen, open |
Method Detail |
---|
void setSequence(Sequence seq) throws InvalidMidiDataException
seq
- the Sequence to process
InvalidMidiDataException
- if the sequence is invalid for any reasonvoid setSequence(InputStream istream) throws IOException, InvalidMidiDataException
istream
- an input stream for a valid MIDI file
IOException
- if an I/O exception happens
InvalidMidiDataException
- if the MIDI file contains bad dataSequence getSequence()
void start()
void stop()
boolean isRunning()
void startRecording()
void stopRecording()
boolean isRecording()
void recordEnable(Track track, int channel)
track
- the track to enable for recordingchannel
- the channel from which to recordvoid recordDisable(Track track)
track
- the track to disable recording forfloat getTempoInBPM()
void setTempoInBPM(float bpm)
bpm
- the new tempo in bears per minutesfloat getTempoInMPQ()
void setTempoInMPQ(float mpq)
mpq
- the new tempo in microseconds per quarter note.void setTempoFactor(float factor)
factor
- the new tempo scaling factorfloat getTempoFactor()
long getTickLength()
long getTickPosition()
void setTickPosition(long tick)
tick
- the new playback position of the sequencer in MIDI tickslong getMicrosecondLength()
long getMicrosecondPosition()
getMicrosecondPosition
in interface MidiDevice
void setMicrosecondPosition(long microsecond)
microsecond
- the new playback position of the sequencer in microsecondsvoid setMasterSyncMode(Sequencer.SyncMode sync)
sync
- the new source of timing informationSequencer.SyncMode getMasterSyncMode()
Sequencer.SyncMode[] getMasterSyncModes()
void setSlaveSyncMode(Sequencer.SyncMode sync)
sync
- the new slave sync mode for this sequencerSequencer.SyncMode getSlaveSyncMode()
Sequencer.SyncMode[] getSlaveSyncModes()
void setTrackMute(int track, boolean mute)
track
- the track to modifymute
- the new mute stateboolean getTrackMute(int track)
track
- the track to query
void setTrackSolo(int track, boolean solo)
track
- the track to modifysolo
- the new solo stateboolean getTrackSolo(int track)
track
- the track to query
boolean addMetaEventListener(MetaEventListener listener)
listener
- the listener to add
void removeMetaEventListener(MetaEventListener listener)
listener
- the listener to removeint[] addControllerEventListener(ControllerEventListener listener, int[] controllers)
listener
- the listener to addcontrollers
- the conroller numbers to listen to
int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers)
listener
- the listener to removecontrollers
- the controllers to unlisten
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |