Add API to run automation only (emit Changed signal).
[ardour.git] / libs / ardour / automation_list.cc
index 6285de28ea8bd5ff5c06a0d5ea2741d06e2c79d3..27bc64462e336debfbff88ed283e38c201a62d3d 100644 (file)
@@ -167,13 +167,14 @@ AutomationList&
 AutomationList::operator= (const AutomationList& other)
 {
        if (this != &other) {
-
+               ControlList::freeze ();
+               /* ControlList::operator= calls copy_events() which calls
+                * mark_dirty() and maybe_signal_changed()
+                */
                ControlList::operator= (other);
                _state = other._state;
                _touching = other._touching;
-
-               mark_dirty ();
-               maybe_signal_changed ();
+               ControlList::thaw ();
        }
 
        return *this;
@@ -342,7 +343,6 @@ XMLNode&
 AutomationList::state (bool full)
 {
        XMLNode* root = new XMLNode (X_("AutomationList"));
-       LocaleGuard lg;
 
        root->set_property ("automation-id", EventTypeMap::instance().to_symbol(_parameter));
        root->set_property ("id", id());
@@ -445,6 +445,7 @@ AutomationList::deserialize_events (const XMLNode& node)
                        ok = false;
                        break;
                }
+               y = std::min ((double)_desc.upper, std::max ((double)_desc.lower, y));
                fast_simple_add (x, y);
        }
 
@@ -464,7 +465,6 @@ AutomationList::deserialize_events (const XMLNode& node)
 int
 AutomationList::set_state (const XMLNode& node, int version)
 {
-       LocaleGuard lg;
        XMLNodeList nlist = node.children();
        XMLNode* nsos;
        XMLNodeIterator niter;
@@ -503,6 +503,7 @@ AutomationList::set_state (const XMLNode& node, int version)
                                continue;
                        }
 
+                       y = std::min ((double)_desc.upper, std::max ((double)_desc.lower, y));
                        fast_simple_add (x, y);
                }