Extend API to allow calling new_midi_source_path() with source_lock held
[ardour.git] / libs / ardour / ardour / graph.h
index dc531b368022bcac692267c17d6193e7f7fee990..9dfc89398d65f300f4af5c24849779ba7acdb0aa 100644 (file)
@@ -45,7 +45,7 @@ class Graph;
 
 class Route;
 class Session;
-class GraphEdges;      
+class GraphEdges;
 
 typedef boost::shared_ptr<GraphNode> node_ptr_t;
 
@@ -57,18 +57,13 @@ class LIBARDOUR_API Graph : public SessionHandleRef
 public:
        Graph (Session & session);
 
-       void prep();
        void trigger (GraphNode * n);
        void rechain (boost::shared_ptr<RouteList>, 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);
@@ -89,10 +84,14 @@ protected:
        virtual void session_going_away ();
 
 private:
-       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];
 
@@ -101,12 +100,11 @@ private:
        std::vector<GraphNode *> _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;
@@ -136,6 +134,10 @@ private:
        bool _process_noroll;
        int  _process_retval;
        bool _process_need_butler;
+
+       // enginer / thread connection
+       PBD::ScopedConnectionList engine_connections;
+       void engine_stopped ();
 };
 
 } // namespace