X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fgraph.h;h=e6eae0750d7e7bce34e7c9eea530841f3fda4d39;hb=e5a181c323243a03338f5a9934a5df254986370d;hp=0a288d68d39db60c4a62c6f61d2113d0f450e73a;hpb=6a436fd826d1c9d88b60287696cc0836ccce35aa;p=ardour.git diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h index 0a288d68d3..e6eae0750d 100644 --- a/libs/ardour/ardour/graph.h +++ b/libs/ardour/ardour/graph.h @@ -29,13 +29,12 @@ #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,41 +45,29 @@ class Graph; class Route; class Session; -class GraphEdges; +class GraphEdges; typedef boost::shared_ptr node_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, GraphEdges const &); void dump (int chain); - void process(); void dec_ref(); - void restart_cycle(); - bool run_one(); void helper_thread(); - void main_thread(); - int silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool& need_butler); + int process_routes (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler); - int process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, - bool& need_butler); - - int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool non_rt_pending, int declick); + int routes_no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool non_rt_pending ); void process_one_route (Route * route); @@ -92,11 +79,14 @@ protected: virtual void session_going_away (); private: - std::list _thread_list; - volatile bool _quit_threads; + volatile bool _threads_active; void reset_thread_list (); void drop_threads (); + void restart_cycle(); + bool run_one(); + void main_thread(); + void prep(); node_list_t _nodes_rt[2]; @@ -105,12 +95,11 @@ private: std::vector _trigger_queue; pthread_mutex_t _trigger_mutex; - PBD::ProcessSemaphore _execution_sem; + PBD::Semaphore _execution_sem; /** Signalled to start a run of the graph for a process callback */ - PBD::ProcessSemaphore _callback_start_sem; - PBD::ProcessSemaphore _callback_done_sem; - PBD::ProcessSemaphore _cleanup_sem; + PBD::Semaphore _callback_start_sem; + PBD::Semaphore _callback_done_sem; /** The number of processing threads that are asleep */ volatile gint _execution_tokens; @@ -130,16 +119,18 @@ private: // parameter caches. pframes_t _process_nframes; - framepos_t _process_start_frame; - framepos_t _process_end_frame; + samplepos_t _process_start_sample; + samplepos_t _process_end_sample; bool _process_can_record; bool _process_non_rt_pending; - int _process_declick; - bool _process_silent; bool _process_noroll; int _process_retval; bool _process_need_butler; + + // enginer / thread connection + PBD::ScopedConnectionList engine_connections; + void engine_stopped (); }; } // namespace