add AudioBackendNativeThread to serve the same role as jack_native_thread_t
[ardour.git] / libs / ardour / ardour / automation_list.h
index 9a5420e74bf8f43548a00b2bbdcfab50654a52b5..71eddda6dd24fe59ee5596f07a96ed5620f5bbcf 100644 (file)
 #include <list>
 #include <cmath>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/undo.h"
 #include "pbd/xml++.h"
 #include "pbd/statefuldestructible.h"
+#include "pbd/properties.h"
 
 #include "ardour/ardour.h"
 
 
 namespace ARDOUR {
 
+class AutomationList;
+
+/** A SharedStatefulProperty for AutomationLists */
+class AutomationListProperty : public PBD::SharedStatefulProperty<AutomationList>
+{
+public:
+       AutomationListProperty (PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > d, Ptr p)
+               : PBD::SharedStatefulProperty<AutomationList> (d.property_id, p)
+       {}
+
+       AutomationListProperty (PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > d, Ptr o, Ptr c)
+               : PBD::SharedStatefulProperty<AutomationList> (d.property_id, o, c)
+       {}
+       
+       PBD::PropertyBase* clone () const;
+       
+private:
+       /* No copy-construction nor assignment */
+       AutomationListProperty (AutomationListProperty const &);
+       AutomationListProperty& operator= (AutomationListProperty const &);
+};
+
 class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlList
 {
   public:
@@ -64,8 +87,8 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
                return (_state & Play) || ((_state & Touch) && !touching());
        }
        bool automation_write () const {
-                return ((_state & Write) || ((_state & Touch) && touching()));
-        }
+               return ((_state & Write) || ((_state & Touch) && touching()));
+       }
 
        PBD::Signal0<void> StateChanged;
 
@@ -73,15 +96,17 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
 
        void start_touch (double when);
        void stop_touch (bool mark, double when);
-       bool touching() const { return g_atomic_int_get (&_touching); }
+        bool touching() const { return g_atomic_int_get (const_cast<gint*>(&_touching)); }
        bool writing() const { return _state == Write; }
-        bool touch_enabled() const { return _state == Touch; }
+       bool touch_enabled() const { return _state == Touch; }
 
-       XMLNode& get_state (); 
+       XMLNode& get_state ();
        int set_state (const XMLNode &, int version);
        XMLNode& state (bool full);
        XMLNode& serialize_events ();
 
+       bool operator!= (const AutomationList &) const;
+
   private:
        void create_curve_if_necessary ();
        int deserialize_events (const XMLNode&);