improve and extend group selection logic
This commit is contained in:
parent
fa38a14120
commit
0e6764c4c8
@ -623,8 +623,9 @@ CoreSelection::get_stripables_for_op (std::shared_ptr<StripableList> sl, std::sh
|
|||||||
void
|
void
|
||||||
CoreSelection::get_stripables_for_op (StripableList& sl, std::shared_ptr<Stripable> target, bool (RouteGroup::*group_predicate)() const) const
|
CoreSelection::get_stripables_for_op (StripableList& sl, std::shared_ptr<Stripable> target, bool (RouteGroup::*group_predicate)() const) const
|
||||||
{
|
{
|
||||||
|
std::shared_ptr<Route> r (std::dynamic_pointer_cast<Route> (target));
|
||||||
|
|
||||||
if (_stripables.empty()) {
|
if (_stripables.empty()) {
|
||||||
std::shared_ptr<Route> r (std::dynamic_pointer_cast<Route> (target));
|
|
||||||
|
|
||||||
if (r) {
|
if (r) {
|
||||||
RouteGroup* rg = r->route_group();
|
RouteGroup* rg = r->route_group();
|
||||||
@ -634,6 +635,10 @@ CoreSelection::get_stripables_for_op (StripableList& sl, std::shared_ptr<Stripab
|
|||||||
sl.push_back (r);
|
sl.push_back (r);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/* target is not member of an active group that
|
||||||
|
shares the relevant property, and nothing is
|
||||||
|
selected, so use it and it alone.
|
||||||
|
*/
|
||||||
sl.push_back (target);
|
sl.push_back (target);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,11 +648,39 @@ CoreSelection::get_stripables_for_op (StripableList& sl, std::shared_ptr<Stripab
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
StripableAutomationControls sc;
|
|
||||||
get_stripables (sc);
|
|
||||||
|
|
||||||
for (auto & s : sc) {
|
if (target->is_selected()) {
|
||||||
sl.push_back (s.stripable);
|
/* Use full selection */
|
||||||
|
|
||||||
|
StripableAutomationControls sc;
|
||||||
|
get_stripables (sc);
|
||||||
|
|
||||||
|
for (auto & s : sc) {
|
||||||
|
sl.push_back (s.stripable);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/* target not selected but might be part of a group */
|
||||||
|
|
||||||
|
if (r) {
|
||||||
|
RouteGroup* rg = r->route_group();
|
||||||
|
|
||||||
|
if (rg && rg->is_active() && (rg->*group_predicate)()) {
|
||||||
|
for (auto & r : *rg->route_list()) {
|
||||||
|
sl.push_back (r);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Target not selected, and not part of an
|
||||||
|
* active group that shares the relevant
|
||||||
|
* property, so use it and it alone
|
||||||
|
*/
|
||||||
|
sl.push_back (target);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Base is not a route, use it and it alone */
|
||||||
|
sl.push_back (target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user