Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::graph::GraphThread Class Referencefinal

Processing graph thread. More...

#include <src/dsp/graph_thread.h>

Inheritance diagram for zrythm::dsp::graph::GraphThread:
Collaboration diagram for zrythm::dsp::graph::GraphThread:

Public Member Functions

 GraphThread (int id, bool is_main, GraphScheduler &scheduler, std::optional< juce::AudioWorkgroup > workgroup=std::nullopt)
 Creates and starts a realtime thread.
void on_reached_terminal_node ()
 Called to indicate a terminal node has completed processing.

Data Fields

int id_ { -1 }
 Thread index in zrythm.
bool is_main_ { false }
std::atomic< RTThreadId::IdType > rt_thread_id_ { 0 }
 Realtime thread ID.
GraphSchedulerscheduler_
 Pointer back to the owner scheduler.
std::optional< juce::AudioWorkgroup > audio_workgroup_
 Non-owning pointer (optional) to a workgroup to join.

Detailed Description

Processing graph thread.

Definition at line 21 of file graph_thread.h.

Constructor & Destructor Documentation

◆ GraphThread()

zrythm::dsp::graph::GraphThread::GraphThread ( int id,
bool is_main,
GraphScheduler & scheduler,
std::optional< juce::AudioWorkgroup > workgroup = std::nullopt )
explicit

Creates and starts a realtime thread.

Parameters
idThe index of the thread.
is_mainWhether main thread.
schedulerThe scheduler that owns the thread.
Exceptions
ZrythmExceptionif the thread could not be started.

Member Function Documentation

◆ on_reached_terminal_node()

void zrythm::dsp::graph::GraphThread::on_reached_terminal_node ( )

Called to indicate a terminal node has completed processing.

The thread of the last terminal node that reaches here will inform the main-thread, wait, and kick off the next process cycle.

Field Documentation

◆ audio_workgroup_

std::optional<juce::AudioWorkgroup> zrythm::dsp::graph::GraphThread::audio_workgroup_

Non-owning pointer (optional) to a workgroup to join.

See also
juce::AudioDeviceManager::getDeviceAudioWorkgroup().

Definition at line 80 of file graph_thread.h.

◆ id_

int zrythm::dsp::graph::GraphThread::id_ { -1 }

Thread index in zrythm.

The main thread will be -1 and the rest in sequence starting from 0.

Definition at line 63 of file graph_thread.h.

◆ is_main_

bool zrythm::dsp::graph::GraphThread::is_main_ { false }

Definition at line 65 of file graph_thread.h.

◆ rt_thread_id_

std::atomic<RTThreadId::IdType> zrythm::dsp::graph::GraphThread::rt_thread_id_ { 0 }

Realtime thread ID.

Definition at line 70 of file graph_thread.h.

◆ scheduler_

GraphScheduler& zrythm::dsp::graph::GraphThread::scheduler_

Pointer back to the owner scheduler.

Definition at line 73 of file graph_thread.h.


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