public abstract class LXListenableParameter extends Object implements LXParameter
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
Modifier and Type | Field and Description |
---|---|
protected String |
description |
Modifier | Constructor and Description |
---|---|
protected |
LXListenableParameter() |
protected |
LXListenableParameter(double value) |
protected |
LXListenableParameter(String label) |
protected |
LXListenableParameter(String label,
double value) |
Modifier and Type | Method and Description |
---|---|
LXListenableParameter |
addListener(LXParameterListener listener) |
LXListenableParameter |
bang()
Manually notify all listeners of this parameter's current value.
|
void |
dispose()
Invoked when the parameter is done being used and none of its resources
are needed anymore.
|
String |
getDescription()
Returns a contextual help message explaining the purpose of this parameter to the user, or null if
none is available.
|
LXParameter.Formatter |
getFormatter()
Gets the formatter to be used for printing this parameter's value
|
String |
getLabel()
Gets the label for this parameter
|
LXComponent |
getParent()
Returns the component that this object belongs to
|
String |
getPath()
Returns the immediate path of this component, relative to its parent
|
LXParameter.Polarity |
getPolarity()
Gets the polarity of this parameter.
|
LXParameter.Units |
getUnits()
Gets the unit format that this parameter's value stores.
|
double |
getValue()
Retrieves the value of the parameter
|
float |
getValuef()
Utility helper function to get the value of the parameter as a float.
|
LXParameter |
incrementValue(double amount) |
boolean |
isMappable()
Whether this parameter should be eligible for mapping via MIDI or
modulation control.
|
LXListenableParameter |
removeListener(LXParameterListener listener) |
LXParameter |
reset()
A method to reset the value of the parameter, if a default is available.
|
LXParameter |
reset(double value)
Resets the value of the parameter, giving it a new default.
|
LXParameter |
setComponent(LXComponent component,
String path)
Sets the component that owns this parameter
|
LXListenableParameter |
setDescription(String description) |
LXListenableParameter |
setFormatter(LXParameter.Formatter formatter) |
LXListenableParameter |
setMappable(boolean mappable)
Sets whether this parameter should be eligible for MIDI/modulation mapping
or not.
|
LXListenableParameter |
setPolarity(LXParameter.Polarity polarity) |
LXListenableParameter |
setUnits(LXParameter.Units units) |
LXParameter |
setValue(double value)
Sets the value of the parameter.
|
protected abstract double |
updateValue(double value)
Invoked when the value has changed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
protected String description
protected LXListenableParameter()
protected LXListenableParameter(String label)
protected LXListenableParameter(double value)
protected LXListenableParameter(String label, double value)
public LXParameter.Formatter getFormatter()
LXParameter
getFormatter
in interface LXParameter
public LXListenableParameter setFormatter(LXParameter.Formatter formatter)
public LXParameter.Units getUnits()
LXParameter
getUnits
in interface LXParameter
public LXListenableParameter setUnits(LXParameter.Units units)
public LXParameter.Polarity getPolarity()
LXParameter
getPolarity
in interface LXParameter
public LXListenableParameter setPolarity(LXParameter.Polarity polarity)
public LXListenableParameter addListener(LXParameterListener listener)
public final LXListenableParameter removeListener(LXParameterListener listener)
public LXListenableParameter setDescription(String description)
public String getDescription()
LXParameter
getDescription
in interface LXParameter
public LXParameter setComponent(LXComponent component, String path)
LXParameter
setComponent
in interface LXParameter
component
- Componentpath
- Path name for parameterpublic LXComponent getParent()
LXPath
public String getPath()
LXPath
public void dispose()
LXParameter
dispose
in interface LXParameter
public LXParameter reset()
LXParameter
reset
in interface LXParameter
public LXParameter reset(double value)
value
- New default valuepublic final LXParameter incrementValue(double amount)
public final LXParameter setValue(double value)
LXParameter
setValue
in interface LXParameter
value
- The valuepublic double getValue()
LXParameter
getValue
in interface LXParameter
public final float getValuef()
LXParameter
getValuef
in interface LXParameter
public String getLabel()
LXParameter
getLabel
in interface LXPath
getLabel
in interface LXParameter
public LXListenableParameter bang()
public LXListenableParameter setMappable(boolean mappable)
LXParameter
setMappable
in interface LXParameter
mappable
- Whether parameter should be available for mappingpublic boolean isMappable()
LXParameter
isMappable
in interface LXParameter
true
if mappable, false if otherwiseprotected abstract double updateValue(double value)
value
- New valueLX library by Mark C. Slee. © 2012-2020