13
0

Consolidate internal bus checks (2/2)

This commit is contained in:
Robin Gareus 2023-11-27 04:26:46 +01:00
parent 3de600625f
commit 9cc966120c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
15 changed files with 52 additions and 42 deletions

View File

@ -99,10 +99,8 @@ DuplicateRouteDialog::restart (Session* s)
if (std::dynamic_pointer_cast<Track> (r)) { if (std::dynamic_pointer_cast<Track> (r)) {
ntracks++; ntracks++;
} else { } else if (!r->is_main_bus()) {
if (!r->is_master() && !r->is_monitor()) { nbusses++;
nbusses++;
}
} }
} }
@ -185,7 +183,7 @@ DuplicateRouteDialog::on_response (int response)
continue; continue;
} }
if ((*s)->is_master() || (*s)->is_monitor()) { if ((*s)->is_main_bus ()) {
/* no option to duplicate these */ /* no option to duplicate these */
continue; continue;
} }

View File

@ -8299,7 +8299,7 @@ Editor::_remove_tracks ()
} }
routes.push_back (rtv->route()); routes.push_back (rtv->route());
if (rtv->route()->is_master() || rtv->route()->is_monitor()) { if (rtv->route()->is_singleton ()) {
special_bus = true; special_bus = true;
} }
} }

View File

