UI: Add editor_mixer route pointer to session so all UIs can know the same current_st...
[ardour.git] / libs / ardour / ardour / automation_watch.h
index 2dfadf6426f6a8e7555d493ce23afced20a21c7c..960e29943cec55b47e9b537e9747cb83b6257233 100644 (file)
@@ -17,9 +17,9 @@
 
 */
 
-#include <list>
+#include <set>
 #include <boost/shared_ptr.hpp>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <sigc++/signal.h>
 
 #include "pbd/signals.h"
@@ -30,7 +30,7 @@ namespace ARDOUR {
 
 class AutomationControl;
 
-class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList {
+class LIBARDOUR_API AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList {
   public:
     static AutomationWatch& instance();
 
@@ -41,17 +41,20 @@ class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr,
     gint timer ();
 
   private:
-    typedef std::list<boost::shared_ptr<ARDOUR::AutomationControl> > AutomationWatches;
+    typedef std::set<boost::shared_ptr<ARDOUR::AutomationControl> > AutomationWatches;
 
     AutomationWatch ();
     ~AutomationWatch();
 
     static AutomationWatch* _instance;
-    Glib::Thread*           _thread;
+    Glib::Threads::Thread*  _thread;
+    framepos_t              _last_time;
     bool                    _run_thread;
     AutomationWatches        automation_watches;
-    Glib::Mutex              automation_watch_lock;
+    Glib::Threads::Mutex     automation_watch_lock;
+    PBD::ScopedConnection    transport_connection;
 
+    void transport_state_change ();
     void remove_weak_automation_watch (boost::weak_ptr<ARDOUR::AutomationControl>);
     void thread ();
 };