13
0

Remove duplicated code.

git-svn-id: svn://localhost/ardour2/branches/3.0@8553 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-01-19 23:05:30 +00:00
parent f8d3b1f7a7
commit 184d5167db
2 changed files with 2 additions and 59 deletions

View File

@ -4569,7 +4569,7 @@ Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackVie
RegionSelection
Editor::get_regions_from_selection ()
{
return add_route_group_regions_to_selection (selection->regions);
return get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.property_id);
}
/** Get regions using the following method:
@ -4650,63 +4650,7 @@ Editor::get_regions_from_selection_and_entered ()
regions.add (entered_regionview);
}
regions = add_route_group_regions_to_selection (regions);
return regions;
}
RegionSelection
Editor::add_route_group_regions_to_selection (RegionSelection regions)
{
TrackViewList tracks;
vector<boost::shared_ptr<Region> > equivalent_regions;
RegionSelection edit_group_regions;
/* 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 = regions.begin (); i != regions.end(); ++i) {
RouteGroup* g = (*i)->get_time_axis_view().route_group ();
if (g && g->is_active() && g->is_edit()) {
/* get tracks in the group */
tracks.add (axis_views_from_routes (g->route_list()));
}
/* iterate over the track list and get the equivalent regions for the current region */
for (TrackViewList::iterator tr = tracks.begin (); tr != tracks.end(); ++tr) {
if ( (*tr) == &(*i)->get_time_axis_view()) {
/* looking in same track as the original */
continue;
}
boost::shared_ptr<Playlist> pl;
if ((pl = (*tr)->playlist()) != 0) {
pl->get_equivalent_regions ((*i)->region(), equivalent_regions);
}
/* convert the regions to region views */
for (vector<boost::shared_ptr<Region> >::iterator r = equivalent_regions.begin(); r != equivalent_regions.end(); ++r) {
RegionView* rv;
if ((rv = (*tr)->view()->find_view (*r)) != 0) {
edit_group_regions.add (rv);
}
}
}
equivalent_regions.clear();
tracks.clear();
}
regions.merge(edit_group_regions);
return regions;
return get_equivalent_regions (regions, ARDOUR::Properties::edit.property_id);
}
void

View File

@ -1978,7 +1978,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
RegionSelection get_regions_from_selection ();
RegionSelection get_regions_from_selection_and_edit_point ();
RegionSelection get_regions_from_selection_and_entered ();
RegionSelection add_route_group_regions_to_selection (RegionSelection regions);
void start_updating_meters ();
void stop_updating_meters ();