libardour support for timespan realtime export
[ardour.git] / libs / ardour / ardour / graph.h
index 763723c792eb4e0dda2653c7b86fec5f45bec71a..239f9ad1abec406c2976e2d1dc48d83cdad47221 100644 (file)
 #include <boost/shared_ptr.hpp>
 
 #include <glib.h>
-#include <cassert>
 
 #include "pbd/semutils.h"
 
+#include "ardour/libardour_visibility.h"
 #include "ardour/types.h"
 #include "ardour/audio_backend.h"
 #include "ardour/session_handle.h"
@@ -45,14 +45,14 @@ class Graph;
 
 class Route;
 class Session;
-class GraphEdges;      
+class GraphEdges;
 
 typedef boost::shared_ptr<GraphNode> 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);
@@ -89,7 +89,7 @@ protected:
        virtual void session_going_away ();
 
 private:
-       volatile bool        _quit_threads;
+       volatile bool        _threads_active;
 
        void reset_thread_list ();
        void drop_threads ();
@@ -101,12 +101,12 @@ 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;
+       PBD::Semaphore _cleanup_sem;
 
        /** The number of processing threads that are asleep */
        volatile gint _execution_tokens;
@@ -136,6 +136,10 @@ private:
        bool _process_noroll;
        int  _process_retval;
        bool _process_need_butler;
+
+       // enginer / thread connection
+       PBD::ScopedConnectionList engine_connections;
+       void engine_stopped ();
 };
 
 } // namespace