Package heronarts.lx.parameter
Class CompoundParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
heronarts.lx.parameter.LXListenableNormalizedParameter
heronarts.lx.parameter.BoundedParameter
heronarts.lx.parameter.CompoundParameter
- All Implemented Interfaces:
LXPath
,LXCompoundModulation.Target
,LXNormalizedParameter
,LXParameter
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.parameter.BoundedParameter
BoundedParameter.NormalizationCurve, BoundedParameter.Range
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.BoundedParameter
range
Fields inherited from class heronarts.lx.parameter.LXListenableParameter
description
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ConstructorDescriptionCompoundParameter
(LXListenableParameter underlying, double v0, double v1) Creates a CompoundParameter which limits the value of an underlying MutableParameter to a given range.CompoundParameter
(String label) Labeled parameter with value of 0 and range of 0-1CompoundParameter
(String label, double value) A bounded parameter with label and value, initial value of 0 and a range of 0-1CompoundParameter
(String label, double value, double max) A bounded parameter with an initial value, and range from 0 to maxCompoundParameter
(String label, double value, double v0, double v1) A bounded parameter with initial value and range from v0 to v1. -
Method Summary
Modifier and TypeMethodDescriptionaddModulation
(LXCompoundModulation modulation) Adds a modulation to this parameterfinal CompoundParameter
Adds a listener to the modulation targetdouble
Get the base parameter value, for modulated parameters this may differ from getValue()double
Get the base parameter value, for modulated parameters this may differ from getValue()Get the list of modulations applied to this parameterdouble
Gets a normalized value of the parameter from 0 to 1double
getValue()
Retrieves the value of the parameterremoveModulation
(LXCompoundModulation modulation) Removes a modulation from this parameterfinal CompoundParameter
Removes a listener from the modulation targetsetDescription
(String description) setDetents
(double... detents) setDetentsNormalized
(double... detents) setExponent
(double exponent) setPolarity
(LXParameter.Polarity polarity) setUnits
(LXParameter.Units units) setWrappable
(boolean wrappable) Methods inherited from class heronarts.lx.parameter.BoundedParameter
getNormalizationCurve, getNormalizedf, getRange, getValueFromNormalized, incrementDetentTicks, incrementDetentTicks, incrementNormalized, incrementValue, incrementValue, isDetentEnabled, nextDetent, nextDetent, prevDetent, prevDetent, reset, setDetents, setDetentsEnabled, setMappable, setNormalized, updateValue
Methods inherited from class heronarts.lx.parameter.LXListenableNormalizedParameter
getExponent, getNormalizedWithModulation, getOscMode, incrementNormalized, isWrappable, setOscMode
Methods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, isDefault, isMappable, removeListener, reset, setComponent, setFormatter, setValue, setValue
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
getBaseNormalizedf, getExponent, getNormalizedf, getOscMode, getValueFromNormalized, isWrappable, setNormalized
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValuef, isMappable, reset, setComponent, setFormatter, setMappable, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
modulations
-
-
Constructor Details
-
CompoundParameter
Labeled parameter with value of 0 and range of 0-1- Parameters:
label
- Label for parameter
-
CompoundParameter
A bounded parameter with label and value, initial value of 0 and a range of 0-1- Parameters:
label
- Labelvalue
- value
-
CompoundParameter
A bounded parameter with an initial value, and range from 0 to max- Parameters:
label
- Labelvalue
- valuemax
- Maximum value
-
CompoundParameter
A bounded parameter with initial value and 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
- Labelvalue
- Initial valuev0
- Start of rangev1
- End of range
-
CompoundParameter
Creates a CompoundParameter which limits the value of an underlying MutableParameter to a given range. Changes to the CompoundParameter are forwarded to the MutableParameter, and vice versa. If the MutableParameter is set to a value outside the specified bounds, this BoundedParmaeter will ignore the update and the values will be inconsistent. The typical use of this mode is to create a parameter suitable for limited-range UI control of a parameter, typically a MutableParameter.- Parameters:
underlying
- The underlying parameterv0
- Beginning of rangev1
- End of range
-
-
Method Details
-
addModulationListener
Description copied from interface:LXCompoundModulation.Target
Adds a listener to the modulation target- Specified by:
addModulationListener
in interfaceLXCompoundModulation.Target
- Parameters:
listener
- Listener- Returns:
- The target
-
removeModulationListener
Description copied from interface:LXCompoundModulation.Target
Removes a listener from the modulation target- Specified by:
removeModulationListener
in interfaceLXCompoundModulation.Target
- Parameters:
listener
- Listener- Returns:
- The target
-
setWrappable
- Overrides:
setWrappable
in classBoundedParameter
-
setUnits
- Overrides:
setUnits
in classBoundedParameter
-
setPolarity
- Overrides:
setPolarity
in classBoundedParameter
-
setExponent
- Overrides:
setExponent
in classBoundedParameter
-
setNormalizationCurve
- Overrides:
setNormalizationCurve
in classBoundedParameter
-
setDescription
- Overrides:
setDescription
in classBoundedParameter
-
setDetents
- Overrides:
setDetents
in classBoundedParameter
-
setDetentsNormalized
- Overrides:
setDetentsNormalized
in classBoundedParameter
-
getModulations
Description copied from interface:LXCompoundModulation.Target
Get the list of modulations applied to this parameter- Specified by:
getModulations
in interfaceLXCompoundModulation.Target
- Returns:
- List of modulations applied to this parameter
-
addModulation
Adds a modulation to this parameter- Specified by:
addModulation
in interfaceLXCompoundModulation.Target
- Parameters:
modulation
- Modulation mapping to add to this parameter- Returns:
- this
-
removeModulation
Removes a modulation from this parameter- Specified by:
removeModulation
in interfaceLXCompoundModulation.Target
- Parameters:
modulation
- Modulation mapping to remove- Returns:
- this
-
getBaseValue
public double getBaseValue()Description copied from interface:LXParameter
Get the base parameter value, for modulated parameters this may differ from getValue()- Specified by:
getBaseValue
in interfaceLXParameter
- Returns:
- Base parameter value
-
getBaseNormalized
public double getBaseNormalized()Description copied from interface:LXNormalizedParameter
Get the base parameter value, for modulated parameters this may differ from getValue()- Specified by:
getBaseNormalized
in interfaceLXNormalizedParameter
- Returns:
- Base normalized parameter value
-
getNormalized
public double getNormalized()Description copied from class:BoundedParameter
Gets a normalized value of the parameter from 0 to 1- Specified by:
getNormalized
in interfaceLXNormalizedParameter
- Overrides:
getNormalized
in classBoundedParameter
- Returns:
- Normalized value, from 0 to 1
-
getValue
public double getValue()Description copied from interface:LXParameter
Retrieves the value of the parameter- Specified by:
getValue
in interfaceLXParameter
- Overrides:
getValue
in classLXListenableParameter
- Returns:
- Parameter value
-