From 4cbdb30d565e3157189e304eac8b6e5a33b342f5 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 14 Mar 2022 19:11:47 -0500 Subject: [PATCH] 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 --- libs/ardour/location.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index b73f0bf2ad..a959c8916a 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -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) {