From 32dd2a43d803cd0d9603958377cb39f585f14643 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 24 Aug 2009 20:56:24 +0000 Subject: [PATCH] Don't use the edit position to gather regions to cut, otherwise it can be confusing. git-svn-id: svn://localhost/ardour2/branches/3.0@5585 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 33 ++++++++++++++++----------------- gtk2_ardour/editor.h | 2 +- gtk2_ardour/editor_ops.cc | 4 ++-- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c262a763f2..97635935ea 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4590,12 +4590,12 @@ Editor::get_regions_after (RegionSelection& rs, nframes64_t where, const TrackSe * - selected or * - the entered_regionview (if allow_entered == true) or * - under the preferred edit position AND on a selected track, or on a track - * which is in the same active edit-enable route group as a selected region. + * which is in the same active edit-enable route group as a selected region (if allow_edit_position == true) * @param rs Returned region list. * @param allow_entered true to include the entered_regionview in the list. */ void -Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered) +Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered, bool allow_edit_position) { /* Start with selected regions */ rs = selection->regions; @@ -4605,23 +4605,22 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered) rs.add (entered_regionview); } - TrackSelection tracks = selection->tracks; - - RegionSelection to_map = rs; - - /* tracks is currently the set of selected tracks; add any other tracks that - * have regions that are in the same edit-activated route group as one of - * our regions */ - for (RegionSelection::iterator i = to_map.begin (); i != to_map.end(); ++i) { - - RouteGroup* g = (*i)->get_time_axis_view().route_group (); - if (g && g->active_property (RouteGroup::Edit)) { - tracks.add (axis_views_from_routes (g->route_list())); + if (allow_edit_position) { + + TrackSelection tracks = selection->tracks; + + /* tracks is currently the set of selected tracks; add any other tracks that + * have regions that are in the same edit-activated route group as one of + * our regions */ + for (RegionSelection::iterator i = rs.begin (); i != rs.end(); ++i) { + + RouteGroup* g = (*i)->get_time_axis_view().route_group (); + if (g && g->active_property (RouteGroup::Edit)) { + tracks.add (axis_views_from_routes (g->route_list())); + } } - } - /* now find regions that are at the edit position on those tracks */ - for (RegionSelection::iterator i = to_map.begin (); i != to_map.end(); ++i) { + /* now find regions that are at the edit position on those tracks */ nframes64_t const where = get_preferred_edit_position (); get_regions_at (rs, where, tracks); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 3cadb9d4ad..729211ed9d 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1976,7 +1976,7 @@ public: void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; - void get_regions_for_action (RegionSelection&, bool allowed_entered_regionview = false); + void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true); sigc::connection fast_screen_update_connection; gint start_updating (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index f6d9bd7950..8d68a32305 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3915,9 +3915,9 @@ Editor::cut_copy (CutCopyOp op) /* we only want to cut regions if some are selected */ if (!selection->regions.empty()) { - get_regions_for_action (rs); + get_regions_for_action (rs, false, false); } - + switch (current_mouse_mode()) { case MouseObject: if (!rs.empty() || !selection->points.empty()) {