Package heronarts.lx.parameter
Class NormalizedParameter
java.lang.Object
heronarts.lx.parameter.NormalizedParameter
- All Implemented Interfaces:
LXPath
,LXNormalizedParameter
,LXParameter
Simple normalized parameter which is not listenable.
-
Nested Class Summary
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 interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ConstructorDescriptionNormalizedParameter
(String label) NormalizedParameter
(String label, double value) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Invoked when the parameter is done being used and none of its resources are needed anymore.Returns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.double
Gets the exponent used for scaling this parameter across its normalized range.Gets the formatter to be used for printing this parameter's valuegetLabel()
Gets the label for this parameterdouble
Gets the value of the parameter in a normalized space from 0 to 1float
Gets the value of the parameter in a normalized space as a floatReturns the component that this object belongs togetPath()
Returns the immediate path of this component, relative to its parentGets the polarity of this parameter.getUnits()
Gets the unit format that this parameter's value stores.double
getValue()
Retrieves the value of the parameterboolean
Whether this parameter should be eligible for mapping via MIDI or modulation control.reset()
A method to reset the value of the parameter, if a default is available.setComponent
(LXComponent component, String path) Sets the component that owns this parametersetDescription
(String description) setFormatter
(LXParameter.Formatter formatter) Sets the formatter used for printing this parameter's valuesetNormalized
(double value) Sets the value or the parameter in normalized space from 0 to 1setValue
(double value) Sets the value of the parameter.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, getOscMode, getValueFromNormalized, isWrappable
Methods inherited from interface heronarts.lx.parameter.LXParameter
getBaseValue, getBaseValuef, getParentParameter, getValuef, setMappable
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Constructor Details
-
NormalizedParameter
-
NormalizedParameter
-
-
Method Details
-
setComponent
Description copied from interface:LXParameter
Sets the component that owns this parameter- Specified by:
setComponent
in interfaceLXParameter
- Parameters:
component
- Componentpath
- Path name for parameter- Returns:
- this
-
getParent
Description copied from interface:LXPath
Returns the component that this object belongs to -
getPath
Description copied from interface:LXPath
Returns the immediate path of this component, relative to its parent -
setDescription
-
getDescription
Description copied from interface:LXPath
Returns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.- Specified by:
getDescription
in interfaceLXPath
- Returns:
- Contextual help string explaining purpose of the element
-
getFormatter
Description copied from interface:LXParameter
Gets the formatter to be used for printing this parameter's value- Specified by:
getFormatter
in interfaceLXParameter
- Returns:
- Formatter
-
setFormatter
Description copied from interface:LXParameter
Sets the formatter used for printing this parameter's value- Specified by:
setFormatter
in interfaceLXParameter
- Parameters:
formatter
- Formatter- Returns:
- The parameter
-
getUnits
Description copied from interface:LXParameter
Gets the unit format that this parameter's value stores.- Specified by:
getUnits
in interfaceLXParameter
- Returns:
- Units
-
getPolarity
Description copied from interface:LXParameter
Gets the polarity of this parameter.- Specified by:
getPolarity
in interfaceLXParameter
- Returns:
- polarity of this parameter
-
dispose
public void dispose()Description copied from interface:LXParameter
Invoked when the parameter is done being used and none of its resources are needed anymore.- Specified by:
dispose
in interfaceLXParameter
-
reset
Description copied from interface:LXParameter
A method to reset the value of the parameter, if a default is available. Not necessarily defined for all parameters, may be ignored.- Specified by:
reset
in interfaceLXParameter
- Returns:
- this
-
setValue
Description copied from interface:LXParameter
Sets the value of the parameter.- Specified by:
setValue
in interfaceLXParameter
- Parameters:
value
- The value- Returns:
- this
-
getValue
public double getValue()Description copied from interface:LXParameter
Retrieves the value of the parameter- Specified by:
getValue
in interfaceLXParameter
- Returns:
- Parameter value
-
getLabel
Description copied from interface:LXParameter
Gets the label for this parameter- Specified by:
getLabel
in interfaceLXParameter
- Specified by:
getLabel
in interfaceLXPath
- Returns:
- Label of parameter
-
setNormalized
Description copied from interface:LXNormalizedParameter
Sets the value or the parameter in normalized space from 0 to 1- Specified by:
setNormalized
in interfaceLXNormalizedParameter
- Parameters:
value
- The normalized value, from 0 to 1- Returns:
- this, for method chaining
-
getNormalized
public double getNormalized()Description copied from interface:LXNormalizedParameter
Gets the value of the parameter in a normalized space from 0 to 1- Specified by:
getNormalized
in interfaceLXNormalizedParameter
- Returns:
- Value of parameter, normalized to range from 0 to 1
-
getNormalizedf
public float getNormalizedf()Description copied from interface:LXNormalizedParameter
Gets the value of the parameter in a normalized space as a float- Specified by:
getNormalizedf
in interfaceLXNormalizedParameter
- Returns:
- Normalized value of parameter, in range from 0 to 1
-
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
-
isMappable
public boolean isMappable()Description copied from interface:LXParameter
Whether this parameter should be eligible for mapping via MIDI or modulation control.- Specified by:
isMappable
in interfaceLXParameter
- Returns:
true
if mappable, false if otherwise
-