Merge branch 'master' of git.ardour.org:ardour/ardour
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 3 Apr 2013 18:16:42 +0000 (14:16 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 3 Apr 2013 18:16:42 +0000 (14:16 -0400)
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_ops.cc
gtk2_ardour/rhythm_ferret.cc

index 4f3390e752428b213fc2d0cd6f748d5eb22f4028..3b747bd9121a5d921cfec70b772e4f3a0baf2d6c 100644 (file)
@@ -4588,32 +4588,16 @@ Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackVie
        }
 }
 
-/** Start with regions that are selected.  Then add equivalent regions
- *  on tracks in the same active edit-enabled route group as any of
- *  the regions that we started with.
- */
-
-RegionSelection
-Editor::get_regions_from_selection ()
-{
-       return get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
-}
-
 /** Get regions using the following method:
  *
- *  Make an initial region list using the selected regions, unless
+ *  Make a region list using the selected regions, unless
  *  the edit point is `mouse' and the mouse is over an unselected
- *  region.  In this case, start with just that region.
- *
- *  Then, add equivalent regions in active edit groups to the region list.
- *
- *  Then, search the list of selected tracks to find any selected tracks which
- *  do not contain regions already in the region list. If there are no selected
- *  tracks and 'No Selection = All Tracks' is active, search all tracks rather
- *  than just the selected.
+ *  region.  In this case, use just that region.
  *
- *  Add any regions that are under the edit point on these tracks to get the
- *  returned region list.
+ *  If the edit point is not 'mouse', and there are no regions selected,
+ *  search the list of selected tracks and return regions that are under
+ *  the edit point on these tracks. If there are no selected tracks and
+ *  'No Selection = All Tracks' is active, search all tracks,
  *
  *  The rationale here is that the mouse edit point is special in that
  *  its position describes both a time and a track; the other edit
@@ -4635,48 +4619,25 @@ Editor::get_regions_from_selection_and_edit_point ()
                regions = selection->regions;
        }
 
-       TrackViewList tracks;
 
-       if (_edit_point != EditAtMouse) {
-               tracks = selection->tracks;
-       }
+       if (regions.empty() && _edit_point != EditAtMouse) {
+               TrackViewList tracks = selection->tracks;
 
-       /* Add any other regions that are in the same
-          edit-activated route group as one of our regions.
-        */
-       regions = get_equivalent_regions (regions, ARDOUR::Properties::select.property_id);
-       framepos_t const where = get_preferred_edit_position ();
-
-       if (_route_groups->all_group_active_button().get_active() && tracks.empty()) {
-               /* tracks is empty (no track selected), and 'No Selection = All Tracks'
-                * is enabled, so consider all tracks
-                */
-               tracks = track_views; 
-       }
-
-       if (!tracks.empty()) {
-               /* now search the selected tracks for tracks which don't
-                  already contain regions to be acted upon, and get regions at
-                  the edit point on those tracks too.
-                */
-               TrackViewList tracks_without_relevant_regions;
-
-               for (TrackViewList::iterator t = tracks.begin (); t != tracks.end (); ++t) {
-                       if (!regions.involves (**t)) {
-                               /* there are no equivalent regions on this track */
-                               tracks_without_relevant_regions.push_back (*t);
-                       }
+               if (_route_groups->all_group_active_button().get_active() && tracks.empty()) {
+                       /* tracks is empty (no track selected), and 'No Selection = All Tracks'
+                        * is enabled, so consider all tracks
+                        */
+                       tracks = track_views; 
                }
 
-               if (!tracks_without_relevant_regions.empty()) {
-                       /* there are some selected tracks with neither selected
-                        * regions or their equivalents: act upon all regions in
-                        * those tracks
-                        */
-                       get_regions_at (regions, where, tracks_without_relevant_regions);
+               if (!tracks.empty()) {
+                       /* no region selected or entered, but some selected tracks:
+                        * act on all regions on the selected tracks at the edit point
+                        *
+                       framepos_t const where = get_preferred_edit_position ();
+                       get_regions_at(regions, where, tracks);
                }
        }
-
        return regions;
 }
 
@@ -4694,7 +4655,7 @@ Editor::get_regions_from_selection_and_entered ()
                regions.add (entered_regionview);
        }
 
-       return get_equivalent_regions (regions, ARDOUR::Properties::select.property_id);
+       return regions;
 }
 
 void
index 8ecd5cc07de48dba5ed7ecaeb89b6e4d2788bdf3..6155dea745b4cf0972d623f751d5c173a93ae539 100644 (file)
@@ -2042,7 +2042,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
        void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
 
-       RegionSelection get_regions_from_selection ();
        RegionSelection get_regions_from_selection_and_edit_point ();
        RegionSelection get_regions_from_selection_and_entered ();
 
index 415614b81166718ccc1858b3b8d4d32018db6f7a..9797c0ef7ee612a30af8d7e002d2e9ee2ef75fad 100644 (file)
@@ -3737,7 +3737,7 @@ Editor::cut_copy (CutCopyOp op)
        /* we only want to cut regions if some are selected */
 
        if (!selection->regions.empty()) {
-               rs = get_regions_from_selection ();
+               rs = selection->regions;
        }
 
        switch (effective_mouse_mode()) {
index bad603b03038039870bfad0f66ea70794223507e..5a59b5ce5dfc3979e6e06c37e2387626e52f8a83 100644 (file)
@@ -345,7 +345,7 @@ RhythmFerret::do_split_action ()
           performed on the selection only (without entered_regionview or the edit point
           being considered)
        */
-       RegionSelection regions = editor.get_regions_from_selection();
+       RegionSelection regions = editor.selection->regions;
 
        if (regions.empty()) {
                return;