TracktionEngine
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
tracktion::engine::Modifier Struct Referenceabstract

Bass class for parameter Modifiers. More...

Inheritance diagram for tracktion::engine::Modifier:

Public Types

enum class  ProcessingPosition { none , preFX , postFX }
 Determines the position in the FX chain where the modifier should be processed. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< Modifier >
 
using Array = juce::ReferenceCountedArray< Modifier >
 
- Public Types inherited from tracktion::engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 

Public Member Functions

 Modifier (Edit &, const juce::ValueTree &)
 Creates a Modifier for a given state. More...
 
 ~Modifier ()
 Destructor. More...
 
void remove ()
 Removes this Modifier from its parent Track. More...
 
virtual void initialise ()=0
 Call this once after construction to connect it to the audio graph. More...
 
virtual float getCurrentValue ()=0
 Must return the current value of the modifier. More...
 
virtual AutomatableParameter::ModifierAssignmentcreateAssignment (const juce::ValueTree &)=0
 Must return a new ModifierAssignment for a given state. More...
 
virtual juce::StringArray getMidiInputNames ()
 Can return an array of names represeting MIDI inputs. More...
 
virtual juce::StringArray getAudioInputNames ()
 Can return an array of names represeting audio inputs. More...
 
virtual ProcessingPosition getProcessingPosition ()
 Should return the position in the plugin chain that this Modifier should be processed. More...
 
virtual void initialise (double, int)
 Sub classes should implement this to initialise the Modifier. More...
 
virtual void deinitialise ()
 Sub classes should implement this to deinitialise the Modifier. More...
 
virtual void applyToBuffer (const PluginRenderContext &)
 Sub classes should implement this to process the Modifier. More...
 
bool baseClassNeedsInitialising () const noexcept
 Returns true if the Modifier needs initialising. More...
 
void baseClassInitialise (double sampleRate, int blockSizeSamples)
 Initialises the Modifier. More...
 
void baseClassDeinitialise ()
 Deinitialises the Modifier. More...
 
void baseClassApplyToBuffer (const PluginRenderContext &)
 Updates internal value history and calls the subclass's applyToBuffer method. More...
 
TimePosition getCurrentTime () const
 Returns the edit time of the current value. More...
 
float getValueAt (TimeDuration numSecondsBeforeNow) const
 Returns the value of the at a given time in the past. More...
 
std::vector< float > getValues (TimeDuration numSecondsBeforeNow) const
 Returns a vector of previous sample values. More...
 
double getSampleRate () const
 Returns the sample rate the Modifier has been initialised with. More...
 
- Public Member Functions inherited from tracktion::engine::AutomatableEditItem
 AutomatableEditItem (Edit &, const juce::ValueTree &)
 
virtual ~AutomatableEditItem ()
 
virtual void flushPluginStateToValueTree ()
 
virtual void restorePluginStateFromValueTree (const juce::ValueTree &)
 
juce::Array< AutomatableParameter * > getAutomatableParameters () const
 
int getNumAutomatableParameters () const
 
AutomatableParameter::Ptr getAutomatableParameter (int index) const
 
AutomatableParameter::Ptr getAutomatableParameterByID (const juce::String &paramID) const
 
void deleteParameter (AutomatableParameter *)
 
void deleteAutomatableParameters ()
 
int indexOfAutomatableParameter (const AutomatableParameter::Ptr &) const
 
AutomatableParameterTreegetParameterTree () const
 
juce::ReferenceCountedArray< AutomatableParametergetFlattenedParameterTree () const
 
void addParameterListChangeListener (ParameterListChangeListener *)
 
void removeParameterListChangeListener (ParameterListChangeListener *)
 
bool isAutomationNeeded () const noexcept
 
void setAutomatableParamPosition (TimePosition)
 
bool isBeingActivelyPlayed () const
 
virtual void updateAutomatableParamPosition (TimePosition)
 Updates all the auto params to their positions at this time. More...
 
void updateParameterStreams (TimePosition)
 Updates all the parameter streams to their positions at this time. More...
 
void updateActiveParameters ()
 Iterates all the parameters to find out which ones need to be automated. More...
 
void resetRecordingStatus ()
 Marks the end of an automation recording stream. More...
 
- Public Member Functions inherited from tracktion::engine::EditItem
 EditItem (EditItemID, Edit &)
 
virtual ~EditItem ()=default
 
virtual juce::String getName () const =0
 
- Public Member Functions inherited from tracktion::engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual juce::String getSelectableDescription ()=0
 Subclasses must return a description of what they are. More...
 
virtual void selectionStatusChanged (bool isNowSelected)
 Can be overridden to tell this object that it has just been selected or deselected. More...
 
virtual void changed ()
 This should be called to send a change notification to any SelectableListeners that are registered with this object. More...
 
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. More...
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions. More...
 
void deselect ()
 
void propertiesChanged ()
 
void notifyListenersOfDeletion ()
 
WeakRef getWeakRef ()
 
- Public Member Functions inherited from tracktion::engine::AutomatableParameter::ModifierSource
 ModifierSource ()=default
 
virtual ~ModifierSource ()
 

Public Attributes

juce::ValueTree state
 Modifier internal state. More...
 
juce::CachedValue< juce::Colour > colour
 Colour property. More...
 
juce::CachedValue< float > enabled
 Enabled property. More...
 
AutomatableParameter::Ptr enabledParam
 Parameter to change the enabled state. More...
 
- Public Attributes inherited from tracktion::engine::AutomatableEditItem
juce::ValueTree elementState
 
juce::CachedValue< bool > remapOnTempoChange
 
- Public Attributes inherited from tracktion::engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit. More...
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Static Public Attributes

static constexpr TimeDuration maxHistoryTime = TimeDuration::fromSeconds (3.0)
 The max number of seconds of modifier value history that is stored. More...
 

Protected Member Functions

void setEditTime (TimePosition newEditTime)
 Subclasses can call this to update the edit time of the current value. More...
 
- Protected Member Functions inherited from tracktion::engine::AutomatableEditItem
virtual void buildParameterTree () const
 
void updateLastPlaybackTime ()
 
void clearParameterList ()
 
void addAutomatableParameter (const AutomatableParameter::Ptr &)
 
void rebuildParameterTree ()
 
void saveChangedParametersToState ()
 Saves the explicit value of any parameters that have deviated to the state. More...
 
void restoreChangedParametersFromState ()
 Restores the value of any explicitly set parameters. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tracktion::engine::Selectable
static void initialise ()
 
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted. More...
 

Detailed Description

Bass class for parameter Modifiers.

Modifiers are capable of controlling automatable parameters by making assignments from Modifiers to AutomatableParameters. They work similarly to AutomationCurves but can be all kinds of modification such as LFOs, random and envelopes.

See also
LFOModifier, EnvelopeFollowerModifier, RandomModifier

Member Typedef Documentation

◆ Ptr

using tracktion::engine::Modifier::Ptr = juce::ReferenceCountedObjectPtr<Modifier>

◆ Array

using tracktion::engine::Modifier::Array = juce::ReferenceCountedArray<Modifier>

Member Enumeration Documentation

◆ ProcessingPosition

Determines the position in the FX chain where the modifier should be processed.

Enumerator
none 

The Modifier needs no processing.

preFX 

The Modifier is processed before the plugn chain.

postFX 

The Modifier is processed after the plugn chain.

Constructor & Destructor Documentation

◆ Modifier()

tracktion::engine::Modifier::Modifier ( Edit ,
const juce::ValueTree &   
)

Creates a Modifier for a given state.

◆ ~Modifier()

tracktion::engine::Modifier::~Modifier ( )

Destructor.

Member Function Documentation

◆ remove()

void tracktion::engine::Modifier::remove ( )

Removes this Modifier from its parent Track.

◆ initialise() [1/2]

virtual void tracktion::engine::Modifier::initialise ( )
pure virtual

◆ getCurrentValue()

virtual float tracktion::engine::Modifier::getCurrentValue ( )
pure virtual

◆ createAssignment()

virtual AutomatableParameter::ModifierAssignment* tracktion::engine::Modifier::createAssignment ( const juce::ValueTree &  )
pure virtual

◆ getMidiInputNames()

virtual juce::StringArray tracktion::engine::Modifier::getMidiInputNames ( )
virtual

Can return an array of names represeting MIDI inputs.

Reimplemented in tracktion::engine::MIDITrackerModifier.

◆ getAudioInputNames()

virtual juce::StringArray tracktion::engine::Modifier::getAudioInputNames ( )
virtual

Can return an array of names represeting audio inputs.

Reimplemented in tracktion::engine::EnvelopeFollowerModifier.

◆ getProcessingPosition()

virtual ProcessingPosition tracktion::engine::Modifier::getProcessingPosition ( )
virtual

◆ initialise() [2/2]

virtual void tracktion::engine::Modifier::initialise ( double  ,
int   
)
virtual

Sub classes should implement this to initialise the Modifier.

Reimplemented in tracktion::engine::EnvelopeFollowerModifier.

◆ deinitialise()

virtual void tracktion::engine::Modifier::deinitialise ( )
virtual

Sub classes should implement this to deinitialise the Modifier.

Reimplemented in tracktion::engine::EnvelopeFollowerModifier.

◆ applyToBuffer()

virtual void tracktion::engine::Modifier::applyToBuffer ( const PluginRenderContext )
virtual

◆ baseClassNeedsInitialising()

bool tracktion::engine::Modifier::baseClassNeedsInitialising ( ) const
noexcept

Returns true if the Modifier needs initialising.

◆ baseClassInitialise()

void tracktion::engine::Modifier::baseClassInitialise ( double  sampleRate,
int  blockSizeSamples 
)

Initialises the Modifier.

◆ baseClassDeinitialise()

void tracktion::engine::Modifier::baseClassDeinitialise ( )

Deinitialises the Modifier.

◆ baseClassApplyToBuffer()

void tracktion::engine::Modifier::baseClassApplyToBuffer ( const PluginRenderContext )

Updates internal value history and calls the subclass's applyToBuffer method.

◆ getCurrentTime()

TimePosition tracktion::engine::Modifier::getCurrentTime ( ) const

Returns the edit time of the current value.

See also
getCurrentValue, getValueAt [[ audio_thread ]]

◆ getValueAt()

float tracktion::engine::Modifier::getValueAt ( TimeDuration  numSecondsBeforeNow) const

Returns the value of the at a given time in the past.

[[ audio_thread ]]

◆ getValues()

std::vector<float> tracktion::engine::Modifier::getValues ( TimeDuration  numSecondsBeforeNow) const

Returns a vector of previous sample values.

N.B. you might not get back as many seconds as requested with numSecondsBeforeNow. [[ message_thread ]]

◆ getSampleRate()

double tracktion::engine::Modifier::getSampleRate ( ) const

Returns the sample rate the Modifier has been initialised with.

◆ setEditTime()

void tracktion::engine::Modifier::setEditTime ( TimePosition  newEditTime)
protected

Subclasses can call this to update the edit time of the current value.

Member Data Documentation

◆ maxHistoryTime

constexpr TimeDuration tracktion::engine::Modifier::maxHistoryTime = TimeDuration::fromSeconds (3.0)
staticconstexpr

The max number of seconds of modifier value history that is stored.

◆ state

juce::ValueTree tracktion::engine::Modifier::state

Modifier internal state.

◆ colour

juce::CachedValue<juce::Colour> tracktion::engine::Modifier::colour

Colour property.

◆ enabled

juce::CachedValue<float> tracktion::engine::Modifier::enabled

Enabled property.

◆ enabledParam

AutomatableParameter::Ptr tracktion::engine::Modifier::enabledParam

Parameter to change the enabled state.


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