Class LXEffect

All Implemented Interfaces:
LXComponent.Renamable, LXLoopTask, LXPath, LXPresetComponent, LXSerializable, LXMidiListener, LXModulationContainer, LXOscComponent, LXParameterListener
Direct Known Subclasses:
BlurEffect, ColorizeEffect, ColorMaskEffect, DynamicsEffect, GateEffect, HueSaturationEffect, ImageMaskEffect, InvertEffect, LXEffect.Placeholder, LXModelEffect, ScriptEffect, SoundObjectEffect, SparkleEffect, StrobeEffect

public abstract class LXEffect extends LXDeviceComponent implements LXComponent.Renamable, LXOscComponent
Class to represent an effect that may be applied to the color array. Effects may be stateless or stateful, though typically they operate on a single frame. Only the current frame is provided at runtime.
  • Field Details

  • Constructor Details

    • LXEffect

      protected LXEffect(LX lx)
  • Method Details

    • isHiddenControl

      public boolean isHiddenControl(LXParameter parameter)
      Description copied from class: LXDeviceComponent
      Returns whether this parameter is visible in default remote control or device control UIs
      Overrides:
      isHiddenControl in class LXDeviceComponent
      Parameters:
      parameter - Parameter to check
      Returns:
      true if this should be hidden by default
    • setDamping

      public LXEffect setDamping(boolean hasDamping)
      Sets whether this effect uses damping or not
      Parameters:
      hasDamping - If true, damping employed when effect is turned on/off
      Returns:
      this
    • setDampingTime

      public LXEffect setDampingTime(double dampingTimeMs)
      Set the amount of damping time used when this effect is enabled and disabled.
      Parameters:
      dampingTimeMs - Damping time in milliseconds
      Returns:
      this
    • setDampingTime

      protected LXEffect setDampingTime(double dampingTimeEnabledMs, double dampingTimeDisabledMs)
      Set the amount of damping time used when this effect is enabled and disabled.
      Parameters:
      dampingTimeEnabledMs - Damping time in milliseconds when effect enabled
      dampingTimeDisabledMs - Damping time in milliseconds when effect disabled
      Returns:
      this
    • getModelView

      public LXModel getModelView()
      Overrides:
      getModelView in class LXDeviceComponent
    • getPath

      public String getPath()
      Description copied from class: LXComponent
      Accessor for the path of this object. Returns the path this component was registered with. Some subclasses may override this if path structure is dynamic.
      Specified by:
      getPath in interface LXPath
      Overrides:
      getPath in class LXComponent
      Returns:
      path of this component relative to its parent
    • setIndex

      public final LXEffect setIndex(int index)
      Called by the engine to assign index on this effect. Should never be called otherwise.
      Parameters:
      index - Effect index
      Returns:
      this
    • getIndex

      public final int getIndex()
      Gets the index of this effect in the channel FX bus.
      Returns:
      index of this effect in the channel FX bus
    • setBus

      public final LXEffect setBus(LXBus bus)
    • isBusEffect

      public boolean isBusEffect()
    • isPatternEffect

      public boolean isPatternEffect()
    • getBus

      public LXBus getBus()
    • setPattern

      public final LXEffect setPattern(LXPattern pattern)
    • getPattern

      public LXPattern getPattern()
    • isEnabled

      public final boolean isEnabled()
      Returns:
      whether the effect is currently enabled
    • toggle

      public final LXEffect toggle()
      Toggles the effect.
      Returns:
      this
    • enable

      public final LXEffect enable()
      Enables the effect.
      Returns:
      this
    • disable

      public final LXEffect disable()
      Disables the effect.
      Returns:
      this
    • onEnable

      protected void onEnable()
    • onDisable

      protected void onDisable()
    • onLoop

      public final void onLoop(double deltaMs)
      Applies this effect to the current frame
      Overrides:
      onLoop in class LXLayeredComponent
      Parameters:
      deltaMs - Milliseconds since last frame
    • run

      protected abstract void run(double deltaMs, double enabledAmount)
      Implementation of the effect. Subclasses need to override this to implement their functionality.
      Parameters:
      deltaMs - Number of milliseconds elapsed since last invocation
      enabledAmount - The amount of the effect to apply, scaled from 0-1
    • dispose

      public void dispose()
      Description copied from class: LXComponent
      Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally call super.dispose() at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.
      Overrides:
      dispose in class LXDeviceComponent