Package heronarts.lx.parameter
Class LXListenableNormalizedParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
heronarts.lx.parameter.LXListenableNormalizedParameter
- All Implemented Interfaces:
LXPath
,LXNormalizedParameter
,LXParameter
- Direct Known Subclasses:
BooleanParameter
,BoundedParameter
,DiscreteParameter
public abstract class LXListenableNormalizedParameter
extends LXListenableParameter
implements LXNormalizedParameter
A parameter that can be listened to and has normalized values. This is needed
for things like UI components such as a slider or a knob, which need to be
able to listen for changes to the parameter value and to update it in a
normalized range of values.
-
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 class heronarts.lx.parameter.LXListenableParameter
description
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ModifierConstructorDescriptionprotected
LXListenableNormalizedParameter
(String label, double value) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the exponent used for scaling this parameter across its normalized range.protected double
getNormalizedWithModulation
(double normalized, List<? extends LXCompoundModulation> modulations) incrementNormalized
(double amount) incrementNormalized
(double amount, boolean wrap) boolean
Whether this parameter should wrap when incremented or decremented at the extent of its range.setExponent
(double exponent) setOscMode
(LXNormalizedParameter.OscMode oscMode) setUnits
(LXParameter.Units units) setWrappable
(boolean wrappable) Methods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, getValue, incrementValue, isDefault, isMappable, removeListener, reset, reset, setComponent, setDescription, setFormatter, setMappable, setPolarity, setValue, setValue, updateValue
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, getNormalized, getNormalizedf, getValueFromNormalized, setNormalized
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setFormatter, setMappable, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Constructor Details
-
LXListenableNormalizedParameter
-
-
Method Details
-
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
-
setUnits
- Overrides:
setUnits
in classLXListenableParameter
-
setOscMode
-
getOscMode
- Specified by:
getOscMode
in interfaceLXNormalizedParameter
-
setWrappable
-
isWrappable
public boolean isWrappable()Description copied from interface:LXNormalizedParameter
Whether this parameter should wrap when incremented or decremented at the extent of its range.- Specified by:
isWrappable
in interfaceLXNormalizedParameter
- Returns:
true
if wrappable, false if otherwise
-
getNormalizedWithModulation
protected double getNormalizedWithModulation(double normalized, List<? extends LXCompoundModulation> modulations) -
incrementNormalized
-
incrementNormalized
-