|
TracktionEngine
|
An Node which sums together the multiple inputs adding additional latency to provide a coherent output. More...
#include <tracktion_SummingNode.h>
Public Member Functions | |
| SummingNode ()=default | |
| SummingNode (std::vector< std::unique_ptr< Node > > inputs) | |
| SummingNode (std::vector< Node * > inputs) | |
| SummingNode (std::vector< std::unique_ptr< Node > > ownedInputs, std::vector< Node * > referencedInputs) | |
| void | addInput (std::unique_ptr< Node > newInput) |
| Adds an input to be summed in this Node. | |
| void | setDoubleProcessingPrecision (bool shouldSumInDoublePrecision) |
| Enables Nodes to be intermediately summed using double precision. | |
| NodeProperties | getNodeProperties () override |
| Should return the properties of the node. | |
| std::vector< Node * > | getDirectInputNodes () override |
| Should return all the inputs directly feeding in to this node. | |
| TransformResult | transform (TransformOptions &options) override |
| Called after construction to give the node a chance to modify its topology. | |
| void | prepareToPlay (const PlaybackInitialisationInfo &info) override |
| Called once before playback begins for each node. | |
| bool | isReadyToProcess () override |
| Should return true when this node is ready to be processed. | |
| void | process (ProcessContext &pc) override |
| Called when the node is to be processed. | |
Public Member Functions inherited from graph::Node | |
| Node ()=default | |
| virtual | ~Node ()=default |
| void | initialise (const PlaybackInitialisationInfo &) |
| Call once after the graph has been constructed to initialise buffers etc. | |
| void | prepareForNextBlock (juce::Range< int64_t > referenceSampleRange) |
| Call before processing the next block, used to reset the process status. | |
| void | process (choc::buffer::FrameCount numSamples, juce::Range< int64_t > referenceSampleRange) |
| Call to process the node, which will in turn call the process method with the buffers to fill. | |
| 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. | |
| bool | canShareOutputBuffer () const |
| Returns true if downstream Nodes may adopt this Node's output buffer as their own process buffer, overwriting its contents. | |
| virtual std::vector< Node * > | getInternalNodes () |
| Can return Nodes that are internal to this Node but don't make up the main graph constructed from getDirectInputNodes(). | |
| void | retain () |
| Retains the buffers so they won't be deallocated after the Node has processed. | |
| void | release () |
| Releases the buffers allowing internal storage to be deallocated. | |
| virtual size_t | getAllocatedBytes () const |
| void | enablePreProcess (bool) |
Additional Inherited Members | |
Public Attributes inherited from graph::Node | |
| void * | internal = nullptr |
| int | numOutputNodes = -1 |
Protected Member Functions inherited from graph::Node | |
| virtual void | prefetchBlock (juce::Range< int64_t >) |
| Called before once on all Nodes before they are processed. | |
| virtual void | preProcess (choc::buffer::FrameCount, juce::Range< int64_t >) |
| Called when the node is to be processed, just before process. | |
| void | setOptimisations (NodeOptimisations) |
| This can be called to provide some hints about allocating or playing back a Node to improve efficiency. | |
| void | setBufferViewToUse (Node *sourceNode, const choc::buffer::ChannelArrayView< float > &) |
| This can be called during prepareToPlay to set a BufferView to use which can improve efficiency. | |
| void | setAudioOutput (Node *sourceNode, const choc::buffer::ChannelArrayView< float > &) |
| This can be called during your process function to set a view to the output. | |
An Node which sums together the multiple inputs adding additional latency to provide a coherent output.
|
default |
| graph::SummingNode::SummingNode | ( | std::vector< std::unique_ptr< Node > > | inputs | ) |
| graph::SummingNode::SummingNode | ( | std::vector< Node * > | inputs | ) |
| graph::SummingNode::SummingNode | ( | std::vector< std::unique_ptr< Node > > | ownedInputs, |
| std::vector< Node * > | referencedInputs | ||
| ) |
| void graph::SummingNode::addInput | ( | std::unique_ptr< Node > | newInput | ) |
Adds an input to be summed in this Node.
| void graph::SummingNode::setDoubleProcessingPrecision | ( | bool | shouldSumInDoublePrecision | ) |
Enables Nodes to be intermediately summed using double precision.
This must be set before the node is initialised. N.B. The output will still be single-precision floats.
|
overridevirtual |
Should return the properties of the node.
This should not be called until after initialise.
Implements graph::Node.
References graph::NodeProperties::hasAudio, graph::NodeProperties::hasMidi, graph::NodeProperties::latencyNumSamples, graph::NodeProperties::nodeID, and graph::NodeProperties::numberOfChannels.
|
overridevirtual |
Should return all the inputs directly feeding in to this node.
Reimplemented from graph::Node.
|
overridevirtual |
Called after construction to give the node a chance to modify its topology.
This should return true if any changes were made to the topology as this indicates that the method may need to be called again after other nodes have had their toplogy changed.
Reimplemented from graph::Node.
References graph::Node::TransformOptions::disableLatencyCompensation.
|
overridevirtual |
Called once before playback begins for each node.
Use this to allocate buffers etc. This step can be used to modify the topology of the graph (i.e. add/remove nodes). However, if you do this, you must make sure to call initialise on them so they are fully prepared for processing.
Reimplemented from graph::Node.
References graph::PlaybackInitialisationInfo::blockSize.
|
overridevirtual |
Should return true when this node is ready to be processed.
This is usually when its input's output buffers are ready.
Implements graph::Node.
|
overridevirtual |
Called when the node is to be processed.
This should add in to the buffers available making sure not to change their size at all.
Implements graph::Node.