diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-08 18:55:05 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-08 18:55:05 +0100 |
commit | bbbb874c0318fa4a136431619bf91a939984530c (patch) | |
tree | 89a2832113495a1b6d3db9f950e6ed8cb04c6f23 /libs/ardour | |
parent | 234ea15499e71484b4da7ca890b49163f3befca5 (diff) |
an automation control that has to do things before its value is set in an RT context should potentially tell its ControlGroup
This fixes record-enable controls in a group failing generate
a call to the required stuff for tracks (moving meter position,
preparing diskstream) #7213
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/automation_control.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/control_group.h | 1 | ||||
-rw-r--r-- | libs/ardour/automation_control.cc | 10 | ||||
-rw-r--r-- | libs/ardour/control_group.cc | 10 | ||||
-rw-r--r-- | libs/ardour/session_rtevents.cc | 2 |
5 files changed, 25 insertions, 1 deletions
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h index 158996133c..21c7832996 100644 --- a/libs/ardour/ardour/automation_control.h +++ b/libs/ardour/ardour/automation_control.h @@ -140,6 +140,9 @@ class LIBARDOUR_API AutomationControl change for execution in a realtime context. C++ access control sucks. */ friend class Session; + /* this is what the session invokes */ + void pre_realtime_queue_stuff (double new_value, PBD::Controllable::GroupControlDisposition); + /* this will be invoked in turn on behalf of the group or the control by itself */ virtual void do_pre_realtime_queue_stuff (double new_value) {} private: diff --git a/libs/ardour/ardour/control_group.h b/libs/ardour/ardour/control_group.h index e1b83bb7b4..73ad312d95 100644 --- a/libs/ardour/ardour/control_group.h +++ b/libs/ardour/ardour/control_group.h @@ -63,6 +63,7 @@ class LIBARDOUR_API ControlGroup : public boost::enable_shared_from_this<Control Evoral::Parameter parameter() const { return _parameter; } virtual void set_group_value (boost::shared_ptr<AutomationControl>, double val); + virtual void pre_realtime_queue_stuff (double val); bool use_me (PBD::Controllable::GroupControlDisposition gcd) const { switch (gcd) { diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index be81e28dd5..c090bca364 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -86,6 +86,16 @@ AutomationControl::get_value() const } void +AutomationControl::pre_realtime_queue_stuff (double val, PBD::Controllable::GroupControlDisposition gcd) +{ + if (_group && _group->use_me (gcd)) { + _group->pre_realtime_queue_stuff (val); + } else { + do_pre_realtime_queue_stuff (val); + } +} + +void AutomationControl::set_value (double val, PBD::Controllable::GroupControlDisposition gcd) { if (!writable()) { diff --git a/libs/ardour/control_group.cc b/libs/ardour/control_group.cc index 51a1515c6a..5f65122a3d 100644 --- a/libs/ardour/control_group.cc +++ b/libs/ardour/control_group.cc @@ -153,6 +153,16 @@ ControlGroup::add_control (boost::shared_ptr<AutomationControl> ac) } void +ControlGroup::pre_realtime_queue_stuff (double val) +{ + Glib::Threads::RWLock::ReaderLock lm (controls_lock); + + for (ControlMap::iterator c = _controls.begin(); c != _controls.end(); ++c) { + c->second->do_pre_realtime_queue_stuff (val); + } +} + +void ControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control, double val) { double old = control->get_value (); diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index eacbd2a742..9e84d86a23 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -43,7 +43,7 @@ Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllab for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) { /* as of july 2017 this is a no-op for everything except record enable */ - (*ci)->do_pre_realtime_queue_stuff (val); + (*ci)->pre_realtime_queue_stuff (val, gcd); } queue_event (get_rt_event (cl, val, gcd)); |