#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:
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;
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&);