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.IncrementModeNested 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.DiscreteParameter
maxValue, minValue, optionsChanged, rangeFields inherited from class heronarts.lx.parameter.LXListenableParameter
descriptionFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsConstructorDescriptionCompoundDiscreteParameter(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 targetintdoubleGet 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()intGet the list of modulations applied to this parameterdoubleGets the value of the parameter in a normalized space 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 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, getOption, getOptions, getRange, getRangei, getValueFromNormalized, getValuei, increment, increment, increment, increment, normalizedToValue, setFormatter, setFormatter, setIncrementMode, setIndex, setNormalized, setOptions, setOptions, setOptions, setRange, setRange, setRange, updateValueMethods inherited from class heronarts.lx.parameter.LXListenableNormalizedParameter
getExponent, getNormalizedWithModulation, getOscMode, incrementNormalized, incrementNormalized, isWrappable, setExponent, setOscModeMethods 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, setPolarity, 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, setFormatter, setValueMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, 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.TargetAdds a listener to the modulation target- Specified by:
addModulationListenerin interfaceLXCompoundModulation.Target- Parameters:
listener- Listener- Returns:
- The target
-
removeModulationListener
public final CompoundDiscreteParameter removeModulationListener(LXCompoundModulation.Listener listener) Description copied from interface:LXCompoundModulation.TargetRemoves a listener from the modulation target- Specified by:
removeModulationListenerin interfaceLXCompoundModulation.Target- Parameters:
listener- Listener- Returns:
- The target
-
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
-
setUnits
- Overrides:
setUnitsin classDiscreteParameter
-
setWrappable
- Overrides:
setWrappablein classDiscreteParameter
-
setMappable
Description copied from interface:LXParameterSets whether this parameter should be eligible for MIDI/modulation mapping or not.- Specified by:
setMappablein interfaceLXParameter- Overrides:
setMappablein classDiscreteParameter- Parameters:
mappable- Whether parameter should be available for mapping- Returns:
- this
-
setDescription
- Overrides:
setDescriptionin classDiscreteParameter
-
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
-
getBaseValuei
public int getBaseValuei()- Overrides:
getBaseValueiin classDiscreteParameter
-
getBaseIndex
public int getBaseIndex()- Overrides:
getBaseIndexin classDiscreteParameter
-
getNormalized
public double getNormalized()Description copied from interface:LXNormalizedParameterGets the value of the parameter in a normalized space from 0 to 1- Specified by:
getNormalizedin interfaceLXNormalizedParameter- Overrides:
getNormalizedin classDiscreteParameter- Returns:
- Value of parameter, normalized to range 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
-