Add BasicUI::get_remote_nth_stripable()

Towards removing the direct use of Session by surfaces.
This commit is contained in:
David Robillard 2021-06-16 02:20:38 -04:00
parent 003f1a4974
commit 8aa2bb9795
4 changed files with 18 additions and 5 deletions

View file

@ -877,6 +877,13 @@ BasicUI::master_out () const
return _session->master_out ();
}
boost::shared_ptr<Stripable>
BasicUI::get_remote_nth_stripable (const PresentationInfo::order_t n,
const PresentationInfo::Flag flag) const
{
return _session->get_remote_nth_stripable (n, flag);
}
boost::shared_ptr<Amp>
BasicUI::click_gain ()
{

View file

@ -208,6 +208,12 @@ public:
boost::shared_ptr<Stripable> monitor_out () const;
boost::shared_ptr<Stripable> master_out () const;
/* Stripables */
boost::shared_ptr<Stripable> get_remote_nth_stripable (
PresentationInfo::order_t n,
PresentationInfo::Flag flag) const;
/* Clicking */
boost::shared_ptr<Amp> click_gain();

View file

@ -1109,7 +1109,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
switch (type) {
case PresentationOrder:
s = _session->get_remote_nth_stripable (id, PresentationInfo::Route);
s = get_remote_nth_stripable (id, PresentationInfo::Route);
break;
case Named:
/* name */
@ -1133,7 +1133,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
} else if (path[0] == X_("vca")) {
s = _session->get_remote_nth_stripable (id, PresentationInfo::VCA);
s = get_remote_nth_stripable (id, PresentationInfo::VCA);
} else if (path[0] == X_("bus")) {
@ -1142,7 +1142,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
s = _session->route_by_name (name);
break;
default:
s = _session->get_remote_nth_stripable (id, PresentationInfo::Bus);
s = get_remote_nth_stripable (id, PresentationInfo::Bus);
}
} else if (path[0] == X_("track")) {
@ -1152,7 +1152,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
s = _session->route_by_name (name);
break;
default:
s = _session->get_remote_nth_stripable (id, PresentationInfo::Track);
s = get_remote_nth_stripable (id, PresentationInfo::Track);
}
}

View file

@ -545,7 +545,7 @@ MixLayout::switch_bank (uint32_t base)
uint32_t different = 0;
for (int n = 0; n < 8; ++n) {
s[n] = session.get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
s[n] = p2.get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
if (s[n] != stripable[n]) {
different++;
}