TracktionEngine
Loading...
Searching...
No Matches
engine::MacroParameter Class Reference

A MacroParameter is an AutomatableParameter which is a collection of Mappings. More...

#include <tracktion_MacroParameter.h>

Inheritance diagram for engine::MacroParameter:

Classes

struct  Assignment
 An Assignment between a MacroParameter and an AutomatableParameter. More...

Public Types

using Ptr = juce::ReferenceCountedObjectPtr<MacroParameter>
Public Types inherited from engine::AutomatableParameter
using Ptr = juce::ReferenceCountedObjectPtr<AutomatableParameter>
using Array = juce::ReferenceCountedArray<AutomatableParameter>
Public Types inherited from engine::Selectable
using WeakRef = juce::WeakReference<Selectable>

Public Member Functions

 MacroParameter (AutomatableEditItem &, Edit &, const juce::ValueTree &)
 ~MacroParameter () override
void initialise ()
juce::String getParameterName () const override
std::optional< float > getDefaultValue () const override
Public Member Functions inherited from engine::AutomatableParameter
 AutomatableParameter (const juce::String &paramID, 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 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.
bool removeModifier (ModifierAssignment &)
 Removes an assignment.
bool 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 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 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)
void automationCurveModifierCreated (EditItemID automationCurveModifierID)
void resetRecordingStatus ()
void startRecordingStatus ()
Public Member Functions inherited from engine::Selectable
 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 Member Functions inherited from engine::AutomatableParameter::ModifierSource
 ModifierSource ()=default
virtual ~ModifierSource ()

Public Attributes

Edit & edit
juce::ValueTree state
juce::CachedValue< float > value
juce::CachedValue< float > defaultValue
juce::CachedValue< juce::String > macroName
Public Attributes inherited from engine::AutomatableParameter
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
Public Attributes inherited from engine::Selectable
WeakRef::Master masterReference

Additional Inherited Members

Static Public Member Functions inherited from engine::Selectable
static void initialise ()
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted.
Protected Member Functions inherited from engine::AutomatableParameter
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
Protected Attributes inherited from engine::AutomatableParameter
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< int > numActiveAutomationSources { 0 }
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

Detailed Description

A MacroParameter is an AutomatableParameter which is a collection of Mappings.

A Mapping is a reference to an AutomatableParameter with a range and curve.

Member Typedef Documentation

◆ Ptr

using engine::MacroParameter::Ptr = juce::ReferenceCountedObjectPtr<MacroParameter>

Constructor & Destructor Documentation

◆ MacroParameter()

engine::MacroParameter::MacroParameter ( AutomatableEditItem & ,
Edit & ,
const juce::ValueTree &  )

◆ ~MacroParameter()

engine::MacroParameter::~MacroParameter ( )
override

Member Function Documentation

◆ initialise()

void engine::MacroParameter::initialise ( )

◆ getParameterName()

juce::String engine::MacroParameter::getParameterName ( ) const
overridevirtual

Reimplemented from engine::AutomatableParameter.

References macroName.

◆ getDefaultValue()

std::optional< float > engine::MacroParameter::getDefaultValue ( ) const
overridevirtual

Reimplemented from engine::AutomatableParameter.

Member Data Documentation

◆ edit

Edit& engine::MacroParameter::edit

◆ state

juce::ValueTree engine::MacroParameter::state

◆ value

juce::CachedValue<float> engine::MacroParameter::value

◆ defaultValue

juce::CachedValue<float> engine::MacroParameter::defaultValue

◆ macroName

juce::CachedValue<juce::String> engine::MacroParameter::macroName

Referenced by getParameterName().


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