TracktionEngine
Public Member Functions | List of all members
tracktion::engine::CombiningNode Class Referencefinal

An Node that mixes a sequence of clips of other nodes. More...

Inheritance diagram for tracktion::engine::CombiningNode:

Public Member Functions

 CombiningNode (EditItemID, ProcessState &)
 
 ~CombiningNode () override
 
void addInput (std::unique_ptr< Node >, TimeRange)
 Adds an input node to be played at a given time range. More...
 
void addInput (std::unique_ptr< Node >, BeatRange)
 Adds an input node to be played at a given beat range. More...
 
int getNumInputs () const
 Returns the number of inputs added. More...
 
std::vector< Node * > getInternalNodes () override
 Returns the inputs that have been added. More...
 
std::vector< Node * > getDirectInputNodes () override
 Should return all the inputs directly feeding in to this node. More...
 
tracktion::graph::NodeProperties getNodeProperties () override
 Should return the properties of the node. More...
 
void prepareToPlay (const tracktion::graph::PlaybackInitialisationInfo &) override
 Called once before playback begins for each node. More...
 
bool isReadyToProcess () override
 Should return true when this node is ready to be processed. More...
 
void prefetchBlock (juce::Range< int64_t >) override
 Called before once on all Nodes before they are processed. More...
 
void process (ProcessContext &) override
 Called when the node is to be processed. More...
 
size_t getAllocatedBytes () const override
 
- Public Member Functions inherited from tracktion::graph::Node
 Node ()=default
 
virtual ~Node ()=default
 
void initialise (const PlaybackInitialisationInfo &)
 Call once after the graph has been constructed to initialise buffers etc. More...
 
void prepareForNextBlock (juce::Range< int64_t > referenceSampleRange)
 Call before processing the next block, used to reset the process status. More...
 
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. More...
 
bool hasProcessed () const
 Returns true if this node has processed and its outputs can be retrieved. More...
 
AudioAndMidiBuffer getProcessedOutput ()
 Returns the processed audio and MIDI output. More...
 
virtual TransformResult transform (Node &, const std::vector< Node * > &, TransformCache &)
 Called after construction to give the node a chance to modify its topology. More...
 
void retain ()
 Retains the buffers so they won't be deallocated after the Node has processed. More...
 
void release ()
 Releases the buffers allowing internal storage to be deallocated. More...
 
- Public Member Functions inherited from tracktion::engine::TracktionEngineNode
 TracktionEngineNode (ProcessState &)
 Creates a TracktionEngineNode. More...
 
virtual ~TracktionEngineNode ()=default
 Destructor. More...
 
int getNumSamples () const
 Returns the number of samples in the current process block. More...
 
double getSampleRate () const
 Returns the sample rate of the current process block. More...
 
juce::Range< int64_t > getTimelineSampleRange () const
 Returns the timeline sample range of the current process block. More...
 
TimeRange getEditTimeRange () const
 Returns the edit time range of the current process block. More...
 
BeatRange getEditBeatRange () const
 Returns the edit beat range of the current process block. More...
 
juce::Range< int64_t > getReferenceSampleRange () const
 Returns the reference sample range (from the DeviceManager) of the current process block. More...
 
tempo::Key getKey () const
 Returns the key of the current process block. More...
 
double getPlaybackSpeedRatio () const
 Returns the playback speed ratio of the current process block. More...
 
std::optional< TimePosition > getTimeOfNextChange () const
 May return the time of the next tempo or time sig change. More...
 
std::optional< BeatPosition > getBeatOfNextChange () const
 May return the time of the next tempo or time sig change. More...
 
tracktion::graph::PlayHeadStategetPlayHeadState ()
 Returns the PlayHeadState in use. More...
 
tracktion::graph::PlayHeadgetPlayHead ()
 Returns the PlayHead in use. More...
 
ProcessStategetProcessState ()
 Returns the ProcessState in use. More...
 
void setProcessState (ProcessState &)
 

Additional Inherited Members

- Public Attributes inherited from tracktion::graph::Node
void * internal = nullptr
 
int numOutputNodes = -1
 
- Protected Member Functions inherited from tracktion::graph::Node
void setOptimisations (NodeOptimisations)
 This can be called to provide some hints about allocating or playing back a Node to improve efficiency. More...
 
void setAudioOutput (Node *sourceNode, const choc::buffer::ChannelArrayView< float > &)
 This can be called during your process function to set a view to the output. More...
 

Detailed Description

An Node that mixes a sequence of clips of other nodes.

This node takes a set of input Nodes with associated start + end times, and mixes together their output.

It initialises and releases its inputs as required according to its current play position.

Constructor & Destructor Documentation

◆ CombiningNode()

tracktion::engine::CombiningNode::CombiningNode ( EditItemID  ,
ProcessState  
)

◆ ~CombiningNode()

tracktion::engine::CombiningNode::~CombiningNode ( )
override

Member Function Documentation

◆ addInput() [1/2]

void tracktion::engine::CombiningNode::addInput ( std::unique_ptr< Node ,
TimeRange   
)

Adds an input node to be played at a given time range.

The offset is relative to the combining node's zero-time, so the input node's time of 0 is equal to its (start + offset) relative to the combiner node's start.

Any nodes passed-in will be deleted by this node when required.

◆ addInput() [2/2]

void tracktion::engine::CombiningNode::addInput ( std::unique_ptr< Node ,
BeatRange   
)

Adds an input node to be played at a given beat range.

The offset is relative to the combining node's zero-time, so the input node's time of 0 is equal to its (start + offset) relative to the combiner node's start.

Any nodes passed-in will be deleted by this node when required.

◆ getNumInputs()

int tracktion::engine::CombiningNode::getNumInputs ( ) const

Returns the number of inputs added.

◆ getInternalNodes()

std::vector<Node*> tracktion::engine::CombiningNode::getInternalNodes ( )
overridevirtual

Returns the inputs that have been added.

N.B. This is a bit of a temporary hack to ensure WaveNodes can access previous Nodes that have been added via a CombinngNode. This will be cleaned up in the future.

Reimplemented from tracktion::graph::Node.

◆ getDirectInputNodes()

std::vector<Node*> tracktion::engine::CombiningNode::getDirectInputNodes ( )
overridevirtual

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

Reimplemented from tracktion::graph::Node.

◆ getNodeProperties()

tracktion::graph::NodeProperties tracktion::engine::CombiningNode::getNodeProperties ( )
overridevirtual

Should return the properties of the node.

This should not be called until after initialise.

Implements tracktion::graph::Node.

◆ prepareToPlay()

void tracktion::engine::CombiningNode::prepareToPlay ( const tracktion::graph::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.

◆ isReadyToProcess()

bool tracktion::engine::CombiningNode::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.

◆ prefetchBlock()

void tracktion::engine::CombiningNode::prefetchBlock ( juce::Range< int64_t >  )
overridevirtual

Called before once on all Nodes before they are processed.

This can be used to prefetch audio data or update mute statuses etc..

Reimplemented from tracktion::graph::Node.

◆ process()

void tracktion::engine::CombiningNode::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.

◆ getAllocatedBytes()

size_t tracktion::engine::CombiningNode::getAllocatedBytes ( ) const
overridevirtual

Reimplemented from tracktion::graph::Node.


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