Add BasicUI::click_gain()

Towards removing the direct use of Session by surfaces.
This commit is contained in:
David Robillard 2021-06-16 02:01:31 -04:00
parent fad1531b2d
commit 453fac0df7
5 changed files with 15 additions and 4 deletions

View file

@ -877,6 +877,12 @@ BasicUI::master_out () const
return _session->master_out ();
}
boost::shared_ptr<Amp>
BasicUI::click_gain ()
{
return _session->click_gain ();
}
const Locations*
BasicUI::locations () const
{

View file

@ -39,6 +39,7 @@
namespace ARDOUR {
class Amp;
class Locations;
class RouteGroup;
class Session;
@ -206,6 +207,10 @@ public:
boost::shared_ptr<Stripable> monitor_out () const;
boost::shared_ptr<Stripable> master_out () const;
/* Clicking */
boost::shared_ptr<Amp> click_gain();
/* Locations */
const Locations* locations () const;

View file

@ -3224,8 +3224,8 @@ OSC::click_level (float position)
return -1;
}
if (_session->click_gain()->gain_control()) {
_session->click_gain()->gain_control()->set_value (_session->click_gain()->gain_control()->interface_to_internal (position), PBD::Controllable::NoGroup);
if (click_gain()->gain_control()) {
click_gain()->gain_control()->set_value (_session->click_gain()->gain_control()->interface_to_internal (position), PBD::Controllable::NoGroup);
}
return 0;
}

View file

@ -123,7 +123,7 @@ OSCGlobalObserver::OSCGlobalObserver (OSC& o, Session& s, ArdourSurface::OSC::OS
_osc.SoloActive().connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::solo_active, this, _1), OSC::instance());
solo_active (session->soloing() || session->listening());
boost::shared_ptr<Controllable> click_controllable = boost::dynamic_pointer_cast<Controllable>(session->click_gain()->gain_control());
boost::shared_ptr<Controllable> click_controllable = boost::dynamic_pointer_cast<Controllable>(_osc.click_gain()->gain_control());
click_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::send_change_message, this, X_("/click/level"), click_controllable), OSC::instance());
send_change_message (X_("/click/level"), click_controllable);

View file

@ -1041,7 +1041,7 @@ Push2::other_vpot (int n, int delta)
break;
case 1:
/* metronome gain control */
click_gain = _session->click_gain();
click_gain = this->click_gain();
if (click_gain) {
boost::shared_ptr<AutomationControl> ac = click_gain->gain_control();
if (ac) {