@ -136,7 +136,7 @@ PortExportChannelSelector::fill_route_list ()
routes.sort (Stripable::Sorter ()); routes.sort (Stripable::Sorter ());
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) { for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
if ((*it)->is_master () || (*it)->is_monitor ()) { if ((*it)->is_main_bus ()) {
continue; continue;
} }
if ((*it)->output()->n_ports ().n_audio () > 0) { if ((*it)->output()->n_ports ().n_audio () > 0) {
@ -838,7 +838,7 @@ TrackExportChannelSelector::fill_list()
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) { for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
if (!std::dynamic_pointer_cast<Track>(*it)) { if (!std::dynamic_pointer_cast<Track>(*it)) {
// not a track, must be a bus // not a track, must be a bus
if ((*it)->is_master () || (*it)->is_monitor ()) { if ((*it)->is_main_bus ()) {
continue; continue;
} }
if (!(*it)->active ()) { if (!(*it)->active ()) {

View File

@ -1060,7 +1060,7 @@ FoldbackStrip::create_selected_sends (ARDOUR::Placement p, bool)
_session->get_stripables (*slist, fl); _session->get_stripables (*slist, fl);
for (StripableList::iterator i = (*slist).begin (); i != (*slist).end (); ++i) { for (StripableList::iterator i = (*slist).begin (); i != (*slist).end (); ++i) {
if ((*i)->is_selected () && !(*i)->is_master () && !(*i)->is_monitor ()) { if ((*i)->is_selected () && !(*i)->is_main_bus ()) {
std::shared_ptr<Route> rt = std::dynamic_pointer_cast<Route> (*i); std::shared_ptr<Route> rt = std::dynamic_pointer_cast<Route> (*i);
if (rt) { if (rt) {
rt->add_foldback_send (_route, p == PostFader); rt->add_foldback_send (_route, p == PostFader);

View File

@ -621,7 +621,7 @@ IOPluginWindow::IOButton::button_press (GdkEventButton* ev)
if (_pre) { if (_pre) {
/* suggest connecting output of io-plugins running before process to route inputs */ /* suggest connecting output of io-plugins running before process to route inputs */
for (auto const& i : copy) { for (auto const& i : copy) {
if (i->is_foldbackbus () || i->is_monitor ()) { if (i->is_foldbackbus () || i->is_monitor () || i->is_surround_master ()) {
continue; continue;
} }
maybe_add_bundle_to_menu (i->input ()->bundle ()); maybe_add_bundle_to_menu (i->input ()->bundle ());

View File

@ -536,6 +536,9 @@ Meterbridge::add_strips (RouteList& routes)
if (route->is_monitor()) { if (route->is_monitor()) {
continue; continue;
} }
if (route->is_surround_master()) {
continue;
}
strip = new MeterStrip (_session, route); strip = new MeterStrip (_session, route);
strips.push_back (MeterBridgeStrip(strip)); strips.push_back (MeterBridgeStrip(strip));

View File

@ -70,7 +70,7 @@ MixerGroupTabs::compute_tabs () const
continue; continue;
} }
if (s->route()->is_master() || s->route()->is_monitor() || !s->marked_for_display()) { if (s->route()->is_main_bus () || !s->marked_for_display()) {
continue; continue;
} }
#ifdef MIXBUS #ifdef MIXBUS
@ -172,7 +172,7 @@ MixerGroupTabs::routes_for_tab (Tab const * t) const
continue; continue;
} }
if (s->route()->is_master() || s->route()->is_monitor() || !s->marked_for_display()) { if (s->route()->is_main_bus () || !s->marked_for_display()) {
continue; continue;
} }

View File

@ -712,7 +712,7 @@ MixerStrip::set_route (std::shared_ptr<Route> rt)
/* non-master bus */ /* non-master bus */
if (!_route->is_master()) { if (!_route->is_main_bus ()) {
if (ARDOUR::Profile->get_mixbus()) { if (ARDOUR::Profile->get_mixbus()) {
rec_mon_table.attach (*show_sends_button, 0, 3, 0, 2); rec_mon_table.attach (*show_sends_button, 0, 3, 0, 2);
} else { } else {
@ -1098,7 +1098,7 @@ MixerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
} }
if (!_route->is_master() if (!_route->is_singleton ()
#ifdef MIXBUS #ifdef MIXBUS
&& !_route->mixbus() && !_route->mixbus()
#endif #endif
@ -1118,7 +1118,7 @@ MixerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
} }
if ((!_route->is_master() || !active) if ((!_route->is_singleton () || !active)
#ifdef MIXBUS #ifdef MIXBUS
&& !_route->mixbus() && !_route->mixbus()
#endif #endif
@ -1191,7 +1191,7 @@ MixerStrip::build_route_ops_menu ()
} }
#endif #endif
if (!_route->is_master()) { if (!_route->is_singleton ()) {
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Duplicate..."), sigc::mem_fun (*this, &RouteUI::duplicate_selected_routes))); items.push_back (MenuElem (_("Duplicate..."), sigc::mem_fun (*this, &RouteUI::duplicate_selected_routes)));
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());

View File

@ -1467,7 +1467,7 @@ Mixer_UI::set_all_strips_visibility (bool yn)
continue; continue;
} }
if (strip->route()->is_master() || strip->route()->is_monitor()) { if (strip->route()->is_singleton()) {
continue; continue;
} }
@ -1499,7 +1499,7 @@ Mixer_UI::set_all_audio_midi_visibility (int tracks, bool yn)
continue; continue;
} }
if (strip->route()->is_master() || strip->route()->is_monitor()) { if (strip->route()->is_singleton()) {
continue; continue;
} }
@ -1770,7 +1770,7 @@ Mixer_UI::redisplay_track_list ()
} else { } else {
if (stripable->is_master() || stripable->is_monitor()) { if (stripable->is_singleton()) {
/* do nothing, these cannot be hidden */ /* do nothing, these cannot be hidden */
} else { } else {
if (strip->packed()) { if (strip->packed()) {
@ -2047,6 +2047,9 @@ Mixer_UI::stripable_property_changed (const PropertyChange& what_changed, std::w
} }
} }
if (s->is_surround_master ()) {
return;
}
if (s->is_master ()) { if (s->is_master ()) {
return; return;
} }

View File

@ -2254,7 +2254,7 @@ ProcessorBox::build_possible_aux_menu ()
return 0; return 0;
} }
if (_route->is_monitor () || _route->is_foldbackbus () || _route->is_master ()) { if (_route->is_main_bus ()) {
return 0; return 0;
} }
@ -2263,11 +2263,8 @@ ProcessorBox::build_possible_aux_menu ()
MenuList& items = menu->items(); MenuList& items = menu->items();
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
if ((*r)->is_master() || (*r)->is_monitor () || *r == _route) { if ((*r)->is_main_bus() || *r == _route) {
/* don't allow sending to master or monitor or to self */ /* don't allow sending to master, monitor, folback, surround or to self */
continue;
}
if ((*r)->is_foldbackbus ()) {
continue; continue;
} }
if (_route->internal_send_for (*r)) { if (_route->internal_send_for (*r)) {
@ -2290,7 +2287,7 @@ ProcessorBox::build_possible_listener_menu ()
return 0; return 0;
} }
if (_route->is_monitor () || _route->is_foldbackbus ()) { if (_route->is_monitor () || _route->is_foldbackbus () || _route->is_surround_master ()) {
return 0; return 0;
} }
@ -2299,8 +2296,8 @@ ProcessorBox::build_possible_listener_menu ()
MenuList& items = menu->items(); MenuList& items = menu->items();
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
if ((*r)->is_master() || (*r)->is_monitor () || *r == _route) { if ((*r)->is_singleton () || *r == _route) {
/* don't allow sending to master or monitor or to self */ /* don't allow sending to master or monitor, surround or to self */
continue; continue;
} }
if (!(*r)->is_foldbackbus ()) { if (!(*r)->is_foldbackbus ()) {
@ -2326,7 +2323,7 @@ ProcessorBox::build_possible_remove_listener_menu ()
return 0; return 0;
} }
if (_route->is_monitor () || _route->is_foldbackbus ()) { if (_route->is_monitor () || _route->is_foldbackbus () || _route->is_surround_master ()) {
return 0; return 0;
} }
@ -2335,7 +2332,7 @@ ProcessorBox::build_possible_remove_listener_menu ()
MenuList& items = menu->items(); MenuList& items = menu->items();
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
if ((*r)->is_master() || (*r)->is_monitor () || *r == _route) { if ((*r)->is_singleton() || *r == _route) {
/* don't allow sending to master or monitor or to self */ /* don't allow sending to master or monitor or to self */
continue; continue;
} }
@ -2415,8 +2412,8 @@ ProcessorBox::show_processor_menu (int arg)
} }
} }
ActionManager::get_action (X_("ProcessorMenu"), "newinsert")->set_sensitive (!_route->is_monitor () && !_route->is_foldbackbus ()); ActionManager::get_action (X_("ProcessorMenu"), "newinsert")->set_sensitive (!_route->is_monitor () && !_route->is_foldbackbus () && !_route->is_surround_master ());
ActionManager::get_action (X_("ProcessorMenu"), "newsend")->set_sensitive (!_route->is_monitor () && !_route->is_foldbackbus ()); ActionManager::get_action (X_("ProcessorMenu"), "newsend")->set_sensitive (!_route->is_monitor () && !_route->is_foldbackbus () && !_route->is_surround_master ());
ProcessorEntry* single_selection = 0; ProcessorEntry* single_selection = 0;
if (processor_display.selection().size() == 1) { if (processor_display.selection().size() == 1) {

View File

@ -585,7 +585,7 @@ RouteListBase::add_stripables (StripableList& slist)
midi_trk = std::dynamic_pointer_cast<MidiTrack> (stripable); midi_trk = std::dynamic_pointer_cast<MidiTrack> (stripable);
row[_columns.is_track] = (std::dynamic_pointer_cast<Track> (stripable) != 0); row[_columns.is_track] = (std::dynamic_pointer_cast<Track> (stripable) != 0);
row[_columns.activatable] = !stripable->is_master (); row[_columns.activatable] = !stripable->is_singleton ();
if (midi_trk) { if (midi_trk) {
row[_columns.is_input_active] = midi_trk->input_active (); row[_columns.is_input_active] = midi_trk->input_active ();

View File

@ -807,7 +807,7 @@ RouteTimeAxisView::build_display_menu ()
r.push_back (route ()); r.push_back (route ());
} }
if (!_route->is_master()) { if (!_route->is_singleton ()) {
route_group_menu->build (r); route_group_menu->build (r);
items.push_back (MenuElem (_("Group"), *route_group_menu->menu ())); items.push_back (MenuElem (_("Group"), *route_group_menu->menu ()));
} }
@ -826,7 +826,7 @@ RouteTimeAxisView::build_display_menu ()
if (!r) { if (!r) {
continue; continue;
} }
always_active |= r->route()->is_master(); always_active |= r->route()->is_singleton ();
#ifdef MIXBUS #ifdef MIXBUS
always_active |= r->route()->mixbus() != 0; always_active |= r->route()->mixbus() != 0;
#endif #endif
@ -885,12 +885,14 @@ RouteTimeAxisView::build_display_menu ()
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, true))); items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, true)));
if (_route && !_route->is_master()) {
if (_route && !_route->is_singleton ()) {
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Duplicate..."), boost::bind (&ARDOUR_UI::start_duplicate_routes, ARDOUR_UI::instance()))); items.push_back (MenuElem (_("Duplicate..."), boost::bind (&ARDOUR_UI::start_duplicate_routes, ARDOUR_UI::instance())));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove"), sigc::mem_fun(_editor, &PublicEditor::remove_tracks)));
} }
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove"), sigc::mem_fun(_editor, &PublicEditor::remove_tracks)));
} }
void void

