Package heronarts.lx.parameter
Class BoundedFunctionalParameter
java.lang.Object
heronarts.lx.parameter.FunctionalParameter
heronarts.lx.parameter.BoundedFunctionalParameter
- All Implemented Interfaces:
LXPath,LXNormalizedParameter,LXParameter
public abstract class BoundedFunctionalParameter
extends FunctionalParameter
implements LXNormalizedParameter
A FunctionalParameter that is bounded by a range. This enables the calculation
of normalized values which enables mapping with the modulation engine.
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.parameter.FunctionalParameter
FunctionalParameter.InterfaceNested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscModeNested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units -
Field Summary
FieldsFields inherited from class heronarts.lx.parameter.FunctionalParameter
descriptionFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsModifierConstructorDescriptionBoundedFunctionalParameter(String label) A bounded functional parameter with a range of 0-1protectedBoundedFunctionalParameter(String label, double max) A bounded functional parameter with a range of 0 to maxprotectedBoundedFunctionalParameter(String label, double v0, double v1) A bounded functional parameter with a range from v0 to v1. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract doubleRetrieves the raw value of the parameter, subclass must implement.doubleGets the exponent used for scaling this parameter across its normalized range.doubleGets a normalized value of the parameter from 0 to 1final doublegetValue()Retrieves the value of the parameter, subclass must implement.final floatUtility helper function to get the value of the parameter as a float.setDescription(String description) setExponent(double exponent) setNormalized(double normalized) Sets the value of parameter using normal 0-1setValue(double value) Not supported for this parameter type unless subclass overrides.Methods inherited from class heronarts.lx.parameter.FunctionalParameter
create, create, dispose, getDescription, getFormatter, getLabel, getParent, getPath, getPolarity, getUnits, reset, setComponent, setFormatterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getNormalizedf, getOscMode, getValueFromNormalized, isWrappableMethods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, isMappable, reset, setComponent, setFormatter, setMappableMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
range
Range of the parameter
-
-
Constructor Details
-
BoundedFunctionalParameter
A bounded functional parameter with a range of 0-1- Parameters:
label- Label for parameter
-
BoundedFunctionalParameter
A bounded functional parameter with a range of 0 to max- Parameters:
label- Label for parametermax- Maximum value
-
BoundedFunctionalParameter
A bounded functional parameter with a range from v0 to v1. Note that it is not necessary for v0 to be less than v1, if it is desired for the knob's value to progress negatively.- Parameters:
label- Label for parameterv0- Start of rangev1- End of range
-
-
Method Details
-
setDescription
- Overrides:
setDescriptionin classFunctionalParameter
-
setValue
Not supported for this parameter type unless subclass overrides.- Specified by:
setValuein interfaceLXParameter- Overrides:
setValuein classFunctionalParameter- Parameters:
value- The value- Returns:
- this
-
computeValue
protected abstract double computeValue()Retrieves the raw value of the parameter, subclass must implement. This value will be constrained to the range.- Returns:
- Parameter value
-
getValue
public final double getValue()Description copied from class:FunctionalParameterRetrieves the value of the parameter, subclass must implement.- Specified by:
getValuein interfaceLXParameter- Specified by:
getValuein classFunctionalParameter- Returns:
- Parameter value
-
getValuef
public final float getValuef()Description copied from interface:LXParameterUtility helper function to get the value of the parameter as a float.- Specified by:
getValuefin interfaceLXParameter- Returns:
- Parameter value as float
-
setNormalized
Sets the value of parameter using normal 0-1- Specified by:
setNormalizedin interfaceLXNormalizedParameter- Parameters:
normalized- Value from 0-1 through the parameter range- Returns:
- this, for method chaining
-
getNormalized
public double getNormalized()Gets a normalized value of the parameter from 0 to 1- Specified by:
getNormalizedin interfaceLXNormalizedParameter- Returns:
- Normalized value, from 0 to 1
-
setExponent
-
getExponent
public double getExponent()Description copied from interface:LXNormalizedParameterGets the exponent used for scaling this parameter across its normalized range. Default is 1 which means linear scaling.- Specified by:
getExponentin interfaceLXNormalizedParameter- Returns:
- scaling exponent
-
setNormalizationCurve
-
getNormalizationCurve
-