add support for 'positive' guard points in ControlList
This commit is contained in:
parent
c98561e95c
commit
3a174ff914
|
@ -562,9 +562,7 @@ ControlList::add_guard_point (timepos_t const & time, timecnt_t const & offset)
|
|||
return;
|
||||
}
|
||||
|
||||
assert (offset <= timecnt_t());
|
||||
|
||||
if (!offset.is_zero()) {
|
||||
if (offset.is_negative()) {
|
||||
/* check if there are points between when + offset .. when */
|
||||
ControlEvent cp (when + offset, 0.0);
|
||||
iterator s;
|
||||
|
@ -577,6 +575,19 @@ ControlList::add_guard_point (timepos_t const & time, timecnt_t const & offset)
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* check if there are points between when + offset .. when */
|
||||
ControlEvent cp (when + offset, 0.0);
|
||||
iterator s;
|
||||
iterator e;
|
||||
if ((s = upper_bound (_events.begin(), _events.end(), &cp, time_comparator)) != _events.end()) {
|
||||
cp.when = when;
|
||||
e = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
|
||||
if (s != e) {
|
||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 add_guard_point, none added, found event between %2 and %3\n", this, when.earlier (offset), when));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* don't do this again till the next write pass,
|
||||
|
|
Loading…
Reference in New Issue