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.RangeNested 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.BoundedParameter
rangeFields inherited from class heronarts.lx.parameter.LXListenableParameter
descriptionFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsConstructorDescriptionCompoundParameter(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 CompoundParameterAdds a listener to the modulation targetdoubleGet the base parameter value, for modulated parameters this may differ from getValue()doubleGet the base parameter value, for modulated parameters this may differ from getValue()Get the list of modulations applied to this parameterdoubleGets a normalized value of the parameter from 0 to 1Gets a list of modulation applied to this parameter for use on UI threaddoublegetValue()Retrieves the value of the parameterremoveModulation(LXCompoundModulation modulation) Removes a modulation from this parameterfinal CompoundParameterRemoves a listener from the modulation targetsetDescription(String description) setDetents(double... detents) setDetentsNormalized(double... detents) setExponent(double exponent) setFormatter(LXParameter.Formatter formatter) Sets the formatter used for printing this parameter's valuesetOscMode(LXNormalizedParameter.OscMode oscMode) 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, updateValueMethods inherited from class heronarts.lx.parameter.LXListenableNormalizedParameter
getExponent, getNormalizedWithModulation, getOscMode, incrementNormalized, isWrappableMethods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, isDefault, isMappable, removeListener, reset, setComponent, setValue, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalizedf, getExponent, getNormalizedf, getOscMode, getValueFromNormalized, isWrappable, setNormalizedMethods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValuef, isMappable, reset, setComponent, setMappable, setValueMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, 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.TargetAdds a listener to the modulation target- Specified by:
addModulationListenerin interfaceLXCompoundModulation.Target- Parameters:
listener- Listener- Returns:
- The target
-
removeModulationListener
Description copied from interface:LXCompoundModulation.TargetRemoves a listener from the modulation target- Specified by:
removeModulationListenerin interfaceLXCompoundModulation.Target- Parameters:
listener- Listener- Returns:
- The target
-
setWrappable
- Overrides:
setWrappablein classBoundedParameter
-
setFormatter
Description copied from interface:LXParameterSets the formatter used for printing this parameter's value- Specified by:
setFormatterin interfaceLXParameter- Overrides:
setFormatterin classBoundedParameter- Parameters:
formatter- Formatter- Returns:
- The parameter
-
setUnits
- Overrides:
setUnitsin classBoundedParameter
-
setPolarity
- Overrides:
setPolarityin classBoundedParameter
-
setExponent
- Overrides:
setExponentin classBoundedParameter
-
setNormalizationCurve
- Overrides:
setNormalizationCurvein classBoundedParameter
-
setDescription
- Overrides:
setDescriptionin classBoundedParameter
-
setOscMode
- Overrides:
setOscModein classBoundedParameter
-
setDetents
- Overrides:
setDetentsin classBoundedParameter
-
setDetentsNormalized
- Overrides:
setDetentsNormalizedin classBoundedParameter
-
getModulations
Description copied from interface:LXCompoundModulation.TargetGet the list of modulations applied to this parameter- Specified by:
getModulationsin interfaceLXCompoundModulation.Target- Returns:
- List of modulations applied to this parameter
-
getUIThreadModulations
Description copied from interface:LXCompoundModulation.TargetGets a list of modulation applied to this parameter for use on UI thread- Specified by:
getUIThreadModulationsin interfaceLXCompoundModulation.Target- Returns:
- List of modulations applied to this parameter for use on UI thread
-
addModulation
Adds a modulation to this parameter- Specified by:
addModulationin interfaceLXCompoundModulation.Target- Parameters:
modulation- Modulation mapping to add to this parameter- Returns:
- this
-
removeModulation
Removes a modulation from this parameter- Specified by:
removeModulationin interfaceLXCompoundModulation.Target- Parameters:
modulation- Modulation mapping to remove- Returns:
- this
-
getBaseValue
public double getBaseValue()Description copied from interface:LXParameterGet the base parameter value, for modulated parameters this may differ from getValue()- Specified by:
getBaseValuein interfaceLXParameter- Returns:
- Base parameter value
-
getBaseNormalized
public double getBaseNormalized()Description copied from interface:LXNormalizedParameterGet the base parameter value, for modulated parameters this may differ from getValue()- Specified by:
getBaseNormalizedin interfaceLXNormalizedParameter- Returns:
- Base normalized parameter value
-
getNormalized
public double getNormalized()Description copied from class:BoundedParameterGets a normalized value of the parameter from 0 to 1- Specified by:
getNormalizedin interfaceLXNormalizedParameter- Overrides:
getNormalizedin classBoundedParameter- Returns:
- Normalized value, from 0 to 1
-
getValue
public double getValue()Description copied from interface:LXParameterRetrieves the value of the parameter- Specified by:
getValuein interfaceLXParameter- Overrides:
getValuein classLXListenableParameter- Returns:
- Parameter value
-