Consolidate internal bus checks (1/2)

This commit is contained in:
Robin Gareus 2023-11-27 04:21:59 +01:00
parent 9bb4d0dcf8
commit 3de600625f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
12 changed files with 32 additions and 23 deletions

View File

@ -107,7 +107,7 @@ InternalSend::propagate_solo ()
/* propagate further downstream alike Route::input_change_handler() */ /* propagate further downstream alike Route::input_change_handler() */
std::shared_ptr<RouteList const> routes = _session.get_routes (); std::shared_ptr<RouteList const> routes = _session.get_routes ();
for (auto const& i : *routes) { for (auto const& i : *routes) {
if (i == _send_to || i->is_master() || i->is_monitor() || i->is_auditioner()) { if (i == _send_to || i->is_singleton () || i->is_auditioner()) {
continue; continue;
} }
bool does_feed = _send_to->feeds (i); bool does_feed = _send_to->feeds (i);
@ -247,6 +247,7 @@ InternalSend::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sa
} }
} }
} }
} else if (role () == Listen) { } else if (role () == Listen) {
/* We're going to the monitor bus, so discard MIDI data */ /* We're going to the monitor bus, so discard MIDI data */

View File

@ -155,7 +155,7 @@ int
Route::init () Route::init ()
{ {
/* default master bus to use strict i/o */ /* default master bus to use strict i/o */
if (is_master() || is_monitor ()) { if (is_singleton ()) {
_strict_io = true; _strict_io = true;
_meter_point = _pending_meter_point = MeterOutput; _meter_point = _pending_meter_point = MeterOutput;
} }
@ -221,7 +221,7 @@ Route::init ()
_amp->set_display_name (_("Monitor")); _amp->set_display_name (_("Monitor"));
} }
if (!is_master() && !is_monitor() && !is_auditioner()) { if (!is_singleton () && !is_auditioner ()) {
_delayline.reset (new DelayLine (_session, name ())); _delayline.reset (new DelayLine (_session, name ()));
} }
@ -5435,7 +5435,7 @@ Route::setup_invisible_processors ()
} }
} }
if (!is_master() && !is_monitor() && !is_auditioner()) { if (!is_singleton () && !is_auditioner()) {
ProcessorList::iterator reader_pos = find (new_processors.begin(), new_processors.end(), _disk_reader); ProcessorList::iterator reader_pos = find (new_processors.begin(), new_processors.end(), _disk_reader);
if (reader_pos != new_processors.end()) { if (reader_pos != new_processors.end()) {
/* insert before disk-reader */ /* insert before disk-reader */

View File

@ -163,7 +163,7 @@ CoreSelection::select_stripable_and_maybe_group (std::shared_ptr<Stripable> s, b
/* monitor is never selectable */ /* monitor is never selectable */
if (s->is_monitor()) { if (s->is_monitor() || s->is_surround_master ()) {
return false; return false;
} }

View File

@ -2724,7 +2724,7 @@ Session::ensure_stripable_sort_order ()
for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) { for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
std::shared_ptr<Stripable> s (*si); std::shared_ptr<Stripable> s (*si);
assert (!s->is_auditioner ()); // XXX remove me assert (!s->is_auditioner ()); // XXX remove me
if (s->is_monitor ()) { if (s->is_monitor () || s->is_surround_master ()) {
continue; continue;
} }
if (order != s->presentation_info().order()) { if (order != s->presentation_info().order()) {
@ -3519,7 +3519,7 @@ Session::add_internal_send (std::shared_ptr<Route> dest, int index, std::shared_
void void
Session::add_internal_send (std::shared_ptr<Route> dest, std::shared_ptr<Processor> before, std::shared_ptr<Route> sender) Session::add_internal_send (std::shared_ptr<Route> dest, std::shared_ptr<Processor> before, std::shared_ptr<Route> sender)
{ {
if (sender->is_monitor() || sender->is_master() || sender == dest || dest->is_monitor() || dest->is_master()) { if (sender->is_singleton() || sender == dest || dest->is_singleton()) {
return; return;
} }
@ -4363,7 +4363,7 @@ Session::reassign_track_numbers ()
assert (!(*i)->is_auditioner()); assert (!(*i)->is_auditioner());
if (std::dynamic_pointer_cast<Track> (*i)) { if (std::dynamic_pointer_cast<Track> (*i)) {
(*i)->set_track_number(++tn); (*i)->set_track_number(++tn);
} else if (!(*i)->is_master() && !(*i)->is_monitor()) { } else if (!(*i)->is_main_bus ()) {
(*i)->set_track_number(--bn); (*i)->set_track_number(--bn);
} }

View File

@ -1118,7 +1118,7 @@ Session::export_track_state (std::shared_ptr<RouteList> rl, const string& path)
if ((*i)->is_auditioner()) { if ((*i)->is_auditioner()) {
continue; continue;
} }
if ((*i)->is_master() || (*i)->is_monitor()) { if ((*i)->is_singleton()) {
continue; continue;
} }
child->add_child_nocopy ((*i)->get_state()); child->add_child_nocopy ((*i)->get_state());

View File

@ -141,10 +141,12 @@ Stripable::Sorter::operator() (std::shared_ptr<ARDOUR::Stripable> a, std::shared
int cmp_a = 0; int cmp_a = 0;
int cmp_b = 0; int cmp_b = 0;
if (a->is_auditioner ()) { cmp_a = -2; } if (a->is_auditioner ()) { cmp_a = -3; }
if (b->is_auditioner ()) { cmp_b = -2; } if (b->is_auditioner ()) { cmp_b = -3; }
if (a->is_monitor ()) { cmp_a = -1; } if (a->is_monitor ()) { cmp_a = -2; }
if (b->is_monitor ()) { cmp_b = -1; } if (b->is_monitor ()) { cmp_b = -2; }
if (a->is_surround_master ()) { cmp_a = -1; }
if (b->is_surround_master ()) { cmp_b = -1; }
/* ARDOUR-Editor: [Track|Bus|Master] (0) < VCA (3) /* ARDOUR-Editor: [Track|Bus|Master] (0) < VCA (3)
* ARDOUR-Mixer : [Track|Bus] (0) < VCA (3) < Master (4) * ARDOUR-Mixer : [Track|Bus] (0) < VCA (3) < Master (4)

View File

@ -2649,7 +2649,7 @@ VST3PI::stripable_property_changed (PBD::PropertyChange const&)
std::string ns; std::string ns;
int order_key; int order_key;
if (s->is_master ()) { if (s->is_master () || s->is_surround_master ()) {
ns = _("Master"); ns = _("Master");
order_key = 2; order_key = 2;
} else if (s->is_monitor ()) { } else if (s->is_monitor ()) {
@ -2815,7 +2815,7 @@ VST3PI::getContextInfoValue (int32& value, FIDString id)
if (0 == strcmp (id, ContextInfo::kIndexMode)) { if (0 == strcmp (id, ContextInfo::kIndexMode)) {
value = ContextInfo::kFlatIndex; value = ContextInfo::kFlatIndex;
} else if (0 == strcmp (id, ContextInfo::kType)) { } else if (0 == strcmp (id, ContextInfo::kType)) {
if (s->is_master ()) { if (s->is_singleton ()) {
value = ContextInfo::kOut; value = ContextInfo::kOut;
} else if (s->presentation_info ().flags () & PresentationInfo::AudioTrack) { } else if (s->presentation_info ().flags () & PresentationInfo::AudioTrack) {
value = ContextInfo::kTrack; value = ContextInfo::kTrack;
@ -2825,7 +2825,7 @@ VST3PI::getContextInfoValue (int32& value, FIDString id)
value = ContextInfo::kBus; value = ContextInfo::kBus;
} }
} else if (0 == strcmp (id, ContextInfo::kMain)) { } else if (0 == strcmp (id, ContextInfo::kMain)) {
value = s->is_master () ? 1 : 0; value = s->is_singleton () ? 1 : 0;
} else if (0 == strcmp (id, ContextInfo::kIndex)) { } else if (0 == strcmp (id, ContextInfo::kIndex)) {
value = s->presentation_info ().order (); value = s->presentation_info ().order ();
} else if (0 == strcmp (id, ContextInfo::kColor)) { } else if (0 == strcmp (id, ContextInfo::kColor)) {

View File

@ -276,7 +276,7 @@ FaderPort8::button_automation (ARDOUR::AutoState as)
StripableList all; StripableList all;
session->get_stripables (all); session->get_stripables (all);
for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) { for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
if ((*i)->is_master() || (*i)->is_monitor()) { if ((*i)->is_singleton ()) {
continue; continue;
} }
if (!(*i)->is_selected()) { if (!(*i)->is_selected()) {
@ -328,7 +328,7 @@ FaderPort8::button_solo_clear ()
StripableList all; StripableList all;
session->get_stripables (all); session->get_stripables (all);
for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) { for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) { if ((*i)->is_singleton () || (*i)->is_auditioner()) {
continue; continue;
} }
std::shared_ptr<SoloControl> sc = (*i)->solo_control(); std::shared_ptr<SoloControl> sc = (*i)->solo_control();

View File

@ -968,6 +968,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
bool allow_master = false; bool allow_master = false;
bool allow_monitor = false; bool allow_monitor = false;
bool allow_surround = false;
switch (_ctrls.mix_mode ()) { switch (_ctrls.mix_mode ()) {
case MixAudio: case MixAudio:
@ -987,11 +988,13 @@ FaderPort8::filter_stripables (StripableList& strips) const
break; break;
case MixUser: case MixUser:
allow_master = true; allow_master = true;
allow_surround = true;
flt = &flt_selected; flt = &flt_selected;
break; break;
case MixOutputs: case MixOutputs:
allow_master = true; allow_master = true;
allow_monitor = true; allow_monitor = true;
allow_surround = true;
flt = &flt_mains; flt = &flt_mains;
break; break;
case MixInputs: case MixInputs:
@ -1005,6 +1008,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
/* fallthrough */ /* fallthrough */
case MixAll: case MixAll:
allow_master = true; allow_master = true;
allow_surround = true;
flt = &flt_all; flt = &flt_all;
break; break;
} }
@ -1018,6 +1022,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
if (!allow_master && (*s)->is_master ()) { continue; } if (!allow_master && (*s)->is_master ()) { continue; }
if (!allow_monitor && (*s)->is_monitor ()) { continue; } if (!allow_monitor && (*s)->is_monitor ()) { continue; }
if (!allow_surround && (*s)->is_surround_master ()) { continue; }
if ((*flt)(*s)) { if ((*flt)(*s)) {
strips.push_back (*s); strips.push_back (*s);

View File

@ -1260,8 +1260,7 @@ MackieControlProtocol::prog2_clear_solo_press (Button &)
for (StripableList::const_iterator i = sl.begin(); i != sl.end(); ++i) for (StripableList::const_iterator i = sl.begin(); i != sl.end(); ++i)
{ {
std::shared_ptr<MuteControl> mc = (*i)->mute_control(); std::shared_ptr<MuteControl> mc = (*i)->mute_control();
if (!mc->muted() && (!(*i)->is_master()) && (!(*i)->is_monitor())) if (!mc->muted() && !(*i)->is_singleton ()) {
{
mc->set_value(1.0, Controllable::UseGroup); mc->set_value(1.0, Controllable::UseGroup);
} }
} }

View File

@ -1065,6 +1065,8 @@ OSC::routes_list (lo_message msg)
lo_message_add_string (reply, "MA"); lo_message_add_string (reply, "MA");
} else if (s->is_monitor()) { } else if (s->is_monitor()) {
lo_message_add_string (reply, "MO"); lo_message_add_string (reply, "MO");
} else if (s->is_surround_master()) {
lo_message_add_string (reply, "SM");
} else if (std::dynamic_pointer_cast<Route>(s) && !std::dynamic_pointer_cast<Track>(s)) { } else if (std::dynamic_pointer_cast<Route>(s) && !std::dynamic_pointer_cast<Track>(s)) {
if (!(s->presentation_info().flags() & PresentationInfo::MidiBus)) { if (!(s->presentation_info().flags() & PresentationInfo::MidiBus)) {
if (s->is_foldbackbus()) { if (s->is_foldbackbus()) {

View File

@ -138,7 +138,7 @@ copy_session_routes (
/* get route state from first session */ /* get route state from first session */
std::shared_ptr<RouteList const> rl = s->get_routes (); std::shared_ptr<RouteList const> rl = s->get_routes ();
for (auto const& r : *rl) { for (auto const& r : *rl) {
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) { if (r->is_singleton () || r->is_auditioner ()) {
continue; continue;
} }
XMLNode& state (r->get_state ()); XMLNode& state (r->get_state ());
@ -178,7 +178,7 @@ copy_session_routes (
rl = s->get_routes (); rl = s->get_routes ();
for (auto const& r : *rl) { for (auto const& r : *rl) {
/* skip special busses */ /* skip special busses */
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) { if (r->is_singleton () || r->is_auditioner ()) {
continue; continue;
} }
if (std::dynamic_pointer_cast<Track> (r)) { if (std::dynamic_pointer_cast<Track> (r)) {
@ -204,7 +204,7 @@ copy_session_routes (
rl = s->get_routes (); rl = s->get_routes ();
for (auto const& r : *rl) { for (auto const& r : *rl) {
/* skip special busses */ /* skip special busses */
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) { if (r->is_singleton () || r->is_auditioner ()) {
continue; continue;
} }
if (!std::dynamic_pointer_cast<Track> (r)) { if (!std::dynamic_pointer_cast<Track> (r)) {