Make ControlList::paste const-correct.
authorDavid Robillard <d@drobilla.net>
Sat, 15 Nov 2014 23:53:53 +0000 (18:53 -0500)
committerDavid Robillard <d@drobilla.net>
Mon, 17 Nov 2014 03:35:45 +0000 (22:35 -0500)
libs/evoral/evoral/ControlList.hpp
libs/evoral/src/ControlList.cpp

index debd4989e0b31f3f08062df39350ef135dde4148..daa4aa93a6bf2f38946dfaede0459731aa5df875 100644 (file)
@@ -139,7 +139,7 @@ public:
        boost::shared_ptr<ControlList> copy (double, double);
        void clear (double, double);
 
-       bool paste (ControlList&, double position, float times);
+       bool paste (const ControlList&, double position, float times);
 
        void set_yrange (double min, double max) {
                _min_yval = min;
index deabd9d1cc493ac7cd3bd564032991ebc772e1e5..67172617136944001ba6bfa2f7be759b97741e05 100644 (file)
@@ -1619,7 +1619,7 @@ ControlList::clear (double start, double end)
 
 /** @param pos Position in model coordinates */
 bool
-ControlList::paste (ControlList& alist, double pos, float /*times*/)
+ControlList::paste (const ControlList& alist, double pos, float /*times*/)
 {
        if (alist._events.empty()) {
                return false;
@@ -1634,7 +1634,7 @@ ControlList::paste (ControlList& alist, double pos, float /*times*/)
 
                where = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
 
-               for (iterator i = alist.begin();i != alist.end(); ++i) {
+               for (const_iterator i = alist.begin();i != alist.end(); ++i) {
                        _events.insert (where, new ControlEvent( (*i)->when+pos,( *i)->value));
                        end = (*i)->when + pos;
                }