View File

@ -517,7 +517,7 @@ RouteUI::mute_press (GdkEventButton* ev)
*copy = _session->get_stripables (); *copy = _session->get_stripables ();
for (StripableList::iterator i = copy->begin(); i != copy->end(); ) { for (StripableList::iterator i = copy->begin(); i != copy->end(); ) {
if ((*i)->is_master() || (*i)->is_monitor()) { if ((*i)->is_singleton ()) {
i = copy->erase (i); i = copy->erase (i);
} else { } else {
++i; ++i;
@ -1817,7 +1817,7 @@ RouteUI::set_route_active (bool a, bool apply_to_selection)
{ {
if (apply_to_selection) { if (apply_to_selection) {
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteUI::set_route_active, _1, a, false)); ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteUI::set_route_active, _1, a, false));
} else if (!is_master () } else if (!is_singleton ()
#ifdef MIXBUS #ifdef MIXBUS
&& !_route->mixbus() && !_route->mixbus()
#endif #endif
@ -1879,6 +1879,12 @@ RouteUI::is_master () const
return _route && _route->is_master (); return _route && _route->is_master ();
} }
bool
RouteUI::is_singleton () const
{
return _route && _route->is_singleton ();
}
bool bool
RouteUI::is_foldbackbus () const RouteUI::is_foldbackbus () const
{ {

View File

@ -104,6 +104,7 @@ public:
bool is_track () const; bool is_track () const;
bool is_master () const; bool is_master () const;
bool is_foldbackbus () const; bool is_foldbackbus () const;
bool is_singleton () const;
bool is_audio_track () const; bool is_audio_track () const;
bool is_midi_track () const; bool is_midi_track () const;
bool has_audio_outputs () const; bool has_audio_outputs () const;

View File

@ -262,7 +262,7 @@ TriggerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
} }
if ((!_route->is_master() || !active) if ((!_route->is_singleton () || !active)
#ifdef MIXBUS #ifdef MIXBUS
&& !_route->mixbus() && !_route->mixbus()
#endif #endif
@ -325,7 +325,7 @@ TriggerStrip::build_route_ops_menu ()
} }
#endif #endif
if (!_route->is_master()) { if (!_route->is_singleton ()) {
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Duplicate..."), sigc::mem_fun (*this, &RouteUI::duplicate_selected_routes))); items.push_back (MenuElem (_("Duplicate..."), sigc::mem_fun (*this, &RouteUI::duplicate_selected_routes)));
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());