public abstract class LXRunnableComponent extends LXComponent implements LXLoopTask
LXComponent.Placeholder, LXComponent.Renamable
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
protected double |
runMs |
BooleanParameter |
running
Whether this modulator is currently running.
|
BooleanParameter |
trigger |
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Modifier | Constructor and Description |
---|---|
protected |
LXRunnableComponent() |
protected |
LXRunnableComponent(LX lx) |
protected |
LXRunnableComponent(LX lx,
String label) |
protected |
LXRunnableComponent(String label) |
Modifier and Type | Method and Description |
---|---|
boolean |
isRunning()
Indicates whether this runnable is running.
|
void |
loop(double deltaMs) |
void |
onParameterChanged(LXParameter parameter)
Subclasses are free to override this if desired.
|
protected void |
onReset()
Optional subclass method when reset happens.
|
protected void |
onStart()
Optional subclass method when start happens.
|
protected void |
onStop()
Optional subclass method when stop happens.
|
LXRunnableComponent |
reset()
Resets the runnable to its default condition and stops it.
|
protected abstract void |
run(double deltaMs) |
LXRunnableComponent |
start()
Sets the runnable in motion
|
LXRunnableComponent |
stop()
Pauses the runnable wherever it is.
|
LXRunnableComponent |
toggle() |
LXRunnableComponent |
trigger()
Invoking the trigger() method restarts a runnable from its initial state,
and should also start the runnable if it is not already running.
|
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, dispose, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, load, loadParameters, removeParameter, removeParameter, save, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
protected double runMs
public final BooleanParameter running
public final BooleanParameter trigger
protected LXRunnableComponent()
protected LXRunnableComponent(String label)
protected LXRunnableComponent(LX lx)
public void onParameterChanged(LXParameter parameter)
LXComponent
onParameterChanged
in interface LXParameterListener
onParameterChanged
in class LXComponent
parameter
- Parameter that has a value changepublic final LXRunnableComponent toggle()
public final LXRunnableComponent start()
public final LXRunnableComponent stop()
public final boolean isRunning()
public final LXRunnableComponent trigger()
public final LXRunnableComponent reset()
protected void onStart()
protected void onStop()
protected void onReset()
public void loop(double deltaMs)
loop
in interface LXLoopTask
protected abstract void run(double deltaMs)
LX library by Mark C. Slee. © 2012-2020