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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
tracktion::graph::ConnectedNode Class Reference

An Node which sums together the multiple inputs adding additional latency to provide a coherent output. More...

#include "tracktion_ConnectedNode.h"

Inheritance diagram for tracktion::graph::ConnectedNode:
tracktion::graph::Node

Public Member Functions

 ConnectedNode ()=default
 Creates a ConnectedNode with no connections.
 
 ConnectedNode (size_t nodeID)
 Creates a ConnectedNode with no connections but a base nodeID.
 
bool addAudioConnection (std::shared_ptr< Node >, ChannelConnection)
 Adds an audio connection.
 
bool addMidiConnection (std::shared_ptr< Node >)
 Adds a MIDI connection.
 
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 (Node &, const std::vector< Node * > &, TransformCache &) override
 Called after construction to give the node a chance to modify its topology.
 
bool isReadyToProcess () override
 Should return true when this node is ready to be processed.
 
void prepareToPlay (const PlaybackInitialisationInfo &) override
 Called once before playback begins for each node.
 
void process (ProcessContext &) override
 Called when the node is to be processed.
 
- Public Member Functions inherited from tracktion::graph::Node
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.
 
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 tracktion::graph::Node
void * internal
 
int numOutputNodes
 
- Protected Member Functions inherited from tracktion::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.
 

Detailed Description

An Node which sums together the multiple inputs adding additional latency to provide a coherent output.

This is similar to a SummingNode except you can specify the channels to include.

Definition at line 44 of file tracktion_ConnectedNode.h.

Constructor & Destructor Documentation

◆ ConnectedNode()

tracktion::graph::ConnectedNode::ConnectedNode ( size_t  nodeID)

Creates a ConnectedNode with no connections but a base nodeID.

Definition at line 101 of file tracktion_ConnectedNode.h.

Member Function Documentation

◆ addAudioConnection()

bool tracktion::graph::ConnectedNode::addAudioConnection ( std::shared_ptr< Node input,
ChannelConnection  newConnection 
)

Adds an audio connection.

Returns false if the Node was unable to be added due to a cycle or if there was already a connection between these Nodes.

Definition at line 106 of file tracktion_ConnectedNode.h.

◆ addMidiConnection()

bool tracktion::graph::ConnectedNode::addMidiConnection ( std::shared_ptr< Node input)

Adds a MIDI connection.

Returns false if the Node was unable to be added due to a cycle or if there was already a connection between these Nodes.

Definition at line 137 of file tracktion_ConnectedNode.h.

◆ getDirectInputNodes()

std::vector< Node * > tracktion::graph::ConnectedNode::getDirectInputNodes ( )
overridevirtual

Should return all the inputs directly feeding in to this node.

Reimplemented from tracktion::graph::Node.

Definition at line 199 of file tracktion_ConnectedNode.h.

◆ getNodeProperties()

NodeProperties tracktion::graph::ConnectedNode::getNodeProperties ( )
overridevirtual

Should return the properties of the node.

This should not be called until after initialise.

Implements tracktion::graph::Node.

Definition at line 164 of file tracktion_ConnectedNode.h.

◆ isReadyToProcess()

bool tracktion::graph::ConnectedNode::isReadyToProcess ( )
overridevirtual

Should return true when this node is ready to be processed.

This is usually when its input's output buffers are ready.

Implements tracktion::graph::Node.

Definition at line 215 of file tracktion_ConnectedNode.h.

◆ prepareToPlay()

void tracktion::graph::ConnectedNode::prepareToPlay ( const PlaybackInitialisationInfo )
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 tracktion::graph::Node.

Definition at line 224 of file tracktion_ConnectedNode.h.

◆ process()

void tracktion::graph::ConnectedNode::process ( ProcessContext )
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 tracktion::graph::Node.

Definition at line 228 of file tracktion_ConnectedNode.h.

◆ transform()

TransformResult tracktion::graph::ConnectedNode::transform ( Node ,
const std::vector< Node * > &  ,
TransformCache  
)
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.

Parameters
postOrderedNodesThis is an ordered list obtained from visiting all the Nodes and can be used for quicker introspection of the graph
TransformCacheA cache which can be used to speed up operations during the transform stage.
Returns
TransformResult The type of transformation that has taken place. If connections have been made AND nodes deleted, return nodesDeleted

Reimplemented from tracktion::graph::Node.

Definition at line 209 of file tracktion_ConnectedNode.h.


The documentation for this class was generated from the following file: