13
0

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
This commit is contained in:
Paul Davis 2017-02-08 18:55:05 +01:00
parent 234ea15499
commit bbbb874c03
5 changed files with 25 additions and 1 deletions

View 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:

View 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) {

View 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)
{

View 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)
{

View 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));