Compatibility with old out-of-range automation-lane data
authorRobin Gareus <robin@gareus.org>
Tue, 4 Jul 2017 18:12:51 +0000 (20:12 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 4 Jul 2017 18:12:51 +0000 (20:12 +0200)
Ardour may have ignored log-scale for parameters 0..N and allowed
writing '0'. Force those values into the valid range on session load.
Also mark the list as "needs sorting" which removes potential duplicates.

libs/ardour/automation_list.cc
libs/evoral/src/ControlList.cpp

index 014b4c511bcbec35c4aee584b411fd0bf67529fb..8ceab4f3ea84dcc0e13fc40d3e34fb64b08df85e 100644 (file)
@@ -444,6 +444,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);
        }
 
@@ -501,6 +502,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);
                }
 
index 8bb1c125d2149e66967d616e79865221f73cb59e..a05c1f93081fc1ff605737decfbbf7863a550e30 100644 (file)
@@ -412,6 +412,9 @@ ControlList::fast_simple_add (double when, double value)
        _events.insert (_events.end(), new ControlEvent (when, value));
 
        mark_dirty ();
+       if (_frozen) {
+               _sort_pending = true;
+       }
 }
 
 void