Package heronarts.lx
Class LXRunnableComponent
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXRunnableComponent
- All Implemented Interfaces:
LXLoopTask
,LXPath
,LXSerializable
,LXParameterListener
- Direct Known Subclasses:
Envelop
,Envelop.MultiMeter
,LXClip
,LXModulator
,Reaper
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Hidden, LXComponent.Placeholder, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
final BooleanParameter
Whether this modulator is currently running.final TriggerParameter
Fields inherited from class heronarts.lx.LXComponent
children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFile
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
protected
LXRunnableComponent
(LX lx, String label) protected
LXRunnableComponent
(String label) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
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.protected void
Optional subclass method when trigger is fired, called before onReset and onStartprotected void
postRun
(double deltaMs) final LXRunnableComponent
reset()
Resets the runnable to its default condition and stops it.protected abstract void
run
(double deltaMs) final LXRunnableComponent
start()
Sets the runnable in motionfinal LXRunnableComponent
stop()
Pauses the runnable wherever it is.final LXRunnableComponent
toggle()
final 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.Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, contains, copyParameters, dispose, getCategory, getChild, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, load, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, save, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
runMs
protected double runMs -
running
Whether this modulator is currently running. -
trigger
-
-
Constructor Details
-
LXRunnableComponent
protected LXRunnableComponent() -
LXRunnableComponent
-
LXRunnableComponent
-
LXRunnableComponent
-
-
Method Details
-
onParameterChanged
Description copied from class:LXComponent
Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChanged
in interfaceLXParameterListener
- Overrides:
onParameterChanged
in classLXComponent
- Parameters:
parameter
- Parameter that has a value change
-
toggle
-
start
Sets the runnable in motion- Returns:
- this
-
stop
Pauses the runnable wherever it is. Internal state should be maintained. A subsequent call to start() should result in the runnable continuing as it was running before.- Returns:
- this
-
isRunning
public final boolean isRunning()Indicates whether this runnable is running.- Returns:
- Whether running
-
trigger
Invoking the trigger() method restarts a runnable from its initial state, and should also start the runnable if it is not already running.- Returns:
- this
-
reset
Resets the runnable to its default condition and stops it.- Returns:
- this
-
onStart
protected void onStart()Optional subclass method when start happens. -
onStop
protected void onStop()Optional subclass method when stop happens. -
onReset
protected void onReset()Optional subclass method when reset happens. -
onTrigger
protected void onTrigger()Optional subclass method when trigger is fired, called before onReset and onStart -
loop
public void loop(double deltaMs) - Specified by:
loop
in interfaceLXLoopTask
-
run
protected abstract void run(double deltaMs) -
postRun
protected void postRun(double deltaMs)
-