|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread sky.monome.sequencer.SequencerEngine<S,B>
S
- Type of sequencers that use these sequencer engines.B
- Type of button managers used by the sequencers that use these sequencer engines.public class SequencerEngine<S extends Sequencer<S,B>,B extends ButtonManager<B>>
Engine of a sequencer. The engine is responsible for the iteration over the sequence of the sequencer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected int |
divisions
Number of divisions by quarter note used by this sequencer engine. |
protected Monome |
monome
Logical Monome device for refreshings. |
protected SynchronizedList<S> |
sequencers
List of sequencers that use this sequencer engine. |
protected float |
tempo
Tempo used by this sequencer engine. |
protected double |
timeBetweenSteps
Calculated time between two consecutive steps, in milliseconds. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SequencerEngine(Monome monome,
float tempo,
int divisions,
S... sequencers)
Constructs a sequencer engine with the specified logical Monome device, the specified tempo, the specified number of divisions by quarter note, and driving specified sequencers. |
Method Summary | |
---|---|
void |
addSequencer(S sequencer)
Adds the specified sequencer to the list of associated sequencers. |
int |
getDivisions()
Returns the number of divisions by quarter note currently used by this sequencer engine. |
S[] |
getSequencers()
Returns an array of all associated sequencers. |
float |
getTempo()
Returns the current tempo of this sequencer engine. |
double |
getTimeBetweenSteps()
Returns the calculated time between two consecutive steps. |
void |
refreshMonome()
Refreshes the physical Monome device. |
void |
removeSequencer(S sequencer)
Removes the specified sequencer from the list of associated sequencers. |
void |
removeSequencers()
Removes all sequencers from the list of associated sequencers. |
void |
run()
Invoked by the virtual machine to execute this thread. |
void |
setDivisions(int divisions)
Modifies the number of divisions by quarter note of this sequencer engine. |
void |
setTempo(float tempo)
Modifies the tempo of this sequencer engine. |
void |
setTempo(float tempo,
int divisions)
Modified the tempo and the number of divisions by quarter note currently used by this sequencer engine. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double timeBetweenSteps
protected float tempo
protected int divisions
protected final SynchronizedList<S extends Sequencer<S,B>> sequencers
protected final Monome monome
Constructor Detail |
---|
public SequencerEngine(Monome monome, float tempo, int divisions, S... sequencers)
monome
- Logical Monome device for refreshings.tempo
- Tempo, in number of quarter notes by minute.divisions
- Number of divisions by quarter note.sequencers
- Sequencers that will be driven by this sequencer engine.Method Detail |
---|
public int getDivisions()
public void setDivisions(int divisions)
divisions
- New number of divisions by quarter note used by this
sequencer engine.public float getTempo()
public void setTempo(float tempo)
tempo
- New tempo for this sequencer engine.public void setTempo(float tempo, int divisions)
tempo
- New tempo for this sequencer engine.divisions
- New number of divisions by quarter note used by this
sequencer engine.public S[] getSequencers()
public void addSequencer(S sequencer)
sequencer
- Sequencer to add to the list of associated sequencers.public void removeSequencer(S sequencer)
sequencer
- Sequencer to remove from the list of associated sequencers.public void removeSequencers()
public void refreshMonome() throws MonomeException
MonomeException
- When the Monome device can't be refreshed.public double getTimeBetweenSteps()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |