13
0

coreselection: fix thinko

The core selection can be (a) stripables (b) automation controls (c) possibly a combination of both

Any given selection op might pass (a) or (b) or (c), so we need to handle the
case where (a) is null.
This commit is contained in:
Paul Davis 2024-08-05 20:14:23 -06:00
parent c2bf45a033
commit 3f1486fa12

View File

@ -47,6 +47,7 @@ CoreSelection::do_select (std::shared_ptr<Stripable> s, std::shared_ptr<Automati
* then hidden
*/
if (s) {
if (s->is_hidden()) {
return false;
}
@ -73,11 +74,12 @@ CoreSelection::do_select (std::shared_ptr<Stripable> s, std::shared_ptr<Automati
if (!c && with_group) {
if (!not_allowed_in_group || !r->route_group() || r->route_group() != not_allowed_in_group) {
if (r->route_group() && r->route_group()->is_select() && r->route_group()->is_active()) {
for (auto & ri : *(r->route_group()->route_list())) {
RouteGroup* group = r->route_group();
if (group && group->is_select() && group->is_active()) {
for (auto & ri : *(group->route_list())) {
if (ri != r) {
sl.push_back (ri);
}
@ -92,6 +94,7 @@ CoreSelection::do_select (std::shared_ptr<Stripable> s, std::shared_ptr<Automati
*/
sl.push_back (s);
}
switch (op) {
case SelectionAdd:
@ -260,7 +263,7 @@ CoreSelection::select_prev_stripable (bool mixer_order, bool routes_only)
bool
CoreSelection::toggle (StripableList& sl, std::shared_ptr<AutomationControl> c)
{
assert (sl.size() == 1 || !c);
assert (sl.size() <= 1 || !c);
bool changed = false;
StripableList sl2;
@ -288,7 +291,7 @@ CoreSelection::toggle (StripableList& sl, std::shared_ptr<AutomationControl> c)
bool
CoreSelection::set (StripableList& sl, std::shared_ptr<AutomationControl> c, std::vector<std::shared_ptr<Stripable> > & removed)
{
assert (sl.size() == 1 || !c);
assert (sl.size() <= 1 || !c);
bool changed = false;
@ -331,7 +334,7 @@ CoreSelection::set (StripableList& sl, std::shared_ptr<AutomationControl> c, std
bool
CoreSelection::add (StripableList& sl, std::shared_ptr<AutomationControl> c)
{
assert (sl.size() == 1 || !c);
assert (sl.size() <= 1 || !c);
bool changed = false;
@ -362,7 +365,7 @@ CoreSelection::add (StripableList& sl, std::shared_ptr<AutomationControl> c)
bool
CoreSelection::remove (StripableList & sl, std::shared_ptr<AutomationControl> c)
{
assert (sl.size() == 1 || !c);
assert (sl.size() <= 1 || !c);
bool changed = false;
{