27 #include "ardour/debug.h"
56 , _threads_active (false)
57 , _execution_sem (
"graph_execution", 0)
58 , _callback_start_sem (
"graph_start", 0)
59 , _callback_done_sem (
"graph_done", 0)
60 , _cleanup_sem (
"graph_cleanup", 0)
85 pbd_alloc_allowed = &::alloc_allowed;
104 assert (num_threads > 1);
124 for (uint32_t i = 1; i < num_threads; ++i) {
152 for (
unsigned int i=0; i < thread_count; i++) {
189 node_list_t::iterator i;
297 for (RouteList::iterator ri=routelist->begin(); ri!=routelist->end(); ri++) {
298 (*ri)->_init_refcount[chain] = 0;
299 (*ri)->_activation_set[chain].clear();
305 for (node_list_t::iterator ni =
_nodes_rt[chain].begin(); ni !=
_nodes_rt[chain].end(); ni++) {
310 set<GraphVertex> fed_from_r = edges.
from (r);
313 bool const has_output = !fed_from_r.empty ();
316 for (set<GraphVertex>::iterator i = fed_from_r.begin(); i != fed_from_r.end(); ++i) {
317 r->_activation_set[chain].insert (*i);
324 for (node_set_t::iterator ai = r->_activation_set[chain].begin(); ai != r->_activation_set[chain].end(); ai++) {
325 (*ai)->_init_refcount[chain] += 1;
367 int wakeup = min (et, ts);
373 for (
int i = 0; i < wakeup; i++) {
377 while (to_run == 0) {
462 node_list_t::iterator ni;
463 node_set_t::iterator ai;
471 for (ai=(*ni)->_activation_set[chain].begin(); ai!=(*ni)->_activation_set[chain].end(); ai++) {
540 bool non_rt_pending,
int declick)
566 bool need_butler =
false;
int join_process_threads()
virtual int roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
ARDOUR::Session & _session
LIBPBD_API const char * pthread_name()
framepos_t _process_start_frame
volatile bool _threads_active
uint32_t process_thread_count()
volatile int _setup_chain
virtual void session_going_away()
PBD::ProcessSemaphore _callback_start_sem
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
LIBARDOUR_API uint64_t ProcessThreads
int routes_no_roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool non_rt_pending, int declick)
#define resume_rt_malloc_checks()
framepos_t _process_end_frame
LIBARDOUR_API uint32_t how_many_dsp_threads()
static AudioEngine * instance()
bool _process_non_rt_pending
Glib::Threads::Cond _cleanup_cond
volatile gint _execution_tokens
PBD::ScopedConnectionList engine_connections
bool _process_need_butler
void trigger(GraphNode *n)
Glib::Threads::Mutex _swap_mutex
#define DEBUG_TRACE(bits, str)
LIBARDOUR_API uint64_t Graph
pframes_t _process_nframes
PBD::ProcessSemaphore _callback_done_sem
PBD::ProcessSemaphore _execution_sem
MultiplicationGraph graph
PBD::Signal0< void > Running
#define suspend_rt_malloc_checks()
volatile gint _init_finished_refcount[2]
std::vector< GraphNode * > _trigger_queue
Glib::Threads::Mutex & process_lock()
virtual void set_pending_declick(int)
virtual int no_roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing)
std::set< GraphVertex > from(GraphVertex r) const
void process_one_route(Route *route)
volatile int _current_chain
volatile int _pending_chain
bool has_none_to(GraphVertex to) const
volatile gint _finished_refcount
int process_routes(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
virtual int silent_roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool &need_butler)
PBD::Signal1< void, const char * > Halted
PBD::Signal0< void > Stopped
void rechain(boost::shared_ptr< RouteList >, GraphEdges const &)
bool in_process_thread() const
pthread_mutex_t _trigger_mutex
int silent_process_routes(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool &need_butler)
std::string string_compose(const std::string &fmt, const T1 &o1)
node_list_t _init_trigger_list[2]