TracktionEngine
|
#include <tracktion_ExternalPlugin.h>
Public Types | |
using | Ptr = juce::ReferenceCountedObjectPtr< ExternalPlugin > |
![]() | |
enum class | Type { allPlugins , folderTrackPlugins , effectPlugins } |
using | Ptr = juce::ReferenceCountedObjectPtr< Plugin > |
using | Array = juce::ReferenceCountedArray< Plugin > |
![]() | |
using | WeakRef = juce::WeakReference< Selectable > |
Public Member Functions | |
ExternalPlugin (PluginCreationInfo) | |
~ExternalPlugin () override | |
juce::String | getIdentifierString () override |
A unique string to idenitify plugin independant of install location. | |
void | selectableAboutToBeDeleted () override |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
void | processingChanged () override |
void | initialiseFully () override |
Gives the plugin a chance to do extra initialisation when it's been added to an edit. | |
void | forceFullReinitialise () |
juce::String | getLoadError () |
Returns an error message if the plugin failed to load. | |
bool | isInitialisingAsync () const |
Returns true if the plugin has started initialising but not completed yet. | |
void | flushPluginStateToValueTree () override |
void | flushBusesLayoutToValueTree () |
void | restorePluginStateFromValueTree (const juce::ValueTree &) override |
void | getPluginStateFromTree (juce::MemoryBlock &) |
void | updateFromMirroredPluginIfNeeded (Plugin &) override |
void | initialise (const PluginInitialisationInfo &) override |
Gives the plugin a chance to set itself up before being played. | |
void | deinitialise () override |
Called after play stops to release resources. | |
void | reset () override |
Should reset synth voices, tails, clear delay buffers, etc. | |
void | midiPanic () override |
Tells the plugin to turn off any playing notes, if applicable. | |
void | setEnabled (bool enabled) override |
Enable/disable the plugin. | |
juce::Array< Exportable::ReferencedItem > | getReferencedItems () override |
void | reassignReferencedItem (const ReferencedItem &, ProjectItemID newID, double newStartTime) override |
void | applyToBuffer (const PluginRenderContext &) override |
Process the next block of data. | |
bool | producesAudioWhenNoAudioInput () override |
int | getNumOutputChannelsGivenInputs (int numInputs) override |
This must return the number of output channels that the plugin will produce, given a number of input channels. | |
void | getChannelNames (juce::StringArray *ins, juce::StringArray *outs) override |
bool | isVST () const noexcept |
bool | isVST3 () const noexcept |
bool | isAU () const noexcept |
juce::String | getName () const override |
The name of the type, e.g. | |
juce::String | getVendor () override |
juce::String | getTooltip () override |
default returns the name, others can return special stuff if needed | |
juce::String | getPluginType () override |
bool | isSynth () override |
bool | takesMidiInput () override |
bool | takesAudioInput () override |
bool | isMissing () override |
for things like VSTs where the DLL is missing. | |
bool | isDisabled () override |
Plugins can be disabled to avoid them crashing Edits. | |
double | getLatencySeconds () override |
bool | noTail () override |
double | getTailLength () const override |
void | trackPropertiesChanged () override |
Track name or colour has changed. | |
juce::AudioProcessor * | getWrappedAudioProcessor () const override |
void | deleteFromParent () override |
Attempts to delete this plugin, whether it's a master plugin, track plugin, etc. | |
juce::String | getSelectableDescription () override |
Subclasses must return a description of what they are. | |
juce::File | getFile () const |
juce::String | getPluginUID () const |
const char * | getDebugName () const noexcept |
int | getNumInputs () const |
int | getNumOutputs () const |
bool | setBusesLayout (juce::AudioProcessor::BusesLayout) |
Attempts to change the layout of the plugin. | |
bool | setBusLayout (juce::AudioChannelSet, bool isInput, int busIndex) |
Attempts to change the layout of the plugin. | |
int | getNumPrograms () const |
int | getCurrentProgram () const |
juce::String | getProgramName (int index) |
juce::String | getNumberedProgramName (int i) |
juce::String | getCurrentProgramName () |
void | setCurrentProgram (int index, bool sendChangeMessage) |
void | setCurrentProgramName (const juce::String &name) |
bool | hasNameForMidiProgram (int programNum, int bank, juce::String &name) override |
Returns the name for a midi program, if there is one. | |
bool | hasNameForMidiNoteNumber (int note, int midiChannel, juce::String &name) override |
If it's a synth that names its notes, this can return the name it uses for this note 0-127. | |
const VSTXML * | getVSTXML () const noexcept |
juce::AudioPluginInstance * | getAudioPluginInstance () const |
ActiveNoteList | getActiveNotes () const |
std::unique_ptr< EditorComponent > | createEditor () override |
![]() | |
Plugin (PluginCreationInfo) | |
~Plugin () override | |
void | selectableAboutToBeDeleted () override |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
void | playStartedOrStopped () |
called by the system to let the plugin manage its automation stuff | |
virtual juce::String | getShortName (int) |
bool | isEnabled () const noexcept |
void | setFrozen (bool shouldBeFrozen) |
This is a bit different to being enabled as when frozen a plugin can't be interacted with. | |
bool | isFrozen () const noexcept |
void | setProcessingEnabled (bool p) |
Enable/Disable processing. | |
bool | isProcessingEnabled () const noexcept |
virtual void | initialiseWithoutStopping (const PluginInitialisationInfo &) |
Tells the plugin that the audio graph has changed but the plugin isn't being re-initialised - i.e. | |
virtual void | prepareForNextBlock (TimePosition) |
Called between successive rendering blocks. | |
void | applyToBufferWithAutomation (const PluginRenderContext &) |
virtual bool | shouldMeasureCpuUsage () const noexcept |
Plugins can return false if they want to avoid the overhead of measuring the CPU usage. | |
double | getCpuUsage () const noexcept |
Returns the proportion of the current buffer size spent processing this plugin. | |
virtual bool | canSidechain () |
AutomatableParameter * | addParam (const juce::String ¶mID, const juce::String &name, juce::NormalisableRange< float > valueRange) |
AutomatableParameter * | addParam (const juce::String ¶mID, const juce::String &name, juce::NormalisableRange< float > valueRange, std::function< juce::String(float)> valueToStringFunction, std::function< float(const juce::String &)> stringToValueFunction) |
juce::StringArray | getInputChannelNames () |
juce::StringArray | getSidechainSourceNames (bool allowNone) |
void | setSidechainSourceByName (const juce::String &name) |
juce::String | getSidechainSourceName () |
void | guessSidechainRouting () |
int | getNumWires () const |
Wire * | getWire (int index) const |
void | makeConnection (int srcChannel, int dstChannel, juce::UndoManager *) |
void | breakConnection (int srcChannel, int dstChannel) |
virtual bool | hasNameForMidiBank (int bank, juce::String &name) |
virtual bool | canBeAddedToClip () |
virtual bool | canBeAddedToRack () |
virtual bool | canBeAddedToFolderTrack () |
virtual bool | canBeAddedToMaster () |
virtual bool | canBeDisabled () |
virtual bool | canBeMoved () |
virtual bool | needsConstantBufferSize () |
bool | isInRack () const |
juce::ReferenceCountedObjectPtr< RackType > | getOwnerRackType () const |
bool | isClipEffectPlugin () const |
AutomatableParameter::Ptr | getQuickControlParameter () const |
void | setQuickControlParameter (AutomatableParameter *) |
void | removeFromParent () |
Detaches the plugin from any parent it might be in. | |
Track * | getOwnerTrack () const |
Returns the track if it's a track or clip plugin. | |
Clip * | getOwnerClip () const |
Returns the clip if that's what it's in. | |
PluginList * | getOwnerList () const |
Ptr | findPluginThatFeedsIntoThis () const |
Ptr | findPluginThatThisFeedsInto () const |
void | changed () override |
method from Selectable, that's been overridden here to also tell the edit that it's changed. | |
juce::Array< ReferencedItem > | getReferencedItems () override |
void | reassignReferencedItem (const ReferencedItem &, ProjectItemID newID, double newStartTime) override |
virtual void | sourceMediaChanged () |
Called when ProjectItem sources are re-assigned so you can reload from the new source. | |
bool | setPluginToMirror (const Plugin::Ptr &) |
Plugin::Ptr | getMirroredPlugin () const |
bool | baseClassNeedsInitialising () const noexcept |
void | baseClassInitialise (const PluginInitialisationInfo &) |
void | baseClassDeinitialise () |
void | setSidechainSourceID (EditItemID newID) |
EditItemID | getSidechainSourceID () const |
void | showWindowExplicitly () |
void | hideWindowForShutdown () |
juce::UndoManager * | getUndoManager () const noexcept |
bool | isInitialising () const |
![]() | |
Selectable () | |
virtual | ~Selectable () |
virtual void | selectionStatusChanged (bool isNowSelected) |
Can be overridden to tell this object that it has just been selected or deselected. | |
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 () |
![]() | |
virtual | ~Exportable ()=default |
![]() | |
AutomatableEditItem (Edit &, const juce::ValueTree &) | |
~AutomatableEditItem () override | |
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. | |
![]() | |
EditItem (EditItemID, Edit &) | |
EditItem (Edit &, const juce::ValueTree &) | |
virtual | ~EditItem ()=default |
![]() | |
MacroParameterElement (Edit &, const juce::ValueTree &) | |
Constructor. | |
virtual | ~MacroParameterElement ()=default |
Destructor. | |
MacroParameterList * | getMacroParameterList () |
If no parameters have been created, this may return nullptr. | |
MacroParameterList & | getMacroParameterListForWriting () |
This ensures that the list has been created. | |
juce::ReferenceCountedArray< MacroParameter > | getMacroParameters () const |
Static Public Member Functions | |
static juce::ValueTree | create (Engine &, const juce::PluginDescription &) |
![]() | |
static bool | areSelectedPluginsRackable (SelectionManager &) |
static RackInstance * | wrapSelectedPluginsInRack (SelectionManager &) |
static void | sortPlugins (Plugin::Array &) |
static void | sortPlugins (std::vector< Plugin * > &) |
![]() | |
static void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. | |
![]() | |
static juce::Array< Exportable * > | addAllExportables (Edit &) |
Returns all the Exportables contained in an Edit. | |
Public Attributes | |
juce::PluginDescription | desc |
juce::CachedValue< float > | dryValue |
juce::CachedValue< float > | wetValue |
AutomatableParameter::Ptr | dryGain |
AutomatableParameter::Ptr | wetGain |
![]() | |
std::unique_ptr< WindowState > | windowState |
Engine & | engine |
juce::ValueTree | state |
![]() | |
WeakRef::Master | masterReference |
![]() | |
juce::ValueTree | elementState |
juce::CachedValue< bool > | remapOnTempoChange |
![]() | |
Edit & | edit |
const EditItemID | itemID |
Every EditItem has an ID which is unique within the edit. | |
![]() | |
Edit & | ownerEdit |
juce::ValueTree | parentStateForList |
Static Public Attributes | |
static const char * | xmlTypeName |
Additional Inherited Members | |
![]() | |
void | valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override |
void | valueTreeChanged () override |
void | valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override |
void | valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override |
void | valueTreeParentChanged (juce::ValueTree &) override |
![]() | |
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. | |
![]() | |
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 |
![]() | |
static void | getLeftRightChannelNames (juce::StringArray *ins, juce::StringArray *outs) |
static void | getLeftRightChannelNames (juce::StringArray *chans) |
![]() | |
juce::CachedValue< AtomicWrapper< bool > > | enabled |
juce::CachedValue< bool > | frozen |
juce::CachedValue< bool > | processing |
juce::CachedValue< juce::String > | quickParamName |
juce::CachedValue< EditItemID > | masterPluginID |
juce::CachedValue< EditItemID > | sidechainSourceID |
double | sampleRate = 44100.0 |
int | blockSizeSamples = 512 |
using tracktion::engine::ExternalPlugin::Ptr = juce::ReferenceCountedObjectPtr<ExternalPlugin> |
tracktion::engine::ExternalPlugin::ExternalPlugin | ( | PluginCreationInfo | ) |
|
override |
|
overridevirtual |
A unique string to idenitify plugin independant of install location.
Reimplemented from tracktion::engine::Plugin.
References tracktion::engine::createIdentifierString(), and desc.
|
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.
|
static |
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Gives the plugin a chance to do extra initialisation when it's been added to an edit.
Reimplemented from tracktion::engine::Plugin.
void tracktion::engine::ExternalPlugin::forceFullReinitialise | ( | ) |
juce::String tracktion::engine::ExternalPlugin::getLoadError | ( | ) |
Returns an error message if the plugin failed to load.
bool tracktion::engine::ExternalPlugin::isInitialisingAsync | ( | ) | const |
Returns true if the plugin has started initialising but not completed yet.
This happens in the case of some external formats like AUv3. You can use this to show an indicator in your UI.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
void tracktion::engine::ExternalPlugin::flushBusesLayoutToValueTree | ( | ) |
|
overridevirtual |
Reimplemented from tracktion::engine::AutomatableEditItem.
void tracktion::engine::ExternalPlugin::getPluginStateFromTree | ( | juce::MemoryBlock & | ) |
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Gives the plugin a chance to set itself up before being played.
This won't be called concurrently with the process thread.
The sample rate and the average block size - although the blocks won't always be the same, and may be bigger.
Don't call this directly or the initialise count will become out of sync.
Implements tracktion::engine::Plugin.
|
overridevirtual |
Called after play stops to release resources.
Don't call this directly or the initialise count will become out of sync.
Implements tracktion::engine::Plugin.
|
overridevirtual |
Should reset synth voices, tails, clear delay buffers, etc.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Tells the plugin to turn off any playing notes, if applicable.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Implements tracktion::engine::Exportable.
|
overridevirtual |
Implements tracktion::engine::Exportable.
|
overridevirtual |
Process the next block of data.
The incoming buffer will have an unknown number of channels, and the plugin has to deal with them however it wants to.
The buffer should be resized to the number of output channels that the plugin wants to return (which should be the same or less than the number of output channel names it returns from getChannelNames() - never more than this).
Implements tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
References tracktion::engine::AutomatableEditItem::isAutomationNeeded(), isSynth(), and noTail().
|
overridevirtual |
This must return the number of output channels that the plugin will produce, given a number of input channels.
E.g. some might be able to do mono, so will return 1 if the input is 1, 2 if it is 2, etc.
The default impl just returns the number of items that getChannelNames() returns.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
The name of the type, e.g.
"Compressor"
Implements tracktion::engine::Plugin.
References desc.
Referenced by getTooltip().
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
References desc.
|
overridevirtual |
default returns the name, others can return special stuff if needed
Reimplemented from tracktion::engine::Plugin.
References getName().
|
overridevirtual |
Implements tracktion::engine::Plugin.
References xmlTypeName.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
References desc.
Referenced by producesAudioWhenNoAudioInput(), and takesAudioInput().
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
|
overridevirtual |
Plugins can be disabled to avoid them crashing Edits.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
Referenced by producesAudioWhenNoAudioInput().
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Track name or colour has changed.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
References getAudioPluginInstance().
|
overridevirtual |
Attempts to delete this plugin, whether it's a master plugin, track plugin, etc.
This will call removeFromParent but also hide any automation parameters etc. being shown on tracks and hide plugin windows etc. Use this method if the plugin is being fully deleted from the Edit.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
Subclasses must return a description of what they are.
Implements tracktion::engine::Selectable.
juce::File tracktion::engine::ExternalPlugin::getFile | ( | ) | const |
juce::String tracktion::engine::ExternalPlugin::getPluginUID | ( | ) | const |
References desc.
int tracktion::engine::ExternalPlugin::getNumInputs | ( | ) | const |
int tracktion::engine::ExternalPlugin::getNumOutputs | ( | ) | const |
bool tracktion::engine::ExternalPlugin::setBusesLayout | ( | juce::AudioProcessor::BusesLayout | ) |
Attempts to change the layout of the plugin.
bool tracktion::engine::ExternalPlugin::setBusLayout | ( | juce::AudioChannelSet | , |
bool | isInput, | ||
int | busIndex | ||
) |
Attempts to change the layout of the plugin.
int tracktion::engine::ExternalPlugin::getNumPrograms | ( | ) | const |
int tracktion::engine::ExternalPlugin::getCurrentProgram | ( | ) | const |
juce::String tracktion::engine::ExternalPlugin::getProgramName | ( | int | index | ) |
juce::String tracktion::engine::ExternalPlugin::getNumberedProgramName | ( | int | i | ) |
juce::String tracktion::engine::ExternalPlugin::getCurrentProgramName | ( | ) |
|
overridevirtual |
Returns the name for a midi program, if there is one.
programNum = 0 to 127.
Reimplemented from tracktion::engine::Plugin.
|
overridevirtual |
If it's a synth that names its notes, this can return the name it uses for this note 0-127.
Midi channel is 1-16
Reimplemented from tracktion::engine::Plugin.
juce::AudioPluginInstance * tracktion::engine::ExternalPlugin::getAudioPluginInstance | ( | ) | const |
Referenced by getWrappedAudioProcessor().
ActiveNoteList tracktion::engine::ExternalPlugin::getActiveNotes | ( | ) | const |
|
overridevirtual |
Reimplemented from tracktion::engine::Plugin.
Referenced by getPluginType().
juce::PluginDescription tracktion::engine::ExternalPlugin::desc |
Referenced by getIdentifierString(), getName(), getPluginUID(), getVendor(), isAU(), isSynth(), isVST(), and isVST3().
juce::CachedValue<float> tracktion::engine::ExternalPlugin::dryValue |
juce::CachedValue<float> tracktion::engine::ExternalPlugin::wetValue |
AutomatableParameter::Ptr tracktion::engine::ExternalPlugin::dryGain |
Referenced by takesAudioInput().
AutomatableParameter::Ptr tracktion::engine::ExternalPlugin::wetGain |