public abstract class LXModulator extends LXRunnableComponent implements LXComponent.Renamable, LXParameter
LXComponent.Placeholder, LXComponent.Renamable
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
LXSerializable.Utils
runMs, running, trigger
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Modifier | Constructor and Description |
---|---|
protected |
LXModulator(String label)
Utility default constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract double |
computeValue(double deltaMs)
Implementation method to advance the modulator's internal state.
|
String |
getDescription()
Returns a contextual help message explaining the purpose of this parameter to the user, or null if
none is available.
|
LXParameter.Formatter |
getFormatter()
Gets the formatter to be used for printing this parameter's value
|
int |
getIndex()
Returns the ordering index of this modulator in its parent
|
String |
getOscAddress()
Gets the OSC address for this object
|
String |
getOscPath()
Accessor for this component's OSC path relative to its parent.
|
String |
getPath()
Accessor for the path of this object.
|
LXParameter.Polarity |
getPolarity()
Gets the polarity of this parameter.
|
LXParameter.Units |
getUnits()
Gets the unit format that this parameter's value stores.
|
double |
getValue()
Retrieves the current value of the modulator in full precision
|
float |
getValuef()
Retrieves the current value of the modulator in floating point precision.
|
protected void |
onSetValue(double value)
Subclasses may override when actions are necessary on value change.
|
protected void |
run(double deltaMs)
Applies updates to the modulator for the specified number of milliseconds.
|
LXParameter |
setComponent(LXComponent component,
String path)
Sets the component that owns this parameter
|
LXParameter |
setDescription(String description) |
LXModulator |
setFormatter(LXParameter.Formatter formatter) |
LXModulator |
setIndex(int index)
Sets the index of this modulator in its parent list
|
LXModulator |
setPolarity(LXParameter.Polarity polarity) |
LXModulator |
setUnits(LXParameter.Units units) |
LXModulator |
setValue(double value)
Set the modulator to a certain value in its cycle.
|
protected LXModulator |
setValue(double value,
boolean notify) |
protected LXModulator |
updateValue(double value)
Helper for subclasses to update value in situations where it needs to be
recomputed.
|
isRunning, loop, onParameterChanged, onReset, onStart, onStop, reset, start, stop, toggle, trigger
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, dispose, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscLabel, getParameter, getParameters, getParent, handleOscMessage, load, loadParameters, removeParameter, removeParameter, save, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getLabel, isMappable, reset, setMappable
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent
protected LXModulator(String label)
label
- Labelpublic LXModulator setIndex(int index)
index
- Modulator indexpublic int getIndex()
public String getOscPath()
LXComponent
LXComponent.getPath()
, but certain subclasses may modify this
to support different types of OSC paths that aren't required to match the LX
hierarchy.getOscPath
in class LXComponent
public String getOscAddress()
LXComponent
getOscAddress
in class LXComponent
public LXParameter setDescription(String description)
public String getDescription()
LXParameter
getDescription
in interface LXParameter
public LXParameter setComponent(LXComponent component, String path)
LXParameter
setComponent
in interface LXParameter
component
- Componentpath
- Path name for parameterpublic String getPath()
LXComponent
getPath
in interface LXPath
getPath
in class LXComponent
public LXModulator setFormatter(LXParameter.Formatter formatter)
public LXParameter.Formatter getFormatter()
LXParameter
getFormatter
in interface LXParameter
public LXModulator setUnits(LXParameter.Units units)
public LXParameter.Units getUnits()
LXParameter
getUnits
in interface LXParameter
public LXModulator setPolarity(LXParameter.Polarity polarity)
public LXParameter.Polarity getPolarity()
LXParameter
getPolarity
in interface LXParameter
public final double getValue()
getValue
in interface LXParameter
public final float getValuef()
getValuef
in interface LXParameter
public final LXModulator setValue(double value)
setValue
in interface LXParameter
value
- The value to applyprotected final LXModulator setValue(double value, boolean notify)
protected void onSetValue(double value)
value
- New valueprotected final LXModulator updateValue(double value)
value
- Value for modulatorprotected final void run(double deltaMs)
run
in class LXRunnableComponent
deltaMs
- Milliseconds to advance byprotected abstract double computeValue(double deltaMs)
deltaMs
- Number of milliseconds to advance byLX library by Mark C. Slee. © 2012-2020