Package heronarts.lx.effect
Class LXEffect
- All Implemented Interfaces:
LXComponent.Renamable,LXLoopTask,LXPath,LXPresetComponent,LXSerializable,LXMidiListener,LXModulationContainer,LXOscComponent,LXParameterListener
- Direct Known Subclasses:
BlurEffect,ColorizeEffect,ColorMaskEffect,DynamicsEffect,FreezeEffect,GateEffect,GradientMaskEffect,HueSaturationEffect,ImageMaskEffect,InvertEffect,LinearMaskEffect,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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classPlaceholder pattern for when a class is missingclassNested classes/interfaces inherited from class heronarts.lx.LXDeviceComponent
LXDeviceComponent.MidiNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BooleanParameterprotected final LinearEnvelopeprotected final MutableParameterprotected final MutableParameterprotected booleanfinal BooleanParameterfinal LXEffect.ProfilerFields inherited from class heronarts.lx.LXDeviceComponent
automationChildren, controlsExpanded, controlsExpandedAux, controlsExpandedCue, controlSurfaceSemaphore, crashed, DEVICE_CATEGORY_NAME_SORT, DEVICE_VERSION_UNSPECIFIED, KEY_DEVICE_VERSION, midiFilter, modulation, modulationExpanded, remoteControlsChanged, view, viewPriorityFields inherited from class heronarts.lx.LXLayeredComponent
colors, layers, paletteFields inherited from class heronarts.lx.LXModelComponent
modelFields inherited from class heronarts.lx.LXModulatorComponent
modulatorsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal LXEffectdisable()Disables the effect.voiddispose()Invoked when a component is being removed from the system and will no longer be used at all.final LXEffectenable()Enables the effect.getBus()final intgetIndex()Gets the index of this effect in the channel FX bus.getPath()Accessor for the path of this object.booleanfinal booleanbooleanisHiddenControl(LXParameter parameter) Returns whether this parameter is visible in default remote control or device control UIsbooleanprotected voidprotected voidonEnable()final voidonLoop(double deltaMs) Applies this effect to the current frameprotected abstract voidrun(double deltaMs, double enabledAmount) Implementation of the effect.final LXEffectsetDamping(boolean hasDamping) Sets whether this effect uses damping or notsetDampingTime(double dampingTimeMs) Set the amount of damping time used when this effect is enabled and disabled.protected LXEffectsetDampingTime(double dampingTimeEnabledMs, double dampingTimeDisabledMs) Set the amount of damping time used when this effect is enabled and disabled.final LXEffectsetIndex(int index) Called by the engine to assign index on this effect.final LXEffectsetPattern(LXPattern pattern) final LXEffecttoggle()Toggles the effect.Methods inherited from class heronarts.lx.LXDeviceComponent
addAutomationChild, addControlSurface, clearCustomRemoteControls, getControlSurfaces, getCrash, getCrashStackTrace, getCustomRemoteControls, getDeviceDescription, getDeviceVersion, getModulationEngine, getModulationExpanded, getRemoteControls, isSnapshotControl, load, loop, midiDispatch, removeControlSurface, removeCustomRemoteControl, resetRemoteControls, save, setCustomRemoteControls, setRemoteControlsMethods inherited from class heronarts.lx.LXLayeredComponent
addColor, addColor, addLayer, afterLayers, applyEffects, blendColor, blendColor, clearColors, getBuffer, getColor, getColor, getColors, getLayers, removeLayer, setBuffer, setBuffer, setColor, setColor, setColor, setColors, subtractColorMethods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModelMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulatorMethods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, onParameterChanged, removeParameter, removeParameter, removeParameter, removeParameter, 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.midi.LXMidiListener
aftertouchReceived, controlChangeReceived, midiPanicReceived, noteOffReceived, noteOnReceived, pitchBendReceived, programChangeReceived, sysexReceivedMethods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessageMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendantMethods inherited from interface heronarts.lx.LXPresetComponent
getPresetClass, postProcessPreset
-
Field Details
-
enabled
-
locked
-
hasDamping
protected boolean hasDamping -
enabledDampingAttack
-
enabledDampingRelease
-
enabledDamped
-
profiler
-
-
Constructor Details
-
LXEffect
-
-
Method Details
-
isHiddenControl
Description copied from class:LXDeviceComponentReturns whether this parameter is visible in default remote control or device control UIs- Overrides:
isHiddenControlin classLXDeviceComponent- Parameters:
parameter- Parameter to check- Returns:
- true if this should be hidden by default
-
setDamping
Sets whether this effect uses damping or not- Parameters:
hasDamping- If true, damping employed when effect is turned on/off- Returns:
- this
-
setDampingTime
Set the amount of damping time used when this effect is enabled and disabled.- Parameters:
dampingTimeMs- Damping time in milliseconds- Returns:
- this
-
setDampingTime
Set the amount of damping time used when this effect is enabled and disabled.- Parameters:
dampingTimeEnabledMs- Damping time in milliseconds when effect enableddampingTimeDisabledMs- Damping time in milliseconds when effect disabled- Returns:
- this
-
getModelView
- Overrides:
getModelViewin classLXDeviceComponent
-
getPath
Description copied from class:LXComponentAccessor 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:
getPathin interfaceLXPath- Overrides:
getPathin classLXComponent- Returns:
- path of this component relative to its parent
-
setIndex
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
-
isBusEffect
public boolean isBusEffect() -
isPatternEffect
public boolean isPatternEffect() -
getContainer
-
getBus
-
setPattern
-
getPattern
-
isEnabled
public final boolean isEnabled()- Returns:
- whether the effect is currently enabled
-
toggle
Toggles the effect.- Returns:
- this
-
enable
Enables the effect.- Returns:
- this
-
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:
onLoopin classLXLayeredComponent- 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 invocationenabledAmount- The amount of the effect to apply, scaled from 0-1
-
dispose
public void dispose()Description copied from class:LXComponentInvoked 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 callsuper.dispose()at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.- Overrides:
disposein classLXDeviceComponent
-