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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tracktion::graph::NodePlayer Class Reference

Simple player for an Node. More...

#include "tracktion_NodePlayer.h"

Public Member Functions

 NodePlayer ()=default
 Creates an empty NodePlayer.
 
 NodePlayer (std::unique_ptr< Node > nodeToProcess, PlayHeadState *playHeadStateToUse=nullptr)
 Creates an NodePlayer to process a Node.
 
NodegetNode ()
 Returns the current Node.
 
void setNode (std::unique_ptr< Node > newNode)
 Sets the Node to process.
 
void setNode (std::unique_ptr< Node > newNode, double sampleRateToUse, int blockSizeToUse)
 Sets the Node to process with a new sample rate and block size.
 
void prepareToPlay (double sampleRateToUse, int blockSizeToUse)
 Prepares the current Node to be played.
 
std::unique_ptr< NodeGraphprepareToPlay (std::unique_ptr< Node > node, NodeGraph *oldGraph, double sampleRateToUse, int blockSizeToUse)
 Prepares a specific Node to be played and returns all the Nodes.
 
int process (const Node::ProcessContext &pc)
 Processes a block of audio and MIDI data.
 
double getSampleRate () const
 
int processPostorderedNodes (NodeGraph &graphToProcess, const Node::ProcessContext &pc)
 

Protected Member Functions

int processWithPlayHeadState (PlayHeadState &phs, NodeGraph &graphToProcess, const Node::ProcessContext &pc)
 

Static Protected Member Functions

static int processPostorderedNodesSingleThreaded (NodeGraph &nodeGraph, const Node::ProcessContext &pc)
 Processes a group of Nodes assuming a postordering VertexOrdering.
 

Protected Attributes

std::unique_ptr< Nodeinput
 
std::unique_ptr< NodeGraphnodeGraph
 
PlayHeadStateplayHeadState
 
double sampleRate
 
int blockSize
 
juce::SpinLock inputAndNodesLock
 

Detailed Description

Simple player for an Node.

This simply iterate all the nodes attempting to process them in a single thread.

Definition at line 21 of file tracktion_NodePlayer.h.

Constructor & Destructor Documentation

◆ NodePlayer()

tracktion::graph::NodePlayer::NodePlayer ( std::unique_ptr< Node nodeToProcess,
PlayHeadState playHeadStateToUse = nullptr 
)

Creates an NodePlayer to process a Node.

Definition at line 28 of file tracktion_NodePlayer.h.

Member Function Documentation

◆ getNode()

Node * tracktion::graph::NodePlayer::getNode ( )

Returns the current Node.

Definition at line 34 of file tracktion_NodePlayer.h.

◆ getSampleRate()

double tracktion::graph::NodePlayer::getSampleRate ( ) const

Definition at line 113 of file tracktion_NodePlayer.h.

◆ prepareToPlay() [1/2]

void tracktion::graph::NodePlayer::prepareToPlay ( double  sampleRateToUse,
int  blockSizeToUse 
)

Prepares the current Node to be played.

Definition at line 61 of file tracktion_NodePlayer.h.

◆ prepareToPlay() [2/2]

std::unique_ptr< NodeGraph > tracktion::graph::NodePlayer::prepareToPlay ( std::unique_ptr< Node node,
NodeGraph oldGraph,
double  sampleRateToUse,
int  blockSizeToUse 
)

Prepares a specific Node to be played and returns all the Nodes.

Definition at line 74 of file tracktion_NodePlayer.h.

◆ process()

int tracktion::graph::NodePlayer::process ( const Node::ProcessContext pc)

Processes a block of audio and MIDI data.

Returns the number of times a node was checked but unable to be processed.

Definition at line 88 of file tracktion_NodePlayer.h.

◆ processPostorderedNodes()

int tracktion::graph::NodePlayer::processPostorderedNodes ( NodeGraph graphToProcess,
const Node::ProcessContext pc 
)

Definition at line 118 of file tracktion_NodePlayer.h.

◆ processPostorderedNodesSingleThreaded()

static int tracktion::graph::NodePlayer::processPostorderedNodesSingleThreaded ( NodeGraph nodeGraph,
const Node::ProcessContext pc 
)
staticprotected

Processes a group of Nodes assuming a postordering VertexOrdering.

If these conditions are met the Nodes should be processed in a single loop iteration.

Definition at line 184 of file tracktion_NodePlayer.h.

◆ processWithPlayHeadState()

int tracktion::graph::NodePlayer::processWithPlayHeadState ( PlayHeadState phs,
NodeGraph graphToProcess,
const Node::ProcessContext pc 
)
protected

Definition at line 133 of file tracktion_NodePlayer.h.

◆ setNode() [1/2]

void tracktion::graph::NodePlayer::setNode ( std::unique_ptr< Node newNode)

Sets the Node to process.

Definition at line 42 of file tracktion_NodePlayer.h.

◆ setNode() [2/2]

void tracktion::graph::NodePlayer::setNode ( std::unique_ptr< Node newNode,
double  sampleRateToUse,
int  blockSizeToUse 
)

Sets the Node to process with a new sample rate and block size.

Definition at line 48 of file tracktion_NodePlayer.h.

Member Data Documentation

◆ blockSize

int tracktion::graph::NodePlayer::blockSize
protected

Definition at line 129 of file tracktion_NodePlayer.h.

◆ input

std::unique_ptr<Node> tracktion::graph::NodePlayer::input
protected

Definition at line 124 of file tracktion_NodePlayer.h.

◆ inputAndNodesLock

juce::SpinLock tracktion::graph::NodePlayer::inputAndNodesLock
protected

Definition at line 131 of file tracktion_NodePlayer.h.

◆ nodeGraph

std::unique_ptr<NodeGraph> tracktion::graph::NodePlayer::nodeGraph
protected

Definition at line 125 of file tracktion_NodePlayer.h.

◆ playHeadState

PlayHeadState* tracktion::graph::NodePlayer::playHeadState
protected

Definition at line 126 of file tracktion_NodePlayer.h.

◆ sampleRate

double tracktion::graph::NodePlayer::sampleRate
protected

Definition at line 128 of file tracktion_NodePlayer.h.


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