TracktionEngine
|
#include <tracktion_AutomatableParameter.h>
Classes | |
struct | Listener |
struct | ModifierAssignment |
Connects a modifier source to an AutomatableParameter. More... | |
struct | ModifierSource |
Base class for things that can be used to modify parameters. More... | |
Public Types | |
using | Ptr = juce::ReferenceCountedObjectPtr< AutomatableParameter > |
using | Array = juce::ReferenceCountedArray< AutomatableParameter > |
![]() | |
using | WeakRef = juce::WeakReference< Selectable > |
Public Member Functions | |
AutomatableParameter (const juce::String ¶mID, const juce::String &name, AutomatableEditItem &, juce::NormalisableRange< float > valueRange) | |
~AutomatableParameter () override | |
juce::Range< float > | getValueRange () const |
Plugin * | getPlugin () const |
Engine & | getEngine () const noexcept |
Edit & | getEdit () const noexcept |
Track * | getTrack () const noexcept |
AutomationCurve & | getCurve () const noexcept |
void | attachToCurrentValue (juce::CachedValue< float > &) |
void | attachToCurrentValue (juce::CachedValue< int > &) |
void | attachToCurrentValue (juce::CachedValue< bool > &) |
void | updateFromAttachedValue () |
void | detachFromCurrentValue () |
virtual juce::String | getParameterName () const |
virtual juce::String | getParameterShortName (int) const |
virtual juce::String | getLabel () |
virtual juce::String | getPluginAndParamName () const |
virtual juce::String | getFullName () const |
Selectable * | getOwnerSelectable () const |
Returns the thing that you'd select if you wanted to show this param. | |
EditItemID | getOwnerID () const |
Returns the thing that you'd select if you wanted to show this param. | |
float | getCurrentValue () const noexcept |
float | getCurrentNormalisedValue () const noexcept |
virtual juce::String | valueToString (float value) |
virtual float | stringToValue (const juce::String &s) |
virtual juce::String | getCurrentValueAsString () |
juce::String | getCurrentValueAsStringWithLabel () |
void | setParameter (float value, juce::NotificationType) |
void | setNormalisedParameter (float value, juce::NotificationType) |
void | updateToFollowCurve (TimePosition) |
void | parameterChangeGestureBegin () |
Call to indicate this parameter is about to be changed. | |
void | parameterChangeGestureEnd () |
Call to indicate this parameter has stopped being to be changed. | |
bool | hasAutomationPoints () const noexcept |
ModifierAssignment::Ptr | addModifier (ModifierSource &, float value=1.0f, float offset=0.0f, float curve=0.5f) |
Creates an assignment for a given source. | |
void | removeModifier (ModifierAssignment &) |
Removes an assignment. | |
void | removeModifier (ModifierSource &) |
Removes assignments for a ModifierSource. | |
bool | hasActiveModifierAssignments () const |
Returns true if any ModifierSources are currently in use by assignments. | |
juce::ReferenceCountedArray< ModifierAssignment > | getAssignments () const |
Returns all the current ModifierAssignments. | |
juce::Array< ModifierSource * > | getModifiers () const |
Returns all the current ModifierSources currently in use by assignments. | |
float | getCurrentExplicitValue () const |
This is the value that has been set explicity, either by calling setParameter or the plugin telling us one if its parameters has changed. | |
float | getCurrentBaseValue () const |
This is the current base value of the parameter i.e. | |
float | getCurrentModifierValue () const |
This is the ammount of the modifier that has been applied to the base value to give the current parameter value. | |
bool | isAutomationActive () const |
Returns true if the parameter is being dynamically changed somehow, either through automation or a ModifierAssignment. | |
void | updateStream () |
Forces the parameter to update its automation stream for reading automation. | |
void | updateFromAutomationSources (TimePosition) |
Updates the parameter and modifier values from its current automation sources. | |
virtual bool | isParameterActive () const |
virtual bool | isDiscrete () const |
virtual int | getNumberOfStates () const |
virtual float | getValueForState (int) const |
virtual int | getStateForValue (float) const |
virtual std::optional< float > | getDefaultValue () const |
virtual bool | hasLabels () const |
virtual juce::String | getLabelForValue (float) const |
virtual float | snapToState (float val) const |
virtual juce::StringArray | getAllLabels () const |
bool | isCurrentlyRecording () const |
true if the parameter been moved while in an automation record mode. | |
void | resetRecordingStatus () |
this is called before and after playback or recording. | |
void | midiControllerMoved (float newPosition) |
void | midiControllerPressed () |
void | curveHasChanged () |
juce::String | getSelectableDescription () override |
Subclasses must return a description of what they are. | |
void | addListener (Listener *l) |
void | removeListener (Listener *l) |
![]() | |
Selectable () | |
virtual | ~Selectable () |
virtual void | selectionStatusChanged (bool isNowSelected) |
Can be overridden to tell this object that it has just been selected or deselected. | |
virtual void | changed () |
This should be called to send a change notification to any SelectableListeners that are registered with this object. | |
virtual void | selectableAboutToBeDeleted () |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
void | addListener (SelectableListener *) |
void | removeListener (SelectableListener *) |
void | addSelectableListener (SelectableListener *) |
void | removeSelectableListener (SelectableListener *) |
void | cancelAnyPendingUpdates () |
If changed() has been called, this will cancel any pending async change notificaions. | |
void | deselect () |
void | propertiesChanged () |
void | notifyListenersOfDeletion () |
WeakRef | getWeakRef () |
Public Attributes | |
const juce::String | paramID |
const juce::NormalisableRange< float > | valueRange |
AutomatableEditItem & | automatableEditElement |
std::function< juce::String(float)> | valueToStringFunction |
std::function< float(const juce::String &)> | stringToValueFunction |
const juce::String | paramName |
juce::ValueTree | parentState |
![]() | |
WeakRef::Master | masterReference |
Protected Member Functions | |
AutomationSourceList & | getAutomationSourceList () const |
void | setParameterValue (float value, bool isFollowingCurve) |
void | valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override |
void | valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override |
void | valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override |
void | valueTreeChildOrderChanged (juce::ValueTree &, int, int) override |
void | valueTreeParentChanged (juce::ValueTree &) override |
void | valueTreeRedirected (juce::ValueTree &) override |
virtual void | parameterChanged (float, bool) |
Protected Attributes | |
std::unique_ptr< AttachedValue > | attachedValue |
juce::ListenerList< Listener > | listeners |
SafeSelectable< Edit > | editRef |
Plugin * | plugin = nullptr |
Modifier * | modifierOwner = nullptr |
MacroParameterList * | macroOwner = nullptr |
std::unique_ptr< AutomationCurveSource > | curveSource |
std::atomic< float > | currentValue { 0.0f } |
std::atomic< float > | currentParameterValue { 0.0f } |
std::atomic< float > | currentBaseValue { 0.0f } |
std::atomic< float > | currentModifierValue { 0.0f } |
std::atomic< bool > | isRecording { false } |
bool | updateParametersRecursionCheck = false |
AsyncCaller | parameterChangedCaller { [this] { listeners.call (&Listener::currentValueChanged, *this); } } |
int | gestureCount = 0 |
juce::ValueTree | modifiersState |
std::unique_ptr< AutomationSourceList > | automationSourceList |
Additional Inherited Members | |
![]() | |
static void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. | |
using tracktion::engine::AutomatableParameter::Ptr = juce::ReferenceCountedObjectPtr<AutomatableParameter> |
using tracktion::engine::AutomatableParameter::Array = juce::ReferenceCountedArray<AutomatableParameter> |
tracktion::engine::AutomatableParameter::AutomatableParameter | ( | const juce::String & | paramID, |
const juce::String & | name, | ||
AutomatableEditItem & | , | ||
juce::NormalisableRange< float > | valueRange | ||
) |
|
override |
juce::Range< float > tracktion::engine::AutomatableParameter::getValueRange | ( | ) | const |
References valueRange.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Referenced by hasAutomationPoints().
void tracktion::engine::AutomatableParameter::updateFromAttachedValue | ( | ) |
void tracktion::engine::AutomatableParameter::detachFromCurrentValue | ( | ) |
|
virtual |
Reimplemented in tracktion::engine::MacroParameter, and tracktion::engine::ExternalAutomatableParameter.
References paramName.
|
virtual |
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
References paramName.
|
virtual |
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
|
virtual |
|
virtual |
Selectable * tracktion::engine::AutomatableParameter::getOwnerSelectable | ( | ) | const |
Returns the thing that you'd select if you wanted to show this param.
EditItemID tracktion::engine::AutomatableParameter::getOwnerID | ( | ) | const |
Returns the thing that you'd select if you wanted to show this param.
|
noexcept |
References currentValue.
Referenced by getCurrentValueAsString().
|
noexcept |
References currentValue, and valueRange.
Reimplemented in tracktion::engine::ExternalAutomatableParameter, and tracktion::engine::PluginWetDryAutomatableParam.
References valueToStringFunction.
Referenced by getCurrentValueAsString().
|
virtual |
Reimplemented in tracktion::engine::PluginWetDryAutomatableParam, and tracktion::engine::ExternalAutomatableParameter.
References stringToValueFunction.
|
virtual |
Reimplemented in tracktion::engine::AirWindowsAutomatableParameter, and tracktion::engine::ExternalAutomatableParameter.
References getCurrentValue(), and valueToString().
juce::String tracktion::engine::AutomatableParameter::getCurrentValueAsStringWithLabel | ( | ) |
void tracktion::engine::AutomatableParameter::setNormalisedParameter | ( | float | value, |
juce::NotificationType | |||
) |
void tracktion::engine::AutomatableParameter::updateToFollowCurve | ( | TimePosition | ) |
void tracktion::engine::AutomatableParameter::parameterChangeGestureBegin | ( | ) |
Call to indicate this parameter is about to be changed.
void tracktion::engine::AutomatableParameter::parameterChangeGestureEnd | ( | ) |
Call to indicate this parameter has stopped being to be changed.
|
noexcept |
References getCurve(), and tracktion::engine::AutomationCurve::getNumPoints().
ModifierAssignment::Ptr tracktion::engine::AutomatableParameter::addModifier | ( | ModifierSource & | , |
float | value = 1.0f , |
||
float | offset = 0.0f , |
||
float | curve = 0.5f |
||
) |
Creates an assignment for a given source.
value | the value of the assignment 0 - 1 |
offset | the offset of the assignment 0 - 1 |
curve | the curve of the assignment 0 - 1 where 0.5 is a linear mapping |
void tracktion::engine::AutomatableParameter::removeModifier | ( | ModifierAssignment & | ) |
Removes an assignment.
N.B. the passed in assignment is likely to be deleted after this call.
void tracktion::engine::AutomatableParameter::removeModifier | ( | ModifierSource & | ) |
Removes assignments for a ModifierSource.
bool tracktion::engine::AutomatableParameter::hasActiveModifierAssignments | ( | ) | const |
Returns true if any ModifierSources are currently in use by assignments.
juce::ReferenceCountedArray< ModifierAssignment > tracktion::engine::AutomatableParameter::getAssignments | ( | ) | const |
Returns all the current ModifierAssignments.
juce::Array< ModifierSource * > tracktion::engine::AutomatableParameter::getModifiers | ( | ) | const |
Returns all the current ModifierSources currently in use by assignments.
float tracktion::engine::AutomatableParameter::getCurrentExplicitValue | ( | ) | const |
This is the value that has been set explicity, either by calling setParameter or the plugin telling us one if its parameters has changed.
References currentParameterValue.
float tracktion::engine::AutomatableParameter::getCurrentBaseValue | ( | ) | const |
This is the current base value of the parameter i.e.
either the explicit value or the automation curve value.
References currentBaseValue.
float tracktion::engine::AutomatableParameter::getCurrentModifierValue | ( | ) | const |
This is the ammount of the modifier that has been applied to the base value to give the current parameter value.
References currentModifierValue.
bool tracktion::engine::AutomatableParameter::isAutomationActive | ( | ) | const |
Returns true if the parameter is being dynamically changed somehow, either through automation or a ModifierAssignment.
void tracktion::engine::AutomatableParameter::updateStream | ( | ) |
Forces the parameter to update its automation stream for reading automation.
void tracktion::engine::AutomatableParameter::updateFromAutomationSources | ( | TimePosition | ) |
Updates the parameter and modifier values from its current automation sources.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
|
virtual |
Reimplemented in tracktion::engine::MacroParameter, and tracktion::engine::ExternalAutomatableParameter.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
|
virtual |
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
|
virtual |
Reimplemented in tracktion::engine::ExternalAutomatableParameter.
bool tracktion::engine::AutomatableParameter::isCurrentlyRecording | ( | ) | const |
true if the parameter been moved while in an automation record mode.
References isRecording.
void tracktion::engine::AutomatableParameter::resetRecordingStatus | ( | ) |
this is called before and after playback or recording.
void tracktion::engine::AutomatableParameter::midiControllerPressed | ( | ) |
void tracktion::engine::AutomatableParameter::curveHasChanged | ( | ) |
Referenced by tracktion::engine::AirWindowsAutomatableParameter::refresh().
|
overridevirtual |
Subclasses must return a description of what they are.
Implements tracktion::engine::Selectable.
|
protected |
|
protected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protectedvirtual |
Reimplemented in tracktion::engine::AirWindowsAutomatableParameter, and tracktion::engine::ExternalAutomatableParameter.
const juce::String tracktion::engine::AutomatableParameter::paramID |
Referenced by getCurrentNormalisedValue(), and getValueRange().
AutomatableEditItem& tracktion::engine::AutomatableParameter::automatableEditElement |
std::function<juce::String(float)> tracktion::engine::AutomatableParameter::valueToStringFunction |
Referenced by valueToString().
const juce::String tracktion::engine::AutomatableParameter::paramName |
juce::ValueTree tracktion::engine::AutomatableParameter::parentState |
|
protected |
|
protected |
Referenced by addListener(), tracktion::engine::AirWindowsAutomatableParameter::refresh(), and removeListener().
|
protected |
Referenced by getPlugin().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getCurrentBaseValue().
|
protected |
Referenced by getCurrentModifierValue().
Referenced by isCurrentlyRecording().
|
protected |
|
protected |
|
protected |
|
mutableprotected |