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.Interface
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscMode
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units
-
Field Summary
Fields inherited from class heronarts.lx.parameter.FunctionalParameter
description
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ModifierConstructorDescriptionBoundedFunctionalParameter
(String label) A bounded functional parameter with a range of 0-1protected
BoundedFunctionalParameter
(String label, double max) A bounded functional parameter with a range of 0 to maxprotected
BoundedFunctionalParameter
(String label, double v0, double v1) A bounded functional parameter with a range from v0 to v1. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract double
Retrieves the raw value of the parameter, subclass must implement.double
Gets the exponent used for scaling this parameter across its normalized range.double
Gets a normalized value of the parameter from 0 to 1final double
getValue()
Retrieves the value of the parameter, subclass must implement.final float
Utility 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, dispose, getDescription, getFormatter, getLabel, getParent, getPath, getPolarity, getUnits, reset, setComponent, setFormatter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getNormalizedf, getOscMode, getValueFromNormalized, isWrappable
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, isMappable, reset, setComponent, setFormatter, setMappable
Methods inherited from interface heronarts.lx.LXPath
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:
setDescription
in classFunctionalParameter
-
setValue
Not supported for this parameter type unless subclass overrides.- Specified by:
setValue
in interfaceLXParameter
- Overrides:
setValue
in 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:FunctionalParameter
Retrieves the value of the parameter, subclass must implement.- Specified by:
getValue
in interfaceLXParameter
- Specified by:
getValue
in classFunctionalParameter
- Returns:
- Parameter value
-
getValuef
public final float getValuef()Description copied from interface:LXParameter
Utility helper function to get the value of the parameter as a float.- Specified by:
getValuef
in interfaceLXParameter
- Returns:
- Parameter value as float
-
setNormalized
Sets the value of parameter using normal 0-1- Specified by:
setNormalized
in 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:
getNormalized
in interfaceLXNormalizedParameter
- Returns:
- Normalized value, from 0 to 1
-
setExponent
-
getExponent
public double getExponent()Description copied from interface:LXNormalizedParameter
Gets the exponent used for scaling this parameter across its normalized range. Default is 1 which means linear scaling.- Specified by:
getExponent
in interfaceLXNormalizedParameter
- Returns:
- scaling exponent
-
setNormalizationCurve
-
getNormalizationCurve
-