TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
engine::TracktionNodePlayer Class Reference

Plays back a Node with PlayHeadState and ProcessState. More...

#include <tracktion_TracktionNodePlayer.h>

Public Member Functions

 TracktionNodePlayer (ProcessState &processStateToUse)
 Creates an NodePlayer to process a Node.
 
 TracktionNodePlayer (ProcessState &processStateToUse, tracktion::graph::LockFreeMultiThreadedNodePlayer::ThreadPoolCreator poolCreator, juce::AudioWorkgroup audioWorkgroup={})
 Creates an NodePlayer to process a Node.
 
 TracktionNodePlayer (std::unique_ptr< tracktion::graph::Node > node, ProcessState &processStateToUse, double sampleRate, int blockSize, tracktion::graph::LockFreeMultiThreadedNodePlayer::ThreadPoolCreator poolCreator)
 Creates an NodePlayer to process a Node.
 
void setNumThreads (size_t numThreads)
 Sets the number of threads to use for rendering.
 
tracktion::graph::Node * getNode ()
 
void setNode (std::unique_ptr< tracktion::graph::Node > newNode)
 
void setNode (std::unique_ptr< tracktion::graph::Node > newNode, double sampleRateToUse, int blockSizeToUse)
 
void prepareToPlay (double sampleRateToUse, int blockSizeToUse)
 
int process (const tracktion::graph::Node::ProcessContext &pc)
 Processes a block of audio and MIDI data.
 
void clearNode ()
 Clears the Node currently playing.
 
double getSampleRate () const
 Returns the current sample rate.
 
void enablePooledMemoryAllocations (bool enablePooledMemory)
 
void enableNodeMemorySharing (bool enableNodeMemorySharing)
 
void setLatencyCompensationEnabled (bool shouldEnable)
 Enables or disables latency compensation - it is enabled by default.
 

Detailed Description

Plays back a Node with PlayHeadState and ProcessState.

Constructor & Destructor Documentation

◆ TracktionNodePlayer() [1/3]

engine::TracktionNodePlayer::TracktionNodePlayer ( ProcessState processStateToUse)

Creates an NodePlayer to process a Node.

◆ TracktionNodePlayer() [2/3]

engine::TracktionNodePlayer::TracktionNodePlayer ( ProcessState processStateToUse,
tracktion::graph::LockFreeMultiThreadedNodePlayer::ThreadPoolCreator  poolCreator,
juce::AudioWorkgroup  audioWorkgroup = {} 
)

Creates an NodePlayer to process a Node.

◆ TracktionNodePlayer() [3/3]

engine::TracktionNodePlayer::TracktionNodePlayer ( std::unique_ptr< tracktion::graph::Node >  node,
ProcessState processStateToUse,
double  sampleRate,
int  blockSize,
tracktion::graph::LockFreeMultiThreadedNodePlayer::ThreadPoolCreator  poolCreator 
)

Creates an NodePlayer to process a Node.

References setNode().

Member Function Documentation

◆ setNumThreads()

void engine::TracktionNodePlayer::setNumThreads ( size_t  numThreads)

Sets the number of threads to use for rendering.

This can be 0 in which case only the process calling thread will be used for processing. N.B. this will pause processing whilst updating the threads so there will be a gap in the audio.

◆ getNode()

tracktion::graph::Node * engine::TracktionNodePlayer::getNode ( )

◆ setNode() [1/2]

void engine::TracktionNodePlayer::setNode ( std::unique_ptr< tracktion::graph::Node >  newNode)

Referenced by TracktionNodePlayer().

◆ setNode() [2/2]

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

◆ prepareToPlay()

void engine::TracktionNodePlayer::prepareToPlay ( double  sampleRateToUse,
int  blockSizeToUse 
)

◆ process()

int engine::TracktionNodePlayer::process ( const tracktion::graph::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.

◆ clearNode()

void engine::TracktionNodePlayer::clearNode ( )

Clears the Node currently playing.

◆ getSampleRate()

double engine::TracktionNodePlayer::getSampleRate ( ) const

Returns the current sample rate.

◆ enablePooledMemoryAllocations()

void engine::TracktionNodePlayer::enablePooledMemoryAllocations ( bool  enablePooledMemory)

◆ enableNodeMemorySharing()

void engine::TracktionNodePlayer::enableNodeMemorySharing ( bool  enableNodeMemorySharing)

◆ setLatencyCompensationEnabled()

void engine::TracktionNodePlayer::setLatencyCompensationEnabled ( bool  shouldEnable)

Enables or disables latency compensation - it is enabled by default.


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