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:
parent
a6968f8d2c
commit
a0f00d7d22
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user