mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
invert-selection: if tracks are selected, invert selection at that level, unless in internal edit mode
This commit is contained in:
parent
510a0314cf
commit
5ca53856ab
1 changed files with 29 additions and 11 deletions
|
|
@ -1713,7 +1713,6 @@ Editor::invert_selection_in_track ()
|
||||||
void
|
void
|
||||||
Editor::invert_selection ()
|
Editor::invert_selection ()
|
||||||
{
|
{
|
||||||
list<Selectable *> touched;
|
|
||||||
|
|
||||||
if (internal_editing()) {
|
if (internal_editing()) {
|
||||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||||
|
|
@ -1725,6 +1724,24 @@ Editor::invert_selection ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!selection->tracks.empty()) {
|
||||||
|
|
||||||
|
TrackViewList inverted;
|
||||||
|
|
||||||
|
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
||||||
|
if (!(*iter)->selected()) {
|
||||||
|
inverted.push_back (*iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
begin_reversible_selection_op (X_("Invert Track Selection"));
|
||||||
|
selection->set (inverted);
|
||||||
|
commit_reversible_selection_op ();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
list<Selectable *> touched;
|
||||||
|
|
||||||
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
||||||
if ((*iter)->hidden()) {
|
if ((*iter)->hidden()) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1732,10 +1749,11 @@ Editor::invert_selection ()
|
||||||
(*iter)->get_inverted_selectables (*selection, touched);
|
(*iter)->get_inverted_selectables (*selection, touched);
|
||||||
}
|
}
|
||||||
|
|
||||||
begin_reversible_selection_op (X_("Invert Selection"));
|
begin_reversible_selection_op (X_("Invert ObjectSelection"));
|
||||||
selection->set (touched);
|
selection->set (touched);
|
||||||
commit_reversible_selection_op ();
|
commit_reversible_selection_op ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @param start Start time in session samples.
|
/** @param start Start time in session samples.
|
||||||
* @param end End time in session samples.
|
* @param end End time in session samples.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue