Package heronarts.lx.parameter
Class CompoundDiscreteParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
heronarts.lx.parameter.LXListenableNormalizedParameter
heronarts.lx.parameter.DiscreteParameter
heronarts.lx.parameter.CompoundDiscreteParameter
- All Implemented Interfaces:
LXPath
,LXCompoundModulation.Target
,LXNormalizedParameter
,LXParameter
- Direct Known Subclasses:
CompoundObjectParameter
public class CompoundDiscreteParameter
extends DiscreteParameter
implements LXCompoundModulation.Target
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.parameter.DiscreteParameter
DiscreteParameter.IncrementMode
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.DiscreteParameter
maxValue, minValue, optionsChanged, range
Fields inherited from class heronarts.lx.parameter.LXListenableParameter
description
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ConstructorDescriptionCompoundDiscreteParameter
(String label, int range) Parameter with values from [0, range-1], 0 by defaultCompoundDiscreteParameter
(String label, int min, int max) Parameter with values from [min, max-1], min by defaultCompoundDiscreteParameter
(String label, int value, int min, int max) Parameter with values from [min, max-1], value by defaultCompoundDiscreteParameter
(String label, String[] options) Parameter with set of String label valuesCompoundDiscreteParameter
(String label, String[] options, int value) Parameter with set of String label values, and a default -
Method Summary
Modifier and TypeMethodDescriptionaddModulation
(LXCompoundModulation modulation) Adds a modulation to this parameterAdds a listener to the modulation targetint
double
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()int
Get the list of modulations applied to this parameterdouble
Gets the value of the parameter in a normalized space from 0 to 1double
getValue()
Retrieves the value of the parameterremoveModulation
(LXCompoundModulation modulation) Removes a modulation from this parameterRemoves a listener from the modulation targetsetDescription
(String description) setMappable
(boolean mappable) Sets whether this parameter should be eligible for MIDI/modulation mapping or not.setUnits
(LXParameter.Units units) setWrappable
(boolean wrappable) Methods inherited from class heronarts.lx.parameter.DiscreteParameter
decrement, decrement, decrement, decrement, getBaseOption, getIncrementMode, getIndex, getMaxValue, getMinValue, getOption, getOptions, getRange, getValueFromNormalized, getValuei, increment, increment, increment, increment, normalizedToValue, setIncrementMode, setIndex, setNormalized, setOptions, setOptions, setRange, setRange, updateValue
Methods inherited from class heronarts.lx.parameter.LXListenableNormalizedParameter
getExponent, getNormalizedWithModulation, getOscMode, incrementNormalized, incrementNormalized, isWrappable, setExponent, setOscMode
Methods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, incrementValue, isDefault, isMappable, removeListener, reset, reset, setComponent, setFormatter, setPolarity, 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, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
modulations
-
-
Constructor Details
-
CompoundDiscreteParameter
Parameter with values from [0, range-1], 0 by default- Parameters:
label
- Name of parameterrange
- range of values
-
CompoundDiscreteParameter
Parameter with values from [min, max-1], min by default- Parameters:
label
- Labelmin
- Minimum valuemax
- Maximum value is 1 less than this
-
CompoundDiscreteParameter
Parameter with values from [min, max-1], value by default- Parameters:
label
- Labelvalue
- Default valuemin
- Minimum value (inclusive)max
- Maximum value (exclusive)
-
CompoundDiscreteParameter
Parameter with set of String label values- Parameters:
label
- Labeloptions
- Values
-
CompoundDiscreteParameter
Parameter with set of String label values, and a default- Parameters:
label
- Labeloptions
- Valuesvalue
- Default index
-
-
Method Details
-
addModulationListener
public final CompoundDiscreteParameter addModulationListener(LXCompoundModulation.Listener listener) 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
public final CompoundDiscreteParameter removeModulationListener(LXCompoundModulation.Listener listener) 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
-
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
-
setUnits
- Overrides:
setUnits
in classDiscreteParameter
-
setWrappable
- Overrides:
setWrappable
in classDiscreteParameter
-
setMappable
Description copied from interface:LXParameter
Sets whether this parameter should be eligible for MIDI/modulation mapping or not.- Specified by:
setMappable
in interfaceLXParameter
- Overrides:
setMappable
in classDiscreteParameter
- Parameters:
mappable
- Whether parameter should be available for mapping- Returns:
- this
-
setDescription
- Overrides:
setDescription
in classDiscreteParameter
-
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
-
getBaseValuei
public int getBaseValuei()- Overrides:
getBaseValuei
in classDiscreteParameter
-
getBaseIndex
public int getBaseIndex()- Overrides:
getBaseIndex
in classDiscreteParameter
-
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
- Overrides:
getNormalized
in classDiscreteParameter
- Returns:
- Value of parameter, normalized to range 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
-