X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fgraph.h;h=239f9ad1abec406c2976e2d1dc48d83cdad47221;hb=2cc33684c71131fd483346fe05e3b1a0e1706de9;hp=e3363a03537c1423da614147ac52b96d9bf627d8;hpb=a473d630eb165272992e90f8d854b1d66ec0be63;p=ardour.git diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h index e3363a0353..239f9ad1ab 100644 --- a/libs/ardour/ardour/graph.h +++ b/libs/ardour/ardour/graph.h @@ -28,14 +28,13 @@ #include -#include -#include - -#include +#include #include "pbd/semutils.h" +#include "ardour/libardour_visibility.h" #include "ardour/types.h" +#include "ardour/audio_backend.h" #include "ardour/session_handle.h" namespace ARDOUR @@ -46,23 +45,21 @@ class Graph; class Route; class Session; +class GraphEdges; typedef boost::shared_ptr node_ptr_t; -typedef boost::shared_ptr graph_ptr_t; typedef std::list< node_ptr_t > node_list_t; typedef std::set< node_ptr_t > node_set_t; -class Graph : public SessionHandleRef +class LIBARDOUR_API Graph : public SessionHandleRef { public: Graph (Session & session); - uint32_t threads_in_use () const { return _thread_list.size(); } - void prep(); void trigger (GraphNode * n); - void rechain (boost::shared_ptr r); + void rechain (boost::shared_ptr, GraphEdges const &); void dump (int chain); void process(); @@ -74,13 +71,13 @@ public: void main_thread(); int silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool can_record, bool rec_monitors_input, bool& need_butler); + bool& need_butler); int process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, - bool can_record, bool rec_monitors_input, bool& need_butler); + bool& need_butler); int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool non_rt_pending, bool can_record, int declick); + bool non_rt_pending, int declick); void process_one_route (Route * route); @@ -92,11 +89,8 @@ protected: virtual void session_going_away (); private: - std::list _thread_list; - volatile bool _quit_threads; - PBD::ScopedConnection processor_usage_connection; + volatile bool _threads_active; - void parameter_changed (std::string); void reset_thread_list (); void drop_threads (); @@ -107,21 +101,25 @@ private: std::vector _trigger_queue; pthread_mutex_t _trigger_mutex; - PBD::ProcessSemaphore _execution_sem; + PBD::Semaphore _execution_sem; - PBD::ProcessSemaphore _callback_start_sem; - PBD::ProcessSemaphore _callback_done_sem; - PBD::ProcessSemaphore _cleanup_sem; + /** Signalled to start a run of the graph for a process callback */ + PBD::Semaphore _callback_start_sem; + PBD::Semaphore _callback_done_sem; + PBD::Semaphore _cleanup_sem; + /** The number of processing threads that are asleep */ volatile gint _execution_tokens; + /** The number of unprocessed nodes that do not feed any other node; updated during processing */ volatile gint _finished_refcount; + /** The initial number of nodes that do not feed any other node (for each chain) */ volatile gint _init_finished_refcount[2]; bool _graph_empty; // chain swapping - Glib::Mutex _swap_mutex; - Glib::Cond _cleanup_cond; + Glib::Threads::Mutex _swap_mutex; + Glib::Threads::Cond _cleanup_cond; volatile int _current_chain; volatile int _pending_chain; volatile int _setup_chain; @@ -131,14 +129,17 @@ private: framepos_t _process_start_frame; framepos_t _process_end_frame; bool _process_can_record; - bool _process_rec_monitors_input; bool _process_non_rt_pending; int _process_declick; bool _process_silent; bool _process_noroll; - int _process_retval; + int _process_retval; bool _process_need_butler; + + // enginer / thread connection + PBD::ScopedConnectionList engine_connections; + void engine_stopped (); }; } // namespace