public class MetroTrack extends java.lang.Object implements MetroLock, EventListenable, MetroSyncTrack, MetroNamedTrack
EventListenable.Default, EventListenable.Listener
Modifier and Type | Field and Description |
---|---|
protected int |
cursor |
protected boolean |
enabled |
static java.lang.Object |
EVENT_PREPARED |
protected EventListenable |
eventListenerable |
protected int |
lastAccumulatedLength |
protected int |
lastLengthInFrames |
protected java.lang.Object |
name
Note that the String object which is stored in name field must be interned.
|
protected boolean |
prepared |
protected MetroSequence |
sequence |
protected java.util.Collection<java.lang.Object> |
tags |
protected int |
totalCursor |
Constructor and Description |
---|
MetroTrack(Metro metro,
java.lang.Object name,
java.util.Collection<java.lang.Object> tags,
MetroSequence sequence)
Create a MetroTrack object with default synchronizing status.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(java.lang.Object type,
EventListenable.Listener listener) |
protected void |
checkBuffer(Metro metro,
int barLengthInFrames) |
protected void |
clearBuffer() |
void |
clearEventListeners() |
boolean |
equals(java.lang.Object obj) |
java.util.concurrent.BlockingQueue<metro.MetroEventBuffer> |
getBuffers() |
int |
getCursor() |
int |
getLatestLengthInFrames() |
java.lang.Object |
getMetroLock() |
java.lang.Object |
getMetroTrackLock() |
java.lang.Object |
getName() |
MetroSequence |
getSequence() |
double |
getSyncOffset() |
MetroSyncTrack |
getSyncTrack() |
MetroSyncType |
getSyncType() |
java.lang.Object |
getTrackName() |
double |
getTrackPosition() |
java.util.Collection<java.lang.Object> |
getTrackTags() |
int |
hashCode() |
void |
invokeEventListener(java.lang.Object type) |
boolean |
isTrackEnabled() |
protected void |
progressCursor(int nframes,
java.util.List<MetroMidiEvent> result) |
void |
removeEventListener(EventListenable.Listener listener) |
void |
removeGracefully() |
void |
setCursor(int cursor) |
MetroTrack |
setSyncStatus(MetroSyncType syncType,
MetroSyncTrack syncTrack,
double syncOffset) |
void |
setTrackEnabled(boolean enabled) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
setSyncStatus
protected final java.lang.Object name
protected final java.util.Collection<java.lang.Object> tags
protected final MetroSequence sequence
protected transient boolean prepared
protected transient boolean enabled
protected transient int totalCursor
protected transient int cursor
protected transient int lastLengthInFrames
protected transient int lastAccumulatedLength
public static final java.lang.Object EVENT_PREPARED
protected final EventListenable eventListenerable
public MetroTrack(Metro metro, java.lang.Object name, java.util.Collection<java.lang.Object> tags, MetroSequence sequence)
public
but this is usually called only from
Metro#createTrack(String, Collection, MetroSequence, MetroSyncType, MetroTrack, double)
and users should not call this constructor directory. Though it is still left public
for further hacking.metro
- Specifying the parent metro object.name
- Specifying the identifier of the track.tags
- Specifying the tag strings. This could be null and treated as an
empty set.sequence
- Specifying the sequence object to play.public java.lang.Object getName()
getName
in interface MetroNamedTrack
public int getCursor()
getCursor
in interface MetroSyncTrack
public void setCursor(int cursor)
setCursor
in interface MetroSyncTrack
public java.util.concurrent.BlockingQueue<metro.MetroEventBuffer> getBuffers()
public void clearEventListeners()
clearEventListeners
in interface EventListenable
public void addEventListener(java.lang.Object type, EventListenable.Listener listener)
addEventListener
in interface EventListenable
public void removeEventListener(EventListenable.Listener listener)
removeEventListener
in interface EventListenable
public void invokeEventListener(java.lang.Object type)
invokeEventListener
in interface EventListenable
public java.lang.Object getMetroTrackLock()
public java.lang.Object getMetroLock()
getMetroLock
in interface MetroLock
public MetroSequence getSequence()
public java.lang.Object getTrackName()
public java.util.Collection<java.lang.Object> getTrackTags()
public boolean isTrackEnabled()
public void setTrackEnabled(boolean enabled)
public void removeGracefully()
public double getTrackPosition()
public MetroTrack setSyncStatus(MetroSyncType syncType, MetroSyncTrack syncTrack, double syncOffset)
syncType
- Specifying the way to synchronize with the syncTrack object. See
MetroSyncType
syncTrack
- Specifying the track object to synchronize with.syncOffset
- Specifying the distance from the track object with which is
synchronized.public MetroSyncType getSyncType()
getSyncType
in interface MetroSyncTrack
public MetroSyncTrack getSyncTrack()
getSyncTrack
in interface MetroSyncTrack
public double getSyncOffset()
getSyncOffset
in interface MetroSyncTrack
public int getLatestLengthInFrames()
getLatestLengthInFrames
in interface MetroSyncTrack
protected void progressCursor(int nframes, java.util.List<MetroMidiEvent> result) throws org.jaudiolibs.jnajack.JackException
org.jaudiolibs.jnajack.JackException
protected void checkBuffer(Metro metro, int barLengthInFrames) throws org.jaudiolibs.jnajack.JackException
org.jaudiolibs.jnajack.JackException
protected void clearBuffer()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object