mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 05:06:31 +01:00
Add BasicUI::config()
Towards removing the direct use of Session by surfaces.
This commit is contained in:
parent
850bd44702
commit
1f17d0834c
11 changed files with 36 additions and 18 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue