Keep track of recently touched Controllable

This commit is contained in:
Robin Gareus 2021-02-08 14:28:39 +01:00
parent b3f019b8b7
commit 7e74f9eb1e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 22 additions and 0 deletions

View File

@ -1154,6 +1154,7 @@ public:
void add_controllable (boost::shared_ptr<PBD::Controllable>);
boost::shared_ptr<PBD::Controllable> solo_cut_control() const;
boost::shared_ptr<PBD::Controllable> recently_touched_controllable () const;
SessionConfiguration config;
@ -2097,6 +2098,9 @@ private:
boost::shared_ptr<PBD::Controllable> _solo_cut_control;
void controllable_touched (boost::weak_ptr<PBD::Controllable>);
boost::weak_ptr<PBD::Controllable> _recently_touched_controllable;
void reset_native_file_format();
bool first_file_data_format_reset;
bool first_file_header_format_reset;

View File

@ -284,6 +284,8 @@ AutomationControl::start_touch (double when)
return;
}
ControlTouched (boost::dynamic_pointer_cast<PBD::Controllable>(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).

View File

@ -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<PBD::Controllable> c)
{
_recently_touched_controllable = c;
}
boost::shared_ptr<PBD::Controllable>
Session::recently_touched_controllable () const
{
return _recently_touched_controllable.lock ();
}
bool
Session::operation_in_progress (GQuark op) const
{

View File

@ -35,6 +35,7 @@ using namespace std;
PBD::Signal1<bool, boost::weak_ptr<PBD::Controllable> > Controllable::StartLearning;
PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > Controllable::StopLearning;
PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > Controllable::GUIFocusChanged;
PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > Controllable::ControlTouched;
Glib::Threads::RWLock Controllable::registry_lock;
Controllable::Controllables Controllable::registry;

View File

@ -141,6 +141,7 @@ public:
static PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > StopLearning;
static PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > GUIFocusChanged;
static PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > ControlTouched;
PBD::Signal2<void,bool,PBD::Controllable::GroupControlDisposition> Changed;