diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 8548891485..116d954a00 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1154,6 +1154,7 @@ public: void add_controllable (boost::shared_ptr); boost::shared_ptr solo_cut_control() const; + boost::shared_ptr recently_touched_controllable () const; SessionConfiguration config; @@ -2097,6 +2098,9 @@ private: boost::shared_ptr _solo_cut_control; + void controllable_touched (boost::weak_ptr); + boost::weak_ptr _recently_touched_controllable; + void reset_native_file_format(); bool first_file_data_format_reset; bool first_file_header_format_reset; diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 67e4bd9d6d..c4377f651e 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -284,6 +284,8 @@ AutomationControl::start_touch (double when) return; } + ControlTouched (boost::dynamic_pointer_cast(shared_from_this())); /* EMIT SIGNAL */ + if (alist()->automation_state() & (Touch | Latch)) { /* subtle. aligns the user value with the playback and * use take actual value (incl masters). diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index f54dc3247a..b8ae15c39b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -462,6 +462,8 @@ Session::Session (AudioEngine &eng, LatentSend::ChangedLatency.connect_same_thread (*this, boost::bind (&Session::send_latency_compensation_change, this)); Latent::DisableSwitchChanged.connect_same_thread (*this, boost::bind (&Session::queue_latency_recompute, this)); + Controllable::ControlTouched.connect_same_thread (*this, boost::bind (&Session::controllable_touched, this, _1)); + emit_thread_start (); auto_connect_thread_start (); @@ -6850,6 +6852,18 @@ Session::notify_presentation_info_change () reassign_track_numbers(); } +void +Session::controllable_touched (boost::weak_ptr c) +{ + _recently_touched_controllable = c; +} + +boost::shared_ptr +Session::recently_touched_controllable () const +{ + return _recently_touched_controllable.lock (); +} + bool Session::operation_in_progress (GQuark op) const { diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc index 5b4fae9757..e60fffe689 100644 --- a/libs/pbd/controllable.cc +++ b/libs/pbd/controllable.cc @@ -35,6 +35,7 @@ using namespace std; PBD::Signal1 > Controllable::StartLearning; PBD::Signal1 > Controllable::StopLearning; PBD::Signal1 > Controllable::GUIFocusChanged; +PBD::Signal1 > Controllable::ControlTouched; Glib::Threads::RWLock Controllable::registry_lock; Controllable::Controllables Controllable::registry; diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index e4fa6a9934..491760d42c 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -141,6 +141,7 @@ public: static PBD::Signal1 > StopLearning; static PBD::Signal1 > GUIFocusChanged; + static PBD::Signal1 > ControlTouched; PBD::Signal2 Changed;