diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-24 14:17:09 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-24 14:19:40 -0400 |
commit | 4fc37aa81870cd6411383795b5598c1edc280ef5 (patch) | |
tree | a98914118ff2d8be7126ffc9f4fd8b0cb7f626dd /gtk2_ardour/editor_selection.cc | |
parent | fe6b1732367a13f94a75d5343ebe1fa849047248 (diff) |
make track selection after set-range-selection-from-region-selection be sensible
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 0ea6e6f9ca..0f39bbe8ae 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1545,11 +1545,21 @@ Editor::set_selection_from_region () } selection->set (selection->regions.start(), selection->regions.end_frame()); + + /* find all the tracks that have selected regions */ + + set<TimeAxisView*> tracks; + + for (RegionSelection::const_iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + tracks.insert (&(*r)->get_time_axis_view()); + } + + TrackViewList tvl; + tvl.insert (tvl.end(), tracks.begin(), tracks.end()); + + /* and select them */ - //we must now select tracks, because otherwise set_selection_from_region would appear to do nothing - //perhaps too drastic; perhaps the user really only wants the region's track selected - //but I can't think of any use-case for that (why wouldn't you just select the region?) - select_all_tracks(); + selection->set (tvl); if (!Profile->get_sae()) { set_mouse_mode (Editing::MouseRange, false); |