tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_PluginNode.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11#pragma once
12
13namespace tracktion { inline namespace engine
14{
15
16struct InputProvider;
17class TrackMuteState;
18
24{
25public:
26 //==============================================================================
40 double sampleRateToUse, int blockSizeToUse,
41 const TrackMuteState*,
43 bool rendering, bool balanceLatency,
44 int maxNumChannelsToUse);
45
47 ~PluginNode() override;
48
49 //==============================================================================
50 Plugin& getPlugin() { return *plugin; }
51
53 std::vector<Node*> getDirectInputNodes() override { return { input.get() }; }
54 bool isReadyToProcess() override { return input->hasProcessed(); }
56 void prefetchBlock (juce::Range<int64_t>) override;
57 void preProcess (choc::buffer::FrameCount, juce::Range<int64_t>) override;
58 void process (ProcessContext&) override;
59
60private:
61 //==============================================================================
64
65 const TrackMuteState* trackMuteState = nullptr;
67 bool isRendering = false;
68
69 bool isInitialised = false;
70 double sampleRate = 44100.0;
71 int latencyNumSamples = 0, maxNumChannels = -1;
73 int subBlockSizeToUse = -1;
74 bool balanceLatency = true, canProcessBypassed = false;
75 TimeDuration automationAdjustmentTime;
76
78 std::optional<NodeProperties> cachedNodeProperties;
79 bool isPrepared = false, canUseSourceBuffers = false;
80
81 //==============================================================================
82 void initialisePlugin (double sampleRateToUse, int blockSizeToUse);
83 PluginRenderContext getPluginRenderContext (TimeRange, juce::AudioBuffer<float>&);
84 void replaceLatencyProcessorIfPossible (NodeGraph*);
85};
86
87}} // namespace tracktion { inline namespace engine
Node for processing a plugin.
tracktion::graph::NodeProperties getNodeProperties() override
Should return the properties of the node.
void preProcess(choc::buffer::FrameCount, juce::Range< int64_t >) override
Called when the node is to be processed, just before process.
void process(ProcessContext &) override
Called when the node is to be processed.
void prefetchBlock(juce::Range< int64_t >) override
Called before once on all Nodes before they are processed.
void prepareToPlay(const tracktion::graph::PlaybackInitialisationInfo &) override
Called once before playback begins for each node.
bool isReadyToProcess() override
Should return true when this node is ready to be processed.
std::vector< Node * > getDirectInputNodes() override
Should return all the inputs directly feeding in to this node.
Holds the state of a Track and if its contents/plugins should be played or not.
Base class for Nodes that provides information about the current process call.
Main graph Node processor class.
Determines how this block releates to other previous render blocks and if the play head has jumped in...
T get(T... args)
Represents a duration in real-life time.
The context passed to plugin render methods to provide it with buffers to fill.
Holds the state of a process call.
Holds a graph in an order ready for processing and a sorted map for quick lookups.
Holds some really basic properties of a node.
Passed into Nodes when they are being initialised, to give them useful contextual information that th...