From 8aa2bb979524a858870b214b36de7e0f69d658bb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Jun 2021 02:20:38 -0400 Subject: [PATCH] Add BasicUI::get_remote_nth_stripable() Towards removing the direct use of Session by surfaces. --- libs/surfaces/control_protocol/basic_ui.cc | 7 +++++++ .../surfaces/control_protocol/control_protocol/basic_ui.h | 6 ++++++ .../generic_midi/generic_midi_control_protocol.cc | 8 ++++---- libs/surfaces/push2/mix.cc | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index f6a11fe7ee..505e1aafa5 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -877,6 +877,13 @@ BasicUI::master_out () const return _session->master_out (); } +boost::shared_ptr +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 BasicUI::click_gain () { diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index b49d169772..808109dc57 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -208,6 +208,12 @@ public: boost::shared_ptr monitor_out () const; boost::shared_ptr master_out () const; + /* Stripables */ + + boost::shared_ptr get_remote_nth_stripable ( + PresentationInfo::order_t n, + PresentationInfo::Flag flag) const; + /* Clicking */ boost::shared_ptr click_gain(); diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index f26726569b..8caa90bf59 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -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); } } diff --git a/libs/surfaces/push2/mix.cc b/libs/surfaces/push2/mix.cc index 257de1d045..f6f4705d9f 100644 --- a/libs/surfaces/push2/mix.cc +++ b/libs/surfaces/push2/mix.cc @@ -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++; }