diff options
author | Robin Gareus <robin@gareus.org> | 2016-06-03 23:09:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-06-03 23:09:18 +0200 |
commit | 56a5dd92af961797d771420aeaf6f9ab221864ec (patch) | |
tree | 58e974be6035fbc8f9209fae7a740b390995e5cb /libs | |
parent | f43ccd7321dcbc3e1aa9023dc45dc307ef61639d (diff) |
allow latent self-automating plugins
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 9e253a359f..ca0a5b45e3 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -2472,11 +2472,13 @@ LV2Plugin::connect_and_run(BufferSet& bufs, // -> add automation event.. AutomationCtrlPtr c = get_automation_control (p); if (c && c->ac->automation_state() == Touch) { + framepos_t when = std::max ((framepos_t) 0, _session.transport_frame() + frames - _current_latency); + assert (_session.transport_frame() + frames - _current_latency >= 0); if (c->guard) { c->guard = false; - c->ac->list()->add (_session.transport_frame() + frames, v, true, true); + c->ac->list()->add (when, v, true, true); } else { - c->ac->set_double (v, _session.transport_frame() + frames, true); + c->ac->set_double (v, when, true); } } } @@ -2501,7 +2503,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs, const uint32_t p = ((const LV2_Atom_Int*)parameter)->body; AutomationCtrlPtr c = get_automation_control (p); if (c) { - c->ac->start_touch (_session.transport_frame()); + c->ac->start_touch (std::max ((framepos_t)0, _session.transport_frame() - _current_latency)); c->guard = true; } } @@ -2515,7 +2517,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs, const uint32_t p = ((const LV2_Atom_Int*)parameter)->body; AutomationCtrlPtr c = get_automation_control (p); if (c) { - c->ac->stop_touch (true, _session.transport_frame()); + c->ac->stop_touch (true, std::max ((framepos_t)0, _session.transport_frame() - _current_latency)); } } } |