make AutomationList::operator==() private and abort() as its core, because it should...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 9 Jul 2014 18:28:01 +0000 (14:28 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 9 Jul 2014 18:30:38 +0000 (14:30 -0400)
Also make AutomationList::operator=() use ControlList::operator=() rather than try to reimplement it

libs/ardour/ardour/automation_list.h
libs/ardour/automation_list.cc

index 6e7b0007cd6fe78de4033e76c73a201c2b8fe75b..72c26420c06fff1211b6a5d7fca307a9cf803b1e 100644 (file)
@@ -21,6 +21,7 @@
 #define __ardour_automation_event_h__
 
 #include <stdint.h>
+#include <cstdlib>
 #include <list>
 #include <cmath>
 
@@ -71,7 +72,6 @@ class LIBARDOUR_API AutomationList : public PBD::StatefulDestructible, public Ev
        virtual boost::shared_ptr<Evoral::ControlList> create(Evoral::Parameter id);
 
        AutomationList& operator= (const AutomationList&);
-       bool operator== (const AutomationList&);
 
        void thaw ();
 
@@ -116,6 +116,8 @@ class LIBARDOUR_API AutomationList : public PBD::StatefulDestructible, public Ev
        AutoState    _state;
        AutoStyle    _style;
        gint         _touching;
+
+       bool operator== (const AutomationList&) const { /* not called */ abort(); return false; }
 };
 
 } // namespace
index 32e69af7aeed9466ce606976004757415d091d90..e5a4493618b921a5ead23722e6b78b8b75c4382f 100644 (file)
@@ -137,26 +137,16 @@ AutomationList::create_curve_if_necessary()
        }
 }
 
-bool
-AutomationList::operator== (const AutomationList& other)
-{
-       return _events == other._events;
-}
-
 AutomationList&
 AutomationList::operator= (const AutomationList& other)
 {
        if (this != &other) {
 
-               _events.clear ();
-
-               for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) {
-                       _events.push_back (new Evoral::ControlEvent (**i));
-               }
 
-               _min_yval = other._min_yval;
-               _max_yval = other._max_yval;
-               _default_value = other._default_value;
+               ControlList::operator= (other);
+               _state = other._state;
+               _style = other._style;
+               _touching = other._touching;
 
                mark_dirty ();
                maybe_signal_changed ();