diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index 9227da1ab3..883b520c3a 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -48,6 +48,7 @@ #include "ardour/rc_configuration.h" #include "ardour/route.h" #include "ardour/session.h" +#include "ardour/session_configuration.h" #include "ardour/track.h" #include "faderport.h" @@ -580,11 +581,30 @@ FaderPort::notify_transport_state_changed () get_button (Ffwd).set_led_state (_output_port, session->transport_speed() > 1.0); } +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 (); + if (in && out) { + get_button (Punch).set_led_state (_output_port, true); + blinkers.remove (Punch); + } else if (in || out) { + blinkers.push_back (Punch); + } else { + blinkers.remove (Punch); + } + } +} + void FaderPort::connect_session_signals() { session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::notify_record_state_changed, this), this); session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::notify_transport_state_changed, this), this); + /* not session, but treat it similarly */ + session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::parameter_changed, this, _1), this); } bool diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h index f2ec81d597..c92ab38c78 100644 --- a/libs/surfaces/faderport/faderport.h +++ b/libs/surfaces/faderport/faderport.h @@ -295,6 +295,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI