TracktionEngine
|
Namespaces | |
namespace | detail |
namespace | node_player_utils |
namespace | test_utilities |
Classes | |
class | AudioBufferPool |
A lock-free pool of audio buffers. More... | |
class | AudioBufferStack |
A stack of audio buffers. More... | |
class | AudioFifo |
class | BasicSummingNode |
struct | ChannelConnection |
class | ChannelRemappingNode |
Maps channels from one to another. More... | |
class | ConnectedNode |
An Node which sums together the multiple inputs adding additional latency to provide a coherent output. More... | |
class | ForwardingNode |
Takes a non-owning input node and simply forwards its outputs on. More... | |
class | FunctionNode |
class | GainNode |
class | LatencyNode |
struct | LatencyProcessor |
class | LightweightSemaphore |
A counting semaphore that spins on a atomic before waiting so will avoid system calls if wait periods are very short. More... | |
class | LockFreeMultiThreadedNodePlayer |
Plays back a node with mutiple threads. More... | |
class | LockFreeObject |
Manages access to an object in a way that means it is lock-free to access from a real-time thread. More... | |
class | MidiNode |
Plays back a MIDI sequence. More... | |
class | MultiThreadedNodePlayer |
Plays back a node with mutiple threads. More... | |
class | Node |
Main graph Node processor class. More... | |
struct | NodeAndID |
A Node and its ID cached for quick lookup (without having to traverse the graph). More... | |
struct | NodeBuffer |
Holds a view over some data and optionally some storage for that data. More... | |
struct | NodeGraph |
Holds a graph in an order ready for processing and a sorted map for quick lookups. More... | |
struct | NodeOptimisations |
Holds some hints that might be used by the Node or players to improve efficiency. More... | |
class | NodePlayer |
Simple player for an Node. More... | |
struct | NodeProperties |
Holds some really basic properties of a node. More... | |
class | PerformanceMeasurement |
A timer for measuring performance of code. More... | |
struct | PlaybackInitialisationInfo |
Passed into Nodes when they are being initialised, to give them useful contextual information that they may need. More... | |
class | PlayHead |
Converts a monotonically increasing reference range in to a timeline range. More... | |
class | PlayHeadState |
Determines how this block releates to other previous render blocks and if the play head has jumped in time. More... | |
class | RealTimeSpinLock |
A basic spin lock that uses an atomic_flag to store the locked state so should never result in a system call. More... | |
class | ReturnNode |
class | ScopedPerformanceMeasurement |
RAII wrapper to start and stop a performance measurement. More... | |
struct | ScopedSignpost |
A macOS specific class to start/stop a signpost for use in Instruments. More... | |
class | Semaphore |
A basic counting semaphore. More... | |
class | SendNode |
class | SilentNode |
Just a simple audio node that doesn't take any input so can be used as a stub. More... | |
class | SimpleNodePlayer |
Simple player for a Node. More... | |
class | SinkNode |
Blocks audio and MIDI input from reaching the outputs. More... | |
class | SinNode |
struct | SplitTimelineRange |
Represents a pair of timeline ranges which could be wraped around the loop end. More... | |
class | SummingNode |
An Node which sums together the multiple inputs adding additional latency to provide a coherent output. More... | |
class | TransformCache |
Enumerations | |
enum class | TransformResult { none , connectionsMade , nodesDeleted } |
Enum to signify the result of the transform function. More... | |
enum class | ClearBuffers { no , yes } |
enum class | AllocateAudioBuffer { no , yes } |
enum class | VertexOrdering { preordering , postordering , reversePreordering , reversePostordering , bfsPreordering , bfsReversePreordering } |
Specifies the ordering algorithm. More... | |
enum class | ThreadPoolStrategy { conditionVariable , realTime , hybrid , semaphore , lightweightSemaphore , lightweightSemHybrid } |
Available strategies for thread pools. More... | |
Functions | |
template<typename NodeType , typename... Args> | |
std::unique_ptr< Node > | makeNode (Args &&... args) |
Creates a node of the given type and returns it as the base Node class. | |
bool | operator< (NodeAndID n1, NodeAndID n2) |
Compares two NodeAndIDs. | |
bool | operator== (NodeAndID n1, NodeAndID n2) |
Compares two NodeAndIDs. | |
std::unique_ptr< NodeGraph > | createNodeGraph (std::unique_ptr< Node >, bool disableLatencyCompensation) |
Transforms a Node and then returns a NodeGraph of it ready to be initialised. | |
template<typename Visitor > | |
void | visitNodes (Node &, Visitor &&, bool preordering) |
Should call the visitor for any direct inputs to the node exactly once. | |
template<typename Visitor > | |
void | visitNodesBFS (Node &node, Visitor &&visitor) |
void | addNodesRecursive (std::vector< NodeAndID > &nodeMap, Node &n) |
std::vector< NodeAndID > | createNodeMap (const std::vector< Node * > &nodes) |
LockFreeMultiThreadedNodePlayer::ThreadPoolCreator | getPoolCreatorFunction (ThreadPoolStrategy) |
Returns a function to create a ThreadPool for the given stategy. | |
template<typename IntType > | |
constexpr double | sampleToTime (IntType samplePosition, double sampleRate) |
Converts an integer sample number to a time in seconds. | |
constexpr int64_t | timeToSample (std::floating_point auto timeInSeconds, double sampleRate) |
Converts a time in seconds to a sample number. | |
template<typename IntType > | |
constexpr juce::Range< double > | sampleToTime (juce::Range< IntType > sampleRange, double sampleRate) |
Converts an integer sample range to a time range in seconds. | |
constexpr juce::Range< int64_t > | timeToSample (juce::Range< double > timeInSeconds, double sampleRate) |
Converts a time range in seconds to a range of sample numbers. | |
template<typename RangeType > | |
constexpr juce::Range< int64_t > | timeToSample (RangeType timeInSeconds, double sampleRate) |
Converts a time range in seconds to a range of sample numbers. | |
template<typename NodeType , typename Predicate > | |
NodeType * | findNode (NodeGraph &nodeGraph, Predicate pred) |
Attempts to find a Node of a given type with a specified ID. | |
template<typename NodeType > | |
NodeType * | findNodeWithID (NodeGraph &nodeGraph, size_t nodeIDToLookFor) |
Attempts to find a Node of a given type with a specified ID. | |
template<typename NodeType > | |
NodeType * | findNodeWithIDIfNonZero (NodeGraph *nodeGraph, size_t nodeIDToLookFor) |
Attempts to find a Node of a given type with a specified ID. | |
juce::AudioBuffer< float > | toAudioBuffer (choc::buffer::ChannelArrayView< float > view) |
Creates a juce::AudioBuffer from a choc::buffer::BufferView. | |
template<typename SampleType > | |
choc::buffer::BufferView< SampleType, choc::buffer::SeparateChannelLayout > | toBufferView (juce::AudioBuffer< SampleType > &buffer) |
Converts a juce::AudioBuffer<SampleType> to a choc::buffer::BufferView. | |
choc::buffer::FrameRange | createFrameRange (std::integral auto start, std::integral auto end) |
Creates a FrameRange from any integral type. | |
juce::MidiMessage | toMidiMessage (const choc::midi::Sequence::Event &e) |
Converts a choc::midi event to a juce::MidiMessage. | |
template<typename BufferViewType , typename SampleType , typename SmoothingType > | |
void | multiplyBy (BufferViewType &view, juce::SmoothedValue< SampleType, SmoothingType > &value) noexcept |
Mutiplies a choc::buffer::BufferView by a juce::SmoothedValue. | |
template<typename BufferType , typename GainType > | |
void | applyGainRamp (BufferType &&buffer, GainType startGain, GainType endGain) noexcept |
Applies a gain ram to a choc::buffer::BufferView. | |
choc::buffer::FrameRange | frameRangeWithStartAndLength (choc::buffer::FrameCount start, choc::buffer::FrameCount length) |
Returns a FrameRange with a start and length. | |
choc::buffer::ChannelRange | channelRangeWithStartAndLength (choc::buffer::ChannelCount start, choc::buffer::ChannelCount length) |
Returns a ChannelRange with a start and length. | |
template<typename Buffer > | |
void | sanitise (Buffer &buffer) |
template<typename SampleType , template< typename > typename LayoutType> | |
void | sanityCheckView (const choc::buffer::BufferView< SampleType, LayoutType > &view) |
Checks that the channels have valid pointers if they have a non-zero number of frames. | |
bool | setThreadPriority (std::thread &, int priority) |
Changes the thread's priority. | |
bool | tryToUpgradeCurrentThreadToRealtime (const juce::Thread::RealtimeOptions &) |
Tries to upgrade the current thread to realtime priority. | |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Available strategies for thread pools.
This will determine how worker threads are handled when no Nodes are available for processing.
std::unique_ptr< Node > tracktion::graph::makeNode | ( | Args &&... | args | ) |
Creates a node of the given type and returns it as the base Node class.
void tracktion::graph::visitNodes | ( | Node & | node, |
Visitor && | visitor, | ||
bool | preordering | ||
) |
Should call the visitor for any direct inputs to the node exactly once.
If preordering is true, nodes will be visited before their inputs, if false, inputs will be visited first.
Visitor | has the signature void (Node&)
|
Referenced by tracktion::graph::ConnectedNode::addAudioConnection(), and tracktion::graph::ConnectedNode::addMidiConnection().
void tracktion::graph::visitNodesBFS | ( | Node & | node, |
Visitor && | visitor | ||
) |
LockFreeMultiThreadedNodePlayer::ThreadPoolCreator tracktion::graph::getPoolCreatorFunction | ( | ThreadPoolStrategy | ) |
Returns a function to create a ThreadPool for the given stategy.
Referenced by tracktion::engine::benchmark_utilities::renderEdit().
|
constexpr |
Converts an integer sample number to a time in seconds.
Referenced by tracktion::graph::LatencyProcessor::clearMIDI(), tracktion::graph::LatencyProcessor::prepareToPlay(), and tracktion::graph::LatencyProcessor::readMIDI().
|
constexpr |
Converts a time in seconds to a sample number.
Referenced by tracktion::graph::NodePlayer::prepareToPlay().
|
constexpr |
Converts an integer sample range to a time range in seconds.
|
constexpr |
Converts a time range in seconds to a range of sample numbers.
|
constexpr |
Converts a time range in seconds to a range of sample numbers.
NodeType * tracktion::graph::findNode | ( | NodeGraph & | nodeGraph, |
Predicate | pred | ||
) |
Attempts to find a Node of a given type with a specified ID.
This uses the sortedNodes vector so should be relatively quick (much quicker than traversing from the root node.
NodeType * tracktion::graph::findNodeWithID | ( | NodeGraph & | nodeGraph, |
size_t | nodeIDToLookFor | ||
) |
Attempts to find a Node of a given type with a specified ID.
This uses the sortedNodes vector so should be relatively quick (much quicker than traversing from the root node.
NodeType * tracktion::graph::findNodeWithIDIfNonZero | ( | NodeGraph * | nodeGraph, |
size_t | nodeIDToLookFor | ||
) |
Attempts to find a Node of a given type with a specified ID.
This uses the sortedNodes vector so should be relatively quick (much quicker than traversing from the root node.
juce::AudioBuffer< float > tracktion::graph::toAudioBuffer | ( | choc::buffer::ChannelArrayView< float > | view | ) |
Creates a juce::AudioBuffer from a choc::buffer::BufferView.
Referenced by tracktion::graph::test_utilities::buffersAreEqual(), tracktion::graph::test_utilities::TestProcess< NodePlayerType >::process(), and tracktion::graph::test_utilities::writeToFile().
choc::buffer::BufferView< SampleType, choc::buffer::SeparateChannelLayout > tracktion::graph::toBufferView | ( | juce::AudioBuffer< SampleType > & | buffer | ) |
Converts a juce::AudioBuffer<SampleType> to a choc::buffer::BufferView.
choc::buffer::FrameRange tracktion::graph::createFrameRange | ( | std::integral auto | start, |
std::integral auto | end | ||
) |
Creates a FrameRange from any integral type.
juce::MidiMessage tracktion::graph::toMidiMessage | ( | const choc::midi::Sequence::Event & | e | ) |
Converts a choc::midi event to a juce::MidiMessage.
|
noexcept |
Mutiplies a choc::buffer::BufferView by a juce::SmoothedValue.
|
noexcept |
Applies a gain ram to a choc::buffer::BufferView.
choc::buffer::FrameRange tracktion::graph::frameRangeWithStartAndLength | ( | choc::buffer::FrameCount | start, |
choc::buffer::FrameCount | length | ||
) |
Returns a FrameRange with a start and length.
choc::buffer::ChannelRange tracktion::graph::channelRangeWithStartAndLength | ( | choc::buffer::ChannelCount | start, |
choc::buffer::ChannelCount | length | ||
) |
Returns a ChannelRange with a start and length.
void tracktion::graph::sanitise | ( | Buffer & | buffer | ) |
void tracktion::graph::sanityCheckView | ( | const choc::buffer::BufferView< SampleType, LayoutType > & | view | ) |
Checks that the channels have valid pointers if they have a non-zero number of frames.
Referenced by tracktion::engine::InputProvider::getInputs(), and tracktion::engine::InputProvider::setInputs().
bool tracktion::graph::setThreadPriority | ( | std::thread & | , |
int | priority | ||
) |
Changes the thread's priority.
May return false if for some reason the priority can't be changed.
priority | the new priority, in the range 0 (lowest) to 10 (highest). A priority of 5 is normal. |
bool tracktion::graph::tryToUpgradeCurrentThreadToRealtime | ( | const juce::Thread::RealtimeOptions & | ) |
Tries to upgrade the current thread to realtime priority.