diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 631caf22e1..102556c889 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -800,3 +800,15 @@ BasicUI::make_port_name_non_relative (const std::string& name) const { return _session->engine ().make_port_name_non_relative (name); } + +const SessionConfiguration& +BasicUI::config () const +{ + return _session->config; +} + +SessionConfiguration& +BasicUI::config () +{ + return _session->config; +} diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index f06186b7d0..31bc136099 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -36,6 +36,7 @@ namespace ARDOUR { class Session; +class SessionConfiguration; class LIBCONTROLCP_API BasicUI { public: @@ -160,6 +161,11 @@ class LIBCONTROLCP_API BasicUI { std::string make_port_name_non_relative (const std::string& name) const; + /* Configuration */ + + const SessionConfiguration& config () const; + SessionConfiguration& config (); + protected: Session* _session; }; diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index 7e68f927a4..43c7d2827d 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -706,8 +706,8 @@ void FaderPort::parameter_changed (string what) { if (what == "punch-in" || what == "punch-out") { - bool in = _session->config.get_punch_in (); - bool out = _session->config.get_punch_out (); + bool in = config ().get_punch_in (); + bool out = config ().get_punch_out (); if (in && out) { get_button (Punch).set_led_state (_output_port, true); blinkers.remove (Punch); @@ -725,7 +725,7 @@ FaderPort::connect_session_signals() _session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_recenable_state, this), this); _session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_transport_state, this), this); /* not session, but treat it similarly */ - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::parameter_changed, this, _1), this); } bool diff --git a/libs/surfaces/faderport8/callbacks.cc b/libs/surfaces/faderport8/callbacks.cc index 9615437209..65f9fe737c 100644 --- a/libs/surfaces/faderport8/callbacks.cc +++ b/libs/surfaces/faderport8/callbacks.cc @@ -42,7 +42,7 @@ FaderPort8::connect_session_signals () PresentationInfo::Change.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_pi_property_changed, this, _1), this); Config->ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this); _session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_transport_state_changed, this), this); _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_loop_state_changed, this), this); diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index cfcefed980..e849d1e7dc 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -698,7 +698,7 @@ LaunchControlXL::connect_session_signals() _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_loop_state_changed, this), this); // receive punch-in and punch-out Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this); // receive rude solo changed //_session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_solo_active_changed, this, _1), this); diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 2182a1b039..33182ff651 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -751,7 +751,7 @@ MackieControlProtocol::connect_session_signals() _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_loop_state_changed, this), this); // receive punch-in and punch-out Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this); // receive rude solo changed _session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1), this); @@ -1250,9 +1250,9 @@ MackieControlProtocol::update_timecode_display() void MackieControlProtocol::notify_parameter_changed (std::string const & p) { if (p == "punch-in") { - update_global_button (Button::Drop, _session->config.get_punch_in() ? flashing : off); + update_global_button (Button::Drop, config ().get_punch_in() ? flashing : off); } else if (p == "punch-out") { - update_global_button (Button::Replace, _session->config.get_punch_out() ? flashing : off); + update_global_button (Button::Replace, config ().get_punch_out() ? flashing : off); } else if (p == "clicking") { update_global_button (Button::Click, Config->get_clicking()); } else if (p == "follow-edits") { @@ -1262,9 +1262,9 @@ void MackieControlProtocol::notify_parameter_changed (std::string const & p) * this button (if there is one) won't reflect the setting. */ - //update_global_button (Button::Enter, _session->config.get_follow_edits() ? on : off); + //update_global_button (Button::Enter, config ().get_follow_edits() ? on : off); } else if (p == "external-sync") { - update_global_button (Button::Cancel, _session->config.get_external_sync() ? on : off); + update_global_button (Button::Cancel, config ().get_external_sync() ? on : off); } else { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("parameter changed: %1\n", p)); } diff --git a/libs/surfaces/maschine2/callbacks.cc b/libs/surfaces/maschine2/callbacks.cc index 86014e28e1..b6fdf34306 100644 --- a/libs/surfaces/maschine2/callbacks.cc +++ b/libs/surfaces/maschine2/callbacks.cc @@ -44,7 +44,7 @@ Maschine2::connect_signals () _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_loop_state_changed, this), this); _session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_record_state_changed, this), this); Config->ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this); _session->DirtyChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_session_dirty_changed, this), this); _session->history().Changed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_history_changed, this), this); diff --git a/libs/surfaces/osc/osc_global_observer.cc b/libs/surfaces/osc/osc_global_observer.cc index 492162fee8..7cbc26be5e 100644 --- a/libs/surfaces/osc/osc_global_observer.cc +++ b/libs/surfaces/osc/osc_global_observer.cc @@ -502,12 +502,12 @@ OSCGlobalObserver::solo_active (bool active) void OSCGlobalObserver::extra_check () { - if (last_punchin != session->config.get_punch_in()) { - last_punchin = session->config.get_punch_in(); + if (last_punchin != _osc.config().get_punch_in()) { + last_punchin = _osc.config().get_punch_in(); _osc.float_message (X_("/toggle_punch_in"), last_punchin, addr); } - if (last_punchout != session->config.get_punch_out()) { - last_punchout = session->config.get_punch_out(); + if (last_punchout != _osc.config().get_punch_out()) { + last_punchout = _osc.config().get_punch_out(); _osc.float_message (X_("/toggle_punch_out"), last_punchout, addr); } if (last_click != Config->get_clicking()) { diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 438fdb92e4..2dc951e9cd 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -872,7 +872,7 @@ Push2::connect_session_signals() _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_loop_state_changed, this), this); // receive punch-in and punch-out Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this); // receive rude solo changed _session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_solo_active_changed, this, _1), this); } diff --git a/libs/surfaces/tranzport/general.cc b/libs/surfaces/tranzport/general.cc index c85563c3db..f45e6b8e37 100644 --- a/libs/surfaces/tranzport/general.cc +++ b/libs/surfaces/tranzport/general.cc @@ -121,7 +121,7 @@ int TranzportControlProtocol::lights_show_normal() /* Global settings */ lights_pending[LightLoop] = session->get_play_loop(); - lights_pending[LightPunch] = session->config.get_punch_in() || session->config.get_punch_out(); + lights_pending[LightPunch] = config ().get_punch_in() || config().get_punch_out(); lights_pending[LightRecord] = session->get_record_enabled(); lights_pending[LightAnysolo] = session->soloing(); diff --git a/libs/surfaces/us2400/us2400_control_protocol.cc b/libs/surfaces/us2400/us2400_control_protocol.cc index e2c1437a89..1e24b6b6dc 100644 --- a/libs/surfaces/us2400/us2400_control_protocol.cc +++ b/libs/surfaces/us2400/us2400_control_protocol.cc @@ -645,7 +645,7 @@ US2400Protocol::connect_session_signals() _session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_loop_state_changed, this), this); // receive punch-in and punch-out Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this); - _session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this); + config ().ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this); // receive rude solo changed _session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_solo_active_changed, this, _1), this);