GUI code changes to follow new CoreSelection API

This removes ::add_grouped_tracks() from Editor selection and
RouteProcessorSelection, since adding grouped stripables is now
a CoreSelection function, and should not be attempted by UI-side
elements
This commit is contained in:
Paul Davis 2024-08-02 11:50:14 -06:00
parent b21dd1212e
commit a06e519296
7 changed files with 92 additions and 184 deletions

View file

@ -68,26 +68,6 @@ RouteProcessorSelection::clear_routes ()
}
}
std::list<AxisView*>
RouteProcessorSelection::add_grouped_tracks (AxisView* r) const
{
std::list<AxisView*> rv;
std::shared_ptr<Route> route = std::dynamic_pointer_cast<Route>(r->stripable());
if (route) {
ARDOUR::RouteGroup* rg = route->route_group ();
if (rg && rg->is_active() && rg->is_select ()) {
std::shared_ptr<RouteList> rl = rg->route_list ();
for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
AxisView* av = avp.axis_view_by_stripable (*i);
rv.push_back (av);
}
}
}
return rv;
}
void
RouteProcessorSelection::presentation_info_changed (PropertyChange const & what_changed)
{
@ -128,20 +108,12 @@ RouteProcessorSelection::add (AxisView* r, bool with_groups)
return;
}
std::list<AxisView*> avl;
if (with_groups) {
avl= add_grouped_tracks (r);
}
avl.push_back (r);
PresentationInfo::ChangeSuspender cs;
for (std::list<AxisView*>::const_iterator i = avl.begin (); i != avl.end (); ++i) {
if (axes.insert (*i).second) {
shp.session()->selection().add ((*i)->stripable(), std::shared_ptr<AutomationControl>());
MixerStrip* ms = dynamic_cast<MixerStrip*> (*i);
if (ms) {
ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1, false), gui_context());
}
if (axes.insert (r).second) {
shp.session()->selection().select_stripable_and_maybe_group (r->stripable(), SelectionAdd, with_groups);
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
if (ms) {
ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1, false), gui_context());
}
}
}
@ -154,16 +126,8 @@ RouteProcessorSelection::remove (AxisView* r, bool with_groups)
}
ENSURE_GUI_THREAD (*this, &RouteProcessorSelection::remove, r);
std::list<AxisView*> avl;
if (with_groups) {
avl= add_grouped_tracks (r);
}
avl.push_back (r);
PresentationInfo::ChangeSuspender cs;
for (std::list<AxisView*>::const_iterator i = avl.begin (); i != avl.end (); ++i) {
shp.session()->selection().remove ((*i)->stripable(), std::shared_ptr<AutomationControl>());
}
shp.session()->selection().select_stripable_and_maybe_group (r->stripable(), SelectionRemove, with_groups);
}
void
@ -173,9 +137,7 @@ RouteProcessorSelection::set (AxisView* r)
return;
}
StripableList sl;
sl.push_back (r->stripable());
shp.session()->selection().set (sl);
shp.session()->selection().select_stripable_and_maybe_group (r->stripable(), SelectionSet);
}
bool