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

public abstract class LXRunnableComponent extends LXComponent implements LXLoopTask
  • Field Details

    • runMs

      protected double runMs
    • running

      public final BooleanParameter running
      Whether this modulator is currently running.
    • trigger

      public final TriggerParameter trigger
  • Constructor Details

    • LXRunnableComponent

      protected LXRunnableComponent()
    • LXRunnableComponent

      protected LXRunnableComponent(String label)
    • LXRunnableComponent

      protected LXRunnableComponent(LX lx)
    • LXRunnableComponent

      protected LXRunnableComponent(LX lx, String label)
  • Method Details

    • onParameterChanged

      public void onParameterChanged(LXParameter parameter)
      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 interface LXParameterListener
      Overrides:
      onParameterChanged in class LXComponent
      Parameters:
      parameter - Parameter that has a value change
    • toggle

      public final LXRunnableComponent toggle()
    • start

      public final LXRunnableComponent start()
      Sets the runnable in motion
      Returns:
      this
    • stop

      public final LXRunnableComponent 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

      public 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.
      Returns:
      this
    • reset

      public final LXRunnableComponent 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 interface LXLoopTask
    • run

      protected abstract void run(double deltaMs)
    • postRun

      protected void postRun(double deltaMs)