Apply master-value to automation on disconnect.
[ardour.git] / libs / evoral / src / ControlList.cpp
index ce8ea89fc9d347aa657e7fa3e212e3556dbe26ca..92234a6ea7a84fdcd8f12e8c6cda80038fa62c1d 100644 (file)
@@ -250,6 +250,19 @@ ControlList::extend_to (double when)
        return true;
 }
 
+void
+ControlList::y_transform (boost::function<double(double)> callback)
+{
+       {
+               Glib::Threads::RWLock::WriterLock lm (_lock);
+               for (iterator i = _events.begin(); i != _events.end(); ++i) {
+                       (*i)->value = callback ((*i)->value);
+               }
+               mark_dirty ();
+       }
+       maybe_signal_changed ();
+}
+
 void
 ControlList::_x_scale (double factor)
 {