From 960e5a3c7cb2ed1f0f2a8be0c417c6ee61e78f27 Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Tue, 1 Jul 2014 20:40:40 +0100 Subject: [PATCH] Ripple mode: ripple all after start of first selected region Ripple drags should affect all regions which start at or after the beginning of the first selected region, not just those which start after its end. --- gtk2_ardour/editor_drag.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 91bfb2ce0c..6fec1f77f7 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1572,10 +1572,16 @@ RegionSpliceDrag::aborted (bool) void RegionRippleDrag::add_all_after_to_views(TimeAxisView *tav, framepos_t where, const RegionSelection &exclude, bool drag_in_progress) { + + boost::shared_ptr rl = tav->playlist()->regions_with_start_within (Evoral::Range(where, max_framepos)); + + RouteTimeAxisView* rtv = dynamic_cast(tav); RegionSelection to_ripple; - TrackViewList tracks; - tracks.push_back (tav); - _editor->get_regions_after (to_ripple, where, tracks); + for (RegionList::iterator i = rl->begin(); i != rl->end(); ++i) { + if ((*i)->position() >= where) { + to_ripple.push_back (rtv->view()->find_view(*i)); + } + } for (RegionSelection::iterator i = to_ripple.begin(); i != to_ripple.end(); ++i) { if (!exclude.contains (*i)) { @@ -1691,7 +1697,7 @@ RegionRippleDrag::RegionRippleDrag (Editor* e, ArdourCanvas::Item* i, RegionView assert (first_selected_on_this_track); // we should always find the region in one of the playlists... add_all_after_to_views ( &first_selected_on_this_track->get_time_axis_view(), - first_selected_on_this_track->region()->position() + first_selected_on_this_track->region()->length(), + first_selected_on_this_track->region()->position(), selected_regions, false); }