mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Fix things so that selecting a region always selects equivalent regions in the same edit group, even if the appropriate tracks aren't selected at the time.
git-svn-id: svn://localhost/ardour2/trunk@2523 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4848acedee
commit
61872c5663
5 changed files with 70 additions and 29 deletions
|
|
@ -285,17 +285,45 @@ Editor::get_relevant_tracks (set<RouteTimeAxisView*>& relevant_tracks)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call a slot for a given `basis' track and also for any track that is in the same
|
||||
* active edit group.
|
||||
* @param sl Slot to call.
|
||||
* @param basis Basis track.
|
||||
*/
|
||||
|
||||
void
|
||||
Editor::mapover_tracks (slot<void,RouteTimeAxisView&,uint32_t> sl)
|
||||
Editor::mapover_tracks (slot<void, RouteTimeAxisView&, uint32_t> sl, TimeAxisView* basis)
|
||||
{
|
||||
set<RouteTimeAxisView*> relevant_tracks;
|
||||
RouteTimeAxisView* route_basis = dynamic_cast<RouteTimeAxisView*> (basis);
|
||||
if (route_basis == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
get_relevant_tracks (relevant_tracks);
|
||||
/* work out the tracks that we will call the slot for; use
|
||||
a set here as it will disallow possible duplicates of the
|
||||
basis track */
|
||||
set<RouteTimeAxisView*> tracks;
|
||||
|
||||
uint32_t sz = relevant_tracks.size();
|
||||
/* always call for the basis */
|
||||
tracks.insert (route_basis);
|
||||
|
||||
for (set<RouteTimeAxisView*>::iterator rti = relevant_tracks.begin(); rti != relevant_tracks.end(); ++rti) {
|
||||
sl (**rti, sz);
|
||||
RouteGroup* group = route_basis->route()->edit_group();
|
||||
if (group && group->is_active()) {
|
||||
|
||||
/* the basis is a member of an active edit group; find other members */
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
RouteTimeAxisView* v = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
if (v && v->route()->edit_group() == group) {
|
||||
tracks.insert (v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* call the slots */
|
||||
uint32_t const sz = tracks.size ();
|
||||
for (set<RouteTimeAxisView*>::iterator i = tracks.begin(); i != tracks.end(); ++i) {
|
||||
sl (**i, sz);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -331,7 +359,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t ignored,
|
|||
void
|
||||
Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions)
|
||||
{
|
||||
mapover_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions));
|
||||
mapover_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_trackview());
|
||||
|
||||
/* add clicked regionview since we skipped all other regions in the same track as the one it was in */
|
||||
|
||||
|
|
@ -410,12 +438,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
case Selection::Set:
|
||||
if (!clicked_regionview->get_selected()) {
|
||||
|
||||
if (selection->selected (clicked_routeview)) {
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
} else {
|
||||
all_equivalent_regions.push_back (clicked_regionview);
|
||||
}
|
||||
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
selection->set (all_equivalent_regions);
|
||||
commit = true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue