an automation control that has to do things before its value is set in an RT context...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Feb 2017 17:55:05 +0000 (18:55 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Feb 2017 17:55:05 +0000 (18:55 +0100)
This fixes record-enable controls in a group failing generate
a call to the required stuff for tracks (moving meter position,
preparing diskstream) #7213

libs/ardour/ardour/automation_control.h
libs/ardour/ardour/control_group.h
libs/ardour/automation_control.cc
libs/ardour/control_group.cc
libs/ardour/session_rtevents.cc

index 158996133cdffa23285047855f08792e067cb658..21c783299626fcee6a5f9d7c54ff4abf15bf4d5a 100644 (file)
@@ -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:
index e1b83bb7b4f638bcb6800aa8e8d98b495c51aa95..73ad312d959fe28dad0fa9d2e2724acb4cfbf522 100644 (file)
@@ -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) {
index be81e28dd5d3173a99267d3aa9c91718cf9ae375..c090bca36417e6152b2502940aa4929af79074f2 100644 (file)
@@ -85,6 +85,16 @@ AutomationControl::get_value() const
        return Control::get_double (from_list, _session.transport_frame());
 }
 
+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)
 {
index 51a1515c6a39ab3d8f9bd81e5e1ae19d672b12a6..5f65122a3d61d7ea7eba8df6f81c8a3f90c5d746 100644 (file)
@@ -152,6 +152,16 @@ ControlGroup::add_control (boost::shared_ptr<AutomationControl> ac)
        return 0;
 }
 
+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)
 {
index eacbd2a7424d62fa4b59de20bc1840f7d6391c69..9e84d86a2392a5e52cc2e821351d3f0d43814b91 100644 (file)
@@ -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));