11namespace tracktion {
inline namespace engine
33 void processingChanged()
override;
37 void forceFullReinitialise();
41 static const char* xmlTypeName;
43 void flushPluginStateToValueTree()
override;
44 void flushBusesLayoutToValueTree();
48 void updateFromMirroredPluginIfNeeded (
Plugin&)
override;
52 void reset()
override;
56 void reassignReferencedItem (
const ReferencedItem&,
ProjectItemID newID,
double newStartTime)
override;
60 bool producesAudioWhenNoAudioInput()
override {
return isAutomationNeeded() || isSynth() || ! noTail(); }
70 juce::String getPluginType()
override {
return xmlTypeName; }
72 bool takesMidiInput()
override;
73 bool takesAudioInput()
override {
return (! isSynth()) || (dryGain->getCurrentValue() > 0.0f); }
76 double getLatencySeconds()
override {
return latencySeconds; }
77 bool noTail()
override;
78 double getTailLength()
const override;
79 bool needsConstantBufferSize()
override {
return false; }
93 const char* getDebugName() const noexcept {
return debugName.
toUTF8(); }
96 int getNumInputs()
const;
97 int getNumOutputs()
const;
106 int getNumPrograms()
const;
107 int getCurrentProgram()
const;
111 void setCurrentProgram (
int index,
bool sendChangeMessage);
117 const VSTXML* getVSTXML() const noexcept {
return vstXML.get(); }
124 AutomatableParameter::Ptr dryGain, wetGain;
126 ActiveNoteList getActiveNotes()
const {
return activeNotes; }
136 struct ProcessorChangedManager;
140 int latencySamples = 0;
141 double latencySeconds = 0;
142 bool isInstancePrepared =
false;
144 double lastSampleRate = 0.0;
145 int lastBlockSizeSamples = 0;
148 MidiMessageArray::MPESourceID midiSourceID = MidiMessageArray::createUniqueMPESourceID();
150 ActiveNoteList activeNotes;
152 class PluginPlayHead;
155 bool fullyInitialised =
false, supportsMPE =
false, isFlushingLayoutToState =
false;
157 struct MPEChannelRemapper;
160 void prepareIncomingMidiMessages (MidiMessageArray& incoming,
int numSamples,
bool isPlaying);
166 void deletePluginInstance();
169 void buildParameterTree()
const override;
170 void buildParameterTree (
const VSTXML::Group*, AutomatableParameterTree::TreeNode*,
juce::SortedSet<int>&)
const;
173 void doFullInitialisation();
174 void buildParameterList();
175 void refreshParameterValues();
176 void updateDebugName();
177 void processPluginBlock (
const PluginRenderContext&,
bool processedBypass);
static String toHexString(IntegerType number)
CharPointer_UTF8 toUTF8() const
The Engine is the central class for all tracktion sessions.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
bool setBusLayout(juce::AudioChannelSet, bool isInput, int busIndex)
Attempts to change the layout of the plugin.
void deleteFromParent() override
Attempts to delete this plugin, whether it's a master plugin, track plugin, etc.
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.
bool setBusesLayout(juce::AudioProcessor::BusesLayout)
Attempts to change the layout of the plugin.
void reset() override
Should reset synth voices, tails, clear delay buffers, etc.
void setEnabled(bool enabled) override
Enable/disable the plugin.
void trackPropertiesChanged() override
Track name or colour has changed.
void selectableAboutToBeDeleted() override
Called just before the selectable is about to be deleted so any subclasses should still be valid at t...
juce::String getTooltip() override
default returns the name, others can return special stuff if needed
bool isDisabled() override
Plugins can be disabled to avoid them crashing Edits.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
juce::String getName() const override
The name of the type, e.g.
void initialiseFully() override
Gives the plugin a chance to do extra initialisation when it's been added to an edit.
int getNumOutputChannelsGivenInputs(int numInputs) override
This must return the number of output channels that the plugin will produce, given a number of input ...
bool hasNameForMidiProgram(int programNum, int bank, juce::String &name) override
Returns the name for a midi program, if there is one.
void deinitialise() override
Called after play stops to release resources.
juce::String getIdentifierString() override
A unique string to idenitify plugin independant of install location.
bool isMissing() override
for things like VSTs where the DLL is missing.
An ID representing one of the items in a Project.
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
The context passed to plugin render methods to provide it with buffers to fill.
specialised AutomatableParameter for wet/dry.