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
This commit is contained in:
Paul Davis 2014-07-09 14:28:01 -04:00
parent 2a852cfc75
commit 9e8b50f075
2 changed files with 7 additions and 15 deletions

View file

@ -21,6 +21,7 @@
#define __ardour_automation_event_h__ #define __ardour_automation_event_h__
#include <stdint.h> #include <stdint.h>
#include <cstdlib>
#include <list> #include <list>
#include <cmath> #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); virtual boost::shared_ptr<Evoral::ControlList> create(Evoral::Parameter id);
AutomationList& operator= (const AutomationList&); AutomationList& operator= (const AutomationList&);
bool operator== (const AutomationList&);
void thaw (); void thaw ();
@ -116,6 +116,8 @@ class LIBARDOUR_API AutomationList : public PBD::StatefulDestructible, public Ev
AutoState _state; AutoState _state;
AutoStyle _style; AutoStyle _style;
gint _touching; gint _touching;
bool operator== (const AutomationList&) const { /* not called */ abort(); return false; }
}; };
} // namespace } // namespace

View file

@ -137,26 +137,16 @@ AutomationList::create_curve_if_necessary()
} }
} }
bool
AutomationList::operator== (const AutomationList& other)
{
return _events == other._events;
}
AutomationList& AutomationList&
AutomationList::operator= (const AutomationList& other) AutomationList::operator= (const AutomationList& other)
{ {
if (this != &other) { if (this != &other) {
_events.clear ();
for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) { ControlList::operator= (other);
_events.push_back (new Evoral::ControlEvent (**i)); _state = other._state;
} _style = other._style;
_touching = other._touching;
_min_yval = other._min_yval;
_max_yval = other._max_yval;
_default_value = other._default_value;
mark_dirty (); mark_dirty ();
maybe_signal_changed (); maybe_signal_changed ();