public abstract class LXEffect extends LXDeviceComponent implements LXComponent.Renamable, LXOscComponent
Modifier and Type | Class and Description |
---|---|
static class |
LXEffect.Placeholder
Placeholder pattern for when a class is missing
|
class |
LXEffect.Profiler |
LXLayeredComponent.Buffered
LXComponent.Renamable
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
BooleanParameter |
enabled |
protected LinearEnvelope |
enabledDamped |
protected MutableParameter |
enabledDampingAttack |
protected MutableParameter |
enabledDampingRelease |
protected boolean |
hasDamping |
LXEffect.Profiler |
profiler |
controlsExpanded, crashed, DEVICE_CATEGORY_NAME_SORT, DEVICE_VERSION_UNSPECIFIED, KEY_DEVICE_VERSION, modulation, modulationExpanded
colors, layers, palette
model
modulators
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Modifier and Type | Method and Description |
---|---|
LXEffect |
disable()
Disables the effect.
|
void |
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.
|
LXEffect |
enable()
Enables the effect.
|
LXBus |
getBus() |
int |
getIndex()
Gets the index of this effect in the channel FX bus.
|
String |
getPath()
Accessor for the path of this object.
|
boolean |
isEnabled() |
protected boolean |
isRemoteControl(LXListenableNormalizedParameter parameter)
Subclasses may override this to filter out parameters that should not
be controlled by a remote surface
|
protected void |
onDisable() |
protected void |
onEnable() |
void |
onLoop(double deltaMs)
Applies this effect to the current frame
|
protected abstract void |
run(double deltaMs,
double enabledAmount)
Implementation of the effect.
|
LXEffect |
setBus(LXBus bus) |
LXEffect |
setDamping(boolean hasDamping)
Sets whether this effect uses damping or not
|
LXEffect |
setDampingTime(double dampingTimeMs)
Set the amount of damping time used when this effect
is enabled and disabled.
|
protected LXEffect |
setDampingTime(double dampingTimeEnabledMs,
double dampingTimeDisabledMs)
Set the amount of damping time used when this effect
is enabled and disabled.
|
LXEffect |
setIndex(int index)
Called by the engine to assign index on this effect.
|
LXEffect |
toggle()
Toggles the effect.
|
getCategory, getCrash, getCrashStackTrace, getDeviceVersion, getModulationEngine, getRemoteControls, loop, save, setRemoteControls
addColor, addColor, addLayer, afterLayers, blendColor, blendColor, clearColors, getBuffer, getColor, getColor, getColors, getLayers, removeLayer, setBuffer, setBuffer, setColor, setColor, setColor, setColors, subtractColor
getModel, onModelChanged, setModel
addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulator
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, handleOscMessage, load, loadParameters, onParameterChanged, removeParameter, removeParameter, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOscAddress, handleOscMessage
aftertouchReceived, controlChangeReceived, noteOffReceived, noteOnReceived, pitchBendReceived, programChangeReceived
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
public final BooleanParameter enabled
protected boolean hasDamping
protected final MutableParameter enabledDampingAttack
protected final MutableParameter enabledDampingRelease
protected final LinearEnvelope enabledDamped
public final LXEffect.Profiler profiler
protected LXEffect(LX lx)
public LXEffect setDamping(boolean hasDamping)
hasDamping
- If true, damping employed when effect is turned on/offpublic LXEffect setDampingTime(double dampingTimeMs)
dampingTimeMs
- Damping time in millisecondsprotected LXEffect setDampingTime(double dampingTimeEnabledMs, double dampingTimeDisabledMs)
dampingTimeEnabledMs
- Damping time in milliseconds when effect enableddampingTimeDisabledMs
- Damping time in milliseconds when effect disabledprotected boolean isRemoteControl(LXListenableNormalizedParameter parameter)
LXDeviceComponent
isRemoteControl
in class LXDeviceComponent
parameter
- Parameter to checkpublic String getPath()
LXComponent
getPath
in interface LXPath
getPath
in class LXComponent
public final LXEffect setIndex(int index)
index
- Effect indexpublic final int getIndex()
public LXBus getBus()
public final boolean isEnabled()
public final LXEffect toggle()
public final LXEffect enable()
public final LXEffect disable()
protected void onEnable()
protected void onDisable()
public final void onLoop(double deltaMs)
onLoop
in class LXLayeredComponent
deltaMs
- Milliseconds since last frameprotected abstract void run(double deltaMs, double enabledAmount)
deltaMs
- Number of milliseconds elapsed since last invocationenabledAmount
- The amount of the effect to apply, scaled from 0-1public void dispose()
LXComponent
super.dispose()
at the appropriate
time to perform the basic cleanup, which may need to happen either before or after cleaning
up other objects.dispose
in class LXLayeredComponent
LX library by Mark C. Slee. © 2012-2020