Package org.jjazz.musiccontrol.api
Class ControlTrack
java.lang.Object
org.jjazz.musiccontrol.api.ControlTrack
A control track contains custom MetaEvents used by the MusicController to fire PlaybackListener events.
- a trackname event
- a MetaEvent for each chord symbol.
- a MetaEvent for each beat changel.
Methods are provided to extract the original data from these custom MetaEvents.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionControlTrack
(SongContext sgContext, int trackId) Create a control track for the specified SongContext. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Fill the specified track with this control track MidiEvents.Retrieve the chord symbol from a control track MetaMessage.The chord sequence used to generate the control track events.The list of MidiEvents of the control track: track name, beat changes, chord symbol changes.Retrieve the Position from a control track MetaMessage.float
Retrieve the position in beats from a control track MetaMessage.int
toString()
-
Field Details
-
POSITION_META_EVENT_TYPE
public static final int POSITION_META_EVENT_TYPE- See Also:
-
CHORD_SYMBOL_META_EVENT_TYPE
public static final int CHORD_SYMBOL_META_EVENT_TYPE- See Also:
-
TRACK_NAME
-
-
Constructor Details
-
ControlTrack
Create a control track for the specified SongContext.- Parameters:
sgContext
-trackId
-
-
-
Method Details
-
getTrackId
public int getTrackId() -
getMidiEvents
The list of MidiEvents of the control track: track name, beat changes, chord symbol changes.- Returns:
- Can't be null. IMPORTANT: events may NOT be ordered by tick position.
-
getContextChordGetSequence
The chord sequence used to generate the control track events.- Returns:
- Can't be null
-
fillTrack
Fill the specified track with this control track MidiEvents.- Parameters:
track
-
-
getChordSymbol
Retrieve the chord symbol from a control track MetaMessage.- Parameters:
mm
- A MetaMessage with type==CHORD_SYMBOL_META_EVENT_TYPE- Returns:
- Can be null if mm is unknown
-
getPosition
Retrieve the Position from a control track MetaMessage.- Parameters:
mm
- A MetaMessage with type==POSITION_META_EVENT_TYPE- Returns:
- Can be null if mm is unknown
-
getPositionInBeats
Retrieve the position in beats from a control track MetaMessage.- Parameters:
mm
- A MetaMessage with type==POSITION_META_EVENT_TYPE- Returns:
- -1 if mm is unknown
-
toString
-