13
0

add a "guard" point after a write/touch automation insertion, preserving the shape of the later segment of the existing line

git-svn-id: svn://localhost/ardour2/branches/3.0@13507 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-11-15 16:22:43 +00:00
parent a6968f8d2c
commit a0f00d7d22

View File

@ -493,6 +493,27 @@ ControlList::add (double when, double value)
}
++most_recent_insert_iterator;
}
if (most_recent_insert_iterator != _events.end()) {
if ((*most_recent_insert_iterator)->when - when > 64) {
/* next control point is some
* distance from where our new
* point is going to go - add a
* new point to avoid changing
* the shape of the line too
* much. the insert iterator needs
* to point to the new control
* point so that our insert
* will happen correctly.
*/
most_recent_insert_iterator = _events.insert (most_recent_insert_iterator,
new ControlEvent (when+1, (*most_recent_insert_iterator)->value));
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added post-erase guard point @ %2 = %3\n",
this, when+1,
(*most_recent_insert_iterator)->value));
}
}
} else {
/* not in a write pass: figure out the iterator we should insert in front of */
@ -599,7 +620,27 @@ ControlList::add (double when, double value)
}
}
}
if (most_recent_insert_iterator != _events.end()) {
if ((*most_recent_insert_iterator)->when - when > 64) {
/* next control point is some
* distance from where our new
* point is going to go - add a
* new point to avoid changing
* the shape of the line too
* much. the insert iterator needs
* to point to the new control
* point so that our insert
* will happen correctly.
*/
most_recent_insert_iterator = _events.insert (most_recent_insert_iterator,
new ControlEvent (when+1, (*most_recent_insert_iterator)->value));
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added insert-post-erase guard point @ %2 = %3\n",
this, when+1,
(*most_recent_insert_iterator)->value));
}
}
if (!done) {
EventList::iterator x = _events.insert (most_recent_insert_iterator, new ControlEvent (when, value));
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 inserted new value before MRI, size now %2\n", this, _events.size()));