From 9e8b50f07539e77f10829f5e8b352b40a1eac309 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 9 Jul 2014 14:28:01 -0400 Subject: make AutomationList::operator==() private and abort() as its core, because it should never be called/used. Also make AutomationList::operator=() use ControlList::operator=() rather than try to reimplement it --- libs/ardour/ardour/automation_list.h | 4 +++- libs/ardour/automation_list.cc | 18 ++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h index 6e7b0007cd..72c26420c0 100644 --- a/libs/ardour/ardour/automation_list.h +++ b/libs/ardour/ardour/automation_list.h @@ -21,6 +21,7 @@ #define __ardour_automation_event_h__ #include +#include #include #include @@ -71,7 +72,6 @@ class LIBARDOUR_API AutomationList : public PBD::StatefulDestructible, public Ev virtual boost::shared_ptr 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 diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index 32e69af7ae..e5a4493618 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -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 (); -- cgit v1.2.3