From 48b960fdefef2b3c02f47baca328638e9ecef9a4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 8 May 2019 22:01:07 +0200 Subject: Notify custom UIs when designated LV2 BPM port changes --- libs/ardour/lv2_plugin.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libs/ardour/lv2_plugin.cc') diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 757e1fa11d..12fc58a6cb 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -356,6 +356,7 @@ LV2Plugin::LV2Plugin (AudioEngine& engine, , _worker(NULL) , _state_worker(NULL) , _insert_id("0") + , _bpm_control_port_index((uint32_t)-1) , _patch_port_in_index((uint32_t)-1) , _patch_port_out_index((uint32_t)-1) , _uri_map(URIMap::instance()) @@ -373,6 +374,7 @@ LV2Plugin::LV2Plugin (const LV2Plugin& other) , _worker(NULL) , _state_worker(NULL) , _insert_id(other._insert_id) + , _bpm_control_port_index((uint32_t)-1) , _patch_port_in_index((uint32_t)-1) , _patch_port_out_index((uint32_t)-1) , _uri_map(URIMap::instance()) @@ -759,6 +761,11 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) _impl->designated_input (LV2_TIME__beatsPerMinute, params, (void**)&_bpm_control_port); _impl->designated_input (LV2_CORE__freeWheeling, params, (void**)&_freewheel_control_port); + const LilvPort* bpmport = lilv_plugin_get_port_by_designation(plugin, _world.lv2_InputPort, _world.time_beatsPerMin); + if (bpmport) { + _bpm_control_port_index = lilv_port_get_index (plugin, bpmport); + } + for (uint32_t i = 0; i < num_ports; ++i) { const LilvPort* port = lilv_plugin_get_port_by_index(plugin, i); const LilvNode* sym = lilv_port_get_symbol(plugin, port); @@ -2397,6 +2404,9 @@ LV2Plugin::set_automation_control (uint32_t i, boost::shared_ptrac) { + /* may be NULL for replicated instances - only one custom UI/ctrl */ + c->ac->Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + } + } + *_bpm_control_port = bpm; } #ifdef LV2_EXTENDED -- cgit v1.2.3