11namespace tracktion {
inline namespace engine
15 : owner (ip), plugin (ip),
17 returnNode (
std::
move (returnNode_))
22 setOptimisations ({ tracktion::graph::ClearBuffers::no,
23 tracktion::graph::AllocateAudioBuffer::no });
25 plugin->baseClassInitialise ({ TimePosition(), info.sampleRate, info.blockSize });
29InsertNode::~InsertNode()
31 if (isInitialised && ! plugin->baseClassNeedsInitialising())
32 plugin->baseClassDeinitialise();
38 return TransformResult::none;
40 for (
auto n : postOrderedNodes)
44 if (&in->getInsert() == plugin.get())
47 return TransformResult::connectionsMade;
52 return TransformResult::none;
57 auto props = returnNode->getNodeProperties();
58 props.latencyNumSamples += owner.getLatencyNumSamples();
61 props.latencyNumSamples += sendNode->getLatencyAtInput();
68 return { returnNode.get() };
75bool InsertNode::isReadyToProcess()
77 return returnNode->hasProcessed();
82 auto buffers = returnNode->getProcessedOutput();
83 setAudioOutput (returnNode.get(), buffers.audio.getStart (pc.buffers.audio.getNumFrames()));
84 pc.buffers.midi.copyFrom (buffers.midi);
91 : owner (ip), plugin (ip)
95int InsertSendNode::getLatencyAtInput()
114 props.hasMidi = owner.
hasMidi();
115 props.numberOfChannels = props.hasAudio ? 2 : 0;
116 props.latencyNumSamples = owner.getLatencyNumSamples();
132 return TransformResult::none;
134 for (
auto n : postOrderedNodes)
138 if (&in->getInsert() == plugin.
get())
140 input = &in->getInputNode();
141 return TransformResult::connectionsMade;
146 return TransformResult::none;
153 tracktion::graph::AllocateAudioBuffer::no });
167 setAudioOutput (input, buffers.audio.getStart (pc.buffers.audio.getNumFrames()));
168 pc.buffers.midi.copyFrom (buffers.midi);
ReferencedType * get() const noexcept
bool hasMidi() const
Returns true if either the send or return types are MIDI.
bool hasAudio() const
Returns true if either the send or return types are audio.
The send node picks up audio/MIDI data from the InsertPlugin and then its output will be sent to the ...
void process(ProcessContext &) override
Called when the node is to be processed.
TransformResult transform(Node &, const std::vector< Node * > &, TransformCache &) override
Called after construction to give the node a chance to modify its topology.
std::vector< Node * > getDirectInputNodes() override
Should return all the inputs directly feeding in to this node.
tracktion::graph::NodeProperties getNodeProperties() override
Should return the properties of the node.
bool isReadyToProcess() override
Should return true when this node is ready to be processed.
void prepareToPlay(const tracktion::graph::PlaybackInitialisationInfo &) override
Called once before playback begins for each node.
Main graph Node processor class.
void setAudioOutput(Node *sourceNode, const choc::buffer::ChannelArrayView< float > &)
This can be called during your process function to set a view to the output.
virtual NodeProperties getNodeProperties()=0
Should return the properties of the node.
void setOptimisations(NodeOptimisations)
This can be called to provide some hints about allocating or playing back a Node to improve efficienc...
bool hasProcessed() const
Returns true if this node has processed and its outputs can be retrieved.
AudioAndMidiBuffer getProcessedOutput()
Returns the processed audio and MIDI output.
Struct to describe a single iteration of a process call.
TransformResult
Enum to signify the result of the transform function.
Holds some really basic properties of a node.
Passed into Nodes when they are being initialised, to give them useful contextual information that th...