This class allows storing and playing back automation values. More...
#include <foleys_ParameterAutomation.h>
Inheritance diagram for ParameterAutomation:Public Member Functions | |
| ParameterAutomation (ControllableBase &, double defaultValue, const juce::ValueTree &state, juce::UndoManager *) | |
| The ParameterAutomation holds the information about keyframes / automation points and takes care of updating the processor values. | |
| virtual juce::String | getName () const =0 |
| virtual int | getParameterIndex () const =0 |
| virtual int | getNumSteps () const =0 |
| virtual juce::StringArray | getAllValueStrings () const =0 |
| virtual void | updateProcessor (double pts)=0 |
| This updates the parameter to match the state at a certain timepoint. | |
| void | setValue (double value) |
| This sets the value of the parameter. | |
| void | setValue (double pts, double value) |
| Set the value at a certain timepoint. | |
| void | addKeyframe (double pts, double value) |
| This will add a keyframe at the given position. | |
| virtual void | setRealValue (double value)=0 |
| Set the value from an unnormalised value. | |
| virtual void | setRealValue (double pts, double value)=0 |
| Set the value from an unnormalised value at a certain timepoint. | |
| virtual void | addRealKeyframe (double pts, double value)=0 |
| This will add a keyframe with an unnormalised value at the given position. | |
| void | setKeyframe (int index, double pts, double value) |
| void | deleteKeyframe (int index) |
| double | getValueForTime (double pts) const |
| Returns the normalised value at a certain time. | |
| virtual double | getRealValueForTime (double pts) const =0 |
| Returns the unnormalised value at a certain time. | |
| double | getValue () const |
| double | getPreviousKeyframeTime (double time) const |
| double | getNextKeyframeTime (double time) const |
| void | startAutomationGesture () |
| Call this before calling setValue commands (e.g. | |
| void | finishAutomationGesture () |
| Call this to finish user interaction to give back controll to the playing automation. | |
| const std::map< double, double > & | getKeyframes () const |
| Give reading access to the keyframes. | |
| void | setKeyframes (std::map< double, double > keys) |
| Replace all keyframes. | |
| virtual void | setKeyframesWithRealValues (std::map< double, double > keys)=0 |
| Replace all keyframes specifying the value in unnormalised values. | |
| virtual juce::String | getText (float normalisedValue, int numDigits=2) const =0 |
| virtual double | getValueForText (const juce::String &text) const =0 |
| virtual juce::NamedValueSet & | getParameterProperties ()=0 |
| virtual bool | isVideoParameter () |
| virtual bool | isAudioParameter () |
| ControllableBase & | getControllable () |
Protected Attributes | |
| ControllableBase & | controllable |
| bool | gestureInProgress = false |
This class allows storing and playing back automation values.
It is used in the ClipDescriptor's ProcessorController. Using an Adapter it can handle VideoProcessors as well as AudioProcessors.
| ParameterAutomation | ( | ControllableBase & | controllerToUse, |
| double | defaultValue, | ||
| const juce::ValueTree & | state, | ||
| juce::UndoManager * | undo | ||
| ) |
The ParameterAutomation holds the information about keyframes / automation points and takes care of updating the processor values.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
This updates the parameter to match the state at a certain timepoint.
Call this before you process a block.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
| void setValue | ( | double | value | ) |
This sets the value of the parameter.
Note as soon as there is a keyframe on the automation, this has no more effect.
References ParameterAutomation::controllable, and ControllableBase::notifyParameterAutomationChange().
Referenced by AudioParameterAutomation::parameterValueChanged(), AudioParameterAutomation::setRealValue(), VideoParameterAutomation::setRealValue(), AudioParameterAutomation::setRealValue(), VideoParameterAutomation::setRealValue(), ParameterAutomation::setValue(), and VideoParameterAutomation::valueChanged().
| void setValue | ( | double | pts, |
| double | value | ||
| ) |
Set the value at a certain timepoint.
If there was no keyframe recorded yet, this will just call setValue. If there was a keyframe anywhere on the automation, this will add a keyframe at this position.
References ParameterAutomation::addKeyframe(), ParameterAutomation::gestureInProgress, and ParameterAutomation::setValue().
| void addKeyframe | ( | double | pts, |
| double | value | ||
| ) |
This will add a keyframe at the given position.
References ParameterAutomation::controllable, and ControllableBase::notifyParameterAutomationChange().
Referenced by AudioParameterAutomation::addRealKeyframe(), VideoParameterAutomation::addRealKeyframe(), and ParameterAutomation::setValue().
|
pure virtual |
Set the value from an unnormalised value.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Set the value from an unnormalised value at a certain timepoint.
If there was no keyframe recorded yet, this will just call setValue. If there was a keyframe anywhere on the automation, this will add a keyframe at this position.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
This will add a keyframe with an unnormalised value at the given position.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
| void setKeyframe | ( | int | index, |
| double | pts, | ||
| double | value | ||
| ) |
| void deleteKeyframe | ( | int | index | ) |
| double getValueForTime | ( | double | pts | ) | const |
Returns the normalised value at a certain time.
References ParameterAutomation::getValue().
Referenced by AudioParameterAutomation::getRealValueForTime(), VideoParameterAutomation::getRealValueForTime(), AudioParameterAutomation::updateProcessor(), and VideoParameterAutomation::updateProcessor().
|
pure virtual |
Returns the unnormalised value at a certain time.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
| double getValue | ( | ) | const |
Referenced by ParameterAutomation::getValueForTime().
| double getPreviousKeyframeTime | ( | double | time | ) | const |
| double getNextKeyframeTime | ( | double | time | ) | const |
| void startAutomationGesture | ( | ) |
Call this before calling setValue commands (e.g.
from the processor editor) to avoid conflicting information from the currently playing automation
References ParameterAutomation::gestureInProgress.
Referenced by VideoParameterAutomation::gestureStarted(), and AudioParameterAutomation::parameterGestureChanged().
| void finishAutomationGesture | ( | ) |
Call this to finish user interaction to give back controll to the playing automation.
References ParameterAutomation::gestureInProgress.
Referenced by VideoParameterAutomation::gestureFinished(), and AudioParameterAutomation::parameterGestureChanged().
| const std::map< double, double > & getKeyframes | ( | ) | const |
Give reading access to the keyframes.
| void setKeyframes | ( | std::map< double, double > | keys | ) |
Replace all keyframes.
Referenced by AudioParameterAutomation::setKeyframesWithRealValues(), and VideoParameterAutomation::setKeyframesWithRealValues().
|
pure virtual |
Replace all keyframes specifying the value in unnormalised values.
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
pure virtual |
Implemented in AudioParameterAutomation, and VideoParameterAutomation.
|
virtual |
Reimplemented in VideoParameterAutomation.
|
virtual |
Reimplemented in AudioParameterAutomation.
| ControllableBase & getControllable | ( | ) |
References ParameterAutomation::controllable.
|
protected |
|
protected |