13
0

ripple: tweak behavior of Locations::ripple

* ignore session, punch and loop ranges
* support positive and negative ripple distances
* move either or both (start+end) of a range marker
This commit is contained in:
Ben Loftis 2022-03-14 19:11:47 -05:00
parent ba9bbf81ba
commit 4cbdb30d56

View File

@ -1580,18 +1580,7 @@ Locations::ripple (timepos_t const & at, timecnt_t const & distance, bool includ
for (LocationList::iterator i = copy.begin(); i != copy.end(); ++i) {
/* keep session range markers covering entire region if
a ripple "extends" the session.
*/
if (distance.is_positive() && (*i)->is_session_range()) {
/* Don't move start unless it occurs after the ripple point.
*/
if ((*i)->start() >= at) {
(*i)->set ((*i)->start() + distance, (*i)->end() + distance);
} else {
(*i)->set_end ((*i)->end() + distance);
}
if ( (*i)->is_session_range() || (*i)->is_auto_punch() || (*i)->is_auto_loop() ) {
continue;
}
@ -1606,11 +1595,13 @@ Locations::ripple (timepos_t const & at, timecnt_t const & distance, bool includ
}
if ((*i)->start() >= at) {
(*i)->set_start ((*i)->start().earlier (distance));
(*i)->set_start ((*i)->start() + distance);
if (!(*i)->is_mark()) {
(*i)->set_end ((*i)->end().earlier (distance));
(*i)->set_end ((*i)->end() + distance);
}
} else if ((*i)->end() >= at) {
(*i)->set_end ((*i)->end() + distance);
}
if (locked) {