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.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doublefinal BooleanParameterWhether this modulator is currently running.final TriggerParameterFields inherited from class heronarts.lx.LXComponent
childArrays, 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, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedprotectedLXRunnableComponent(LX lx, String label) protectedLXRunnableComponent(String label) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether this runnable is running.voidloop(double deltaMs) voidonParameterChanged(LXParameter parameter) Subclasses are free to override this if desired.protected voidonReset()Optional subclass method when reset happens.protected voidonStart()Optional subclass method when start happens.protected voidonStop()Optional subclass method when stop happens.protected voidOptional subclass method when trigger is fired, called before onReset and onStartprotected voidpostRun(double deltaMs) final LXRunnableComponentreset()Resets the runnable to its default condition and stops it.protected abstract voidrun(double deltaMs) final LXRunnableComponentstart()Sets the runnable in motionfinal LXRunnableComponentstop()Pauses the runnable wherever it is.final LXRunnableComponenttoggle()final LXRunnableComponenttrigger()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, assertDisposed, contains, copyParameters, dispose, getCategory, getChild, getComponentDescription, 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, 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:LXComponentSubclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChangedin interfaceLXParameterListener- Overrides:
onParameterChangedin 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:
loopin interfaceLXLoopTask
-
run
protected abstract void run(double deltaMs) -
postRun
protected void postRun(double deltaMs)
-