Video display and composing engine for JUCE
Loading...
Searching...
No Matches
ParameterAutomation Class Referenceabstract

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 ()
 
ControllableBasegetControllable ()
 

Protected Attributes

ControllableBasecontrollable
 
bool gestureInProgress = false
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ParameterAutomation()

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.

Member Function Documentation

◆ getName()

virtual juce::String getName ( ) const
pure virtual

◆ getParameterIndex()

virtual int getParameterIndex ( ) const
pure virtual

◆ getNumSteps()

virtual int getNumSteps ( ) const
pure virtual

◆ getAllValueStrings()

virtual juce::StringArray getAllValueStrings ( ) const
pure virtual

◆ updateProcessor()

virtual void updateProcessor ( double  pts)
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.

◆ setValue() [1/2]

◆ setValue() [2/2]

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().

◆ addKeyframe()

void addKeyframe ( double  pts,
double  value 
)

◆ setRealValue() [1/2]

virtual void setRealValue ( double  value)
pure virtual

Set the value from an unnormalised value.

Implemented in AudioParameterAutomation, and VideoParameterAutomation.

◆ setRealValue() [2/2]

virtual void setRealValue ( double  pts,
double  value 
)
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.

◆ addRealKeyframe()

virtual void addRealKeyframe ( double  pts,
double  value 
)
pure virtual

This will add a keyframe with an unnormalised value at the given position.

Implemented in AudioParameterAutomation, and VideoParameterAutomation.

◆ setKeyframe()

void setKeyframe ( int  index,
double  pts,
double  value 
)

◆ deleteKeyframe()

◆ getValueForTime()

◆ getRealValueForTime()

virtual double getRealValueForTime ( double  pts) const
pure virtual

Returns the unnormalised value at a certain time.

Implemented in AudioParameterAutomation, and VideoParameterAutomation.

◆ getValue()

double getValue ( ) const

◆ getPreviousKeyframeTime()

double getPreviousKeyframeTime ( double  time) const

◆ getNextKeyframeTime()

double getNextKeyframeTime ( double  time) const

◆ startAutomationGesture()

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().

◆ finishAutomationGesture()

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().

◆ getKeyframes()

const std::map< double, double > & getKeyframes ( ) const

Give reading access to the keyframes.

◆ setKeyframes()

void setKeyframes ( std::map< double, double >  keys)

◆ setKeyframesWithRealValues()

virtual void setKeyframesWithRealValues ( std::map< double, double >  keys)
pure virtual

Replace all keyframes specifying the value in unnormalised values.

Implemented in AudioParameterAutomation, and VideoParameterAutomation.

◆ getText()

virtual juce::String getText ( float  normalisedValue,
int  numDigits = 2 
) const
pure virtual

◆ getValueForText()

virtual double getValueForText ( const juce::String &  text) const
pure virtual

◆ getParameterProperties()

virtual juce::NamedValueSet & getParameterProperties ( )
pure virtual

◆ isVideoParameter()

virtual bool isVideoParameter ( )
virtual

Reimplemented in VideoParameterAutomation.

◆ isAudioParameter()

virtual bool isAudioParameter ( )
virtual

Reimplemented in AudioParameterAutomation.

◆ getControllable()

ControllableBase & getControllable ( )

Member Data Documentation

◆ controllable

◆ gestureInProgress


The documentation for this class was generated from the following files: