|
tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation |
Bass class for parameter Modifiers. More...
#include "tracktion_Modifier.h"
Classes | |
| class | ValueFifo |
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. | |
| ~Modifier () override | |
| Destructor. | |
| void | remove () |
| Removes this Modifier from its parent Track. | |
| virtual void | initialise ()=0 |
| Call this once after construction to connect it to the audio graph. | |
| virtual float | getCurrentValue ()=0 |
| Must return the current value of the modifier. | |
| virtual AutomatableParameter::ModifierAssignment * | createAssignment (const juce::ValueTree &)=0 |
| Must return a new ModifierAssignment for a given state. | |
| virtual juce::StringArray | getMidiInputNames () |
| Can return an array of names represeting MIDI inputs. | |
| virtual juce::StringArray | getAudioInputNames () |
| Can return an array of names represeting audio inputs. | |
| virtual ProcessingPosition | getProcessingPosition () |
| Should return the position in the plugin chain that this Modifier should be processed. | |
| virtual void | initialise (double, int) |
| Sub classes should implement this to initialise the Modifier. | |
| virtual void | deinitialise () |
| Sub classes should implement this to deinitialise the Modifier. | |
| virtual void | applyToBuffer (const PluginRenderContext &) |
| Sub classes should implement this to process the Modifier. | |
| bool | baseClassNeedsInitialising () const noexcept |
| Returns true if the Modifier needs initialising. | |
| void | baseClassInitialise (double sampleRate, int blockSizeSamples) |
| Initialises the Modifier. | |
| void | baseClassDeinitialise () |
| Deinitialises the Modifier. | |
| void | baseClassApplyToBuffer (const PluginRenderContext &) |
| Updates internal value history and calls the subclass's applyToBuffer method. | |
| TimePosition | getCurrentTime () const |
| Returns the edit time of the current value. | |
| float | getValueAt (TimeDuration numSecondsBeforeNow) const |
| Returns the value of the at a given time in the past. | |
| std::vector< float > | getValues (TimeDuration numSecondsBeforeNow) const |
| Returns a vector of previous sample values. | |
| double | getSampleRate () const |
| Returns the sample rate the Modifier has been initialised with. | |
| void | selectableAboutToBeDeleted () override |
| Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
Public Member Functions inherited from tracktion::engine::AutomatableEditItem | |
| AutomatableEditItem (Edit &, const juce::ValueTree &) | |
| 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 ¶mID) const |
| void | visitAllAutomatableParams (const std::function< void(AutomatableParameter &)> &visit) const |
| void | deleteParameter (AutomatableParameter *) |
| void | deleteAutomatableParameters () |
| int | indexOfAutomatableParameter (const AutomatableParameter::Ptr &) const |
| AutomatableParameterTree & | getParameterTree () const |
| juce::ReferenceCountedArray< AutomatableParameter > | getFlattenedParameterTree () 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. | |
| void | updateParameterStreams (TimePosition) |
| Updates all the parameter streams to their positions at this time. | |
| void | updateActiveParameters () |
| Iterates all the parameters to find out which ones need to be automated. | |
| void | resetRecordingStatus () |
| Marks the end of an automation recording stream. | |
Public Member Functions inherited from tracktion::engine::EditItem | |
| EditItem (EditItemID, Edit &) | |
| virtual juce::String | getName () const =0 |
Public Member Functions inherited from tracktion::engine::Selectable | |
| virtual juce::String | getSelectableDescription ()=0 |
| Subclasses must return a description of what they are. | |
| 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. | |
| 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 juce::ReferenceCountedObject | |
| void | incReferenceCount () noexcept |
| void | decReferenceCount () noexcept |
| bool | decReferenceCountWithoutDeleting () noexcept |
| int | getReferenceCount () const noexcept |
Public Attributes | |
| juce::ValueTree | state |
| Modifier internal state. | |
| juce::CachedValue< juce::Colour > | colour |
| Colour property. | |
| juce::CachedValue< float > | enabled |
| Enabled property. | |
| AutomatableParameter::Ptr | enabledParam |
| Parameter to change the enabled state. | |
Public Attributes inherited from tracktion::engine::AutomatableEditItem | |
| juce::ValueTree | elementState |
| juce::CachedValue< bool > | remapOnTempoChange |
Public Attributes inherited from tracktion::engine::EditItem | |
| Edit & | edit |
| const EditItemID | itemID |
| Every EditItem has an ID which is unique within the edit. | |
Public Attributes inherited from tracktion::engine::Selectable | |
| WeakRef::Master | masterReference |
Static Public Attributes | |
| static constexpr TimeDuration | maxHistoryTime |
| The max number of seconds of modifier value history that is stored. | |
Protected Member Functions | |
| void | setEditTime (TimePosition newEditTime) |
| Subclasses can call this to update the edit time of the current value. | |
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. | |
| void | restoreChangedParametersFromState () |
| Restores the value of any explicitly set parameters. | |
Protected Member Functions inherited from juce::ReferenceCountedObject | |
| ReferenceCountedObject (const ReferenceCountedObject &) noexcept | |
| ReferenceCountedObject (ReferenceCountedObject &&) noexcept | |
| ReferenceCountedObject & | operator= (const ReferenceCountedObject &) noexcept |
| ReferenceCountedObject & | operator= (ReferenceCountedObject &&) noexcept |
| void | resetReferenceCount () noexcept |
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. | |
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.
Definition at line 34 of file tracktion_Modifier.h.
Definition at line 40 of file tracktion_Modifier.h.
Definition at line 39 of file tracktion_Modifier.h.
|
strong |
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. |
Definition at line 69 of file tracktion_Modifier.h.
| tracktion::engine::Modifier::Modifier | ( | Edit & | e, |
| const juce::ValueTree & | v | ||
| ) |
Creates a Modifier for a given state.
Definition at line 89 of file tracktion_Modifier.cpp.
|
override |
Destructor.
Definition at line 106 of file tracktion_Modifier.cpp.
|
virtual |
Sub classes should implement this to process the Modifier.
Reimplemented in tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
Definition at line 85 of file tracktion_Modifier.h.
| void tracktion::engine::Modifier::baseClassApplyToBuffer | ( | const PluginRenderContext & | prc | ) |
Updates internal value history and calls the subclass's applyToBuffer method.
Definition at line 169 of file tracktion_Modifier.cpp.
| void tracktion::engine::Modifier::baseClassDeinitialise | ( | ) |
Deinitialises the Modifier.
Definition at line 155 of file tracktion_Modifier.cpp.
Initialises the Modifier.
Definition at line 132 of file tracktion_Modifier.cpp.
|
noexcept |
Returns true if the Modifier needs initialising.
Definition at line 89 of file tracktion_Modifier.h.
|
pure virtual |
Must return a new ModifierAssignment for a given state.
Implemented in tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
|
virtual |
Sub classes should implement this to deinitialise the Modifier.
Reimplemented in tracktion::engine::EnvelopeFollowerModifier.
Definition at line 83 of file tracktion_Modifier.h.
|
virtual |
Can return an array of names represeting audio inputs.
Reimplemented in tracktion::engine::EnvelopeFollowerModifier.
Definition at line 66 of file tracktion_Modifier.h.
| TimePosition tracktion::engine::Modifier::getCurrentTime | ( | ) | const |
Returns the edit time of the current value.
Definition at line 189 of file tracktion_Modifier.cpp.
|
pure virtual |
Must return the current value of the modifier.
Implemented in tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
|
virtual |
Can return an array of names represeting MIDI inputs.
Reimplemented in tracktion::engine::MIDITrackerModifier.
Definition at line 63 of file tracktion_Modifier.h.
|
virtual |
Should return the position in the plugin chain that this Modifier should be processed.
Reimplemented in tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
Definition at line 77 of file tracktion_Modifier.h.
| double tracktion::engine::Modifier::getSampleRate | ( | ) | const |
Returns the sample rate the Modifier has been initialised with.
Definition at line 126 of file tracktion_Modifier.h.
| float tracktion::engine::Modifier::getValueAt | ( | TimeDuration | numSecondsBeforeNow | ) | const |
Returns the value of the at a given time in the past.
[[ audio_thread ]]
Definition at line 194 of file tracktion_Modifier.cpp.
| 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 ]]
Definition at line 202 of file tracktion_Modifier.cpp.
|
pure virtual |
Call this once after construction to connect it to the audio graph.
Implemented in tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, tracktion::engine::StepModifier, tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
Sub classes should implement this to initialise the Modifier.
Reimplemented in tracktion::engine::EnvelopeFollowerModifier, tracktion::engine::BreakpointOscillatorModifier, tracktion::engine::LFOModifier, tracktion::engine::MIDITrackerModifier, tracktion::engine::RandomModifier, and tracktion::engine::StepModifier.
Definition at line 81 of file tracktion_Modifier.h.
| void tracktion::engine::Modifier::remove | ( | ) |
Removes this Modifier from its parent Track.
Definition at line 112 of file tracktion_Modifier.cpp.
|
overridevirtual |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point.
Reimplemented from tracktion::engine::Selectable.
Definition at line 222 of file tracktion_Modifier.cpp.
|
protected |
Subclasses can call this to update the edit time of the current value.
Definition at line 133 of file tracktion_Modifier.h.
| juce::CachedValue<juce::Colour> tracktion::engine::Modifier::colour |
Colour property.
Definition at line 120 of file tracktion_Modifier.h.
| juce::CachedValue<float> tracktion::engine::Modifier::enabled |
Enabled property.
Definition at line 122 of file tracktion_Modifier.h.
| AutomatableParameter::Ptr tracktion::engine::Modifier::enabledParam |
Parameter to change the enabled state.
Definition at line 123 of file tracktion_Modifier.h.
|
staticconstexpr |
The max number of seconds of modifier value history that is stored.
Definition at line 99 of file tracktion_Modifier.h.
| juce::ValueTree tracktion::engine::Modifier::state |
Modifier internal state.
Definition at line 119 of file tracktion_Modifier.h.