public class Accelerator extends LXModulator
LXComponent.Placeholder, LXComponent.Renamable
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
LXSerializable.Utils
runMs, running, trigger
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Constructor and Description |
---|
Accelerator(double initValue,
double initVelocity,
double acceleration) |
Accelerator(double initValue,
double initVelocity,
LXParameter acceleration) |
Accelerator(double initValue,
LXParameter initVelocity,
LXParameter acceleration) |
Accelerator(String label,
double initValue,
double initVelocity,
double acceleration) |
Accelerator(String label,
double initValue,
double initVelocity,
LXParameter acceleration) |
Accelerator(String label,
double initValue,
LXParameter initVelocity,
LXParameter acceleration) |
Modifier and Type | Method and Description |
---|---|
protected double |
computeValue(double deltaMs)
Implementation method to advance the modulator's internal state.
|
double |
getAcceleration() |
float |
getAccelerationf() |
double |
getVelocity() |
float |
getVelocityf() |
protected void |
onReset()
Optional subclass method when reset happens.
|
Accelerator |
setAcceleration(double acceleration) |
Accelerator |
setAcceleration(LXParameter acceleration)
Updates the acceleration.
|
Accelerator |
setInitVelocity(double initVelocity)
Sets the initial velocity to a fixed value
|
Accelerator |
setInitVelocity(LXParameter initVelocity)
Sets initial velocity of the Accelerator
|
Accelerator |
setSpeed(double initVelocity,
double acceleration) |
Accelerator |
setSpeed(LXParameter initVelocity,
LXParameter acceleration)
Sets both the velocity and acceleration of the modulator.
|
Accelerator |
setVelocity(double velocity)
Updates the current velocity.
|
getDescription, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, getValuef, onSetValue, run, setComponent, setDescription, setFormatter, setIndex, setPolarity, setUnits, setValue, setValue, updateValue
isRunning, loop, onParameterChanged, onStart, onStop, reset, start, stop, toggle, trigger
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, dispose, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscLabel, getParameter, getParameters, getParent, handleOscMessage, load, loadParameters, removeParameter, removeParameter, save, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getLabel, isMappable, reset, setMappable
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent
public Accelerator(double initValue, double initVelocity, double acceleration)
public Accelerator(double initValue, double initVelocity, LXParameter acceleration)
public Accelerator(double initValue, LXParameter initVelocity, LXParameter acceleration)
public Accelerator(String label, double initValue, double initVelocity, double acceleration)
public Accelerator(String label, double initValue, double initVelocity, LXParameter acceleration)
public Accelerator(String label, double initValue, LXParameter initVelocity, LXParameter acceleration)
protected void onReset()
LXRunnableComponent
onReset
in class LXRunnableComponent
public double getVelocity()
public float getVelocityf()
public double getAcceleration()
public float getAccelerationf()
public Accelerator setSpeed(double initVelocity, double acceleration)
public Accelerator setSpeed(LXParameter initVelocity, LXParameter acceleration)
initVelocity
- New velocityacceleration
- Accelerationpublic Accelerator setVelocity(double velocity)
velocity
- New velocitypublic Accelerator setInitVelocity(double initVelocity)
initVelocity
- Fixed initial velocity valuepublic Accelerator setInitVelocity(LXParameter initVelocity)
initVelocity
- Initial velocity parameterpublic Accelerator setAcceleration(double acceleration)
public Accelerator setAcceleration(LXParameter acceleration)
acceleration
- New accelerationprotected double computeValue(double deltaMs)
LXModulator
computeValue
in class LXModulator
deltaMs
- Number of milliseconds to advance byLX library by Mark C. Slee. © 2012-2020