From 79f8606b2dc205d371ccdf272a5f4187a13e539d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 18 Jul 2022 15:42:44 +0200 Subject: [PATCH] LV2: announce bufz:boundedBlockLength feature (#8942) --- libs/ardour/ardour/lv2_plugin.h | 1 + libs/ardour/lv2_plugin.cc | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index adb9bcc552..ad5c98b7a5 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -336,6 +336,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee LV2_Feature _work_schedule_feature; LV2_Feature _options_feature; LV2_Feature _def_state_feature; + LV2_Feature _block_length_feature; #ifdef LV2_EXTENDED LV2_Feature _queue_draw_feature; LV2_Feature _midnam_feature; diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index b10a4ed0ba..e3f8f558e3 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -137,6 +137,7 @@ uint32_t LV2Plugin::_ui_foreground_color = 0xffffffff; // RGBA uint32_t LV2Plugin::_ui_contrasting_color = 0x33ff33ff; // RGBA unsigned long LV2Plugin::_ui_transient_win_id = 0; + class LV2World : boost::noncopyable { public: LV2World (); @@ -481,6 +482,8 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) _work_schedule_feature.data = NULL; _def_state_feature.URI = LV2_STATE_PREFIX "loadDefaultState"; // Post LV2-1.2.0 _def_state_feature.data = NULL; + _block_length_feature.URI = LV2_BUF_SIZE__boundedBlockLength; + _block_length_feature.data = NULL; const LilvPlugin* plugin = _impl->plugin; @@ -494,16 +497,17 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) lilv_node_free(state_uri); lilv_node_free(state_iface_uri); - _features = (LV2_Feature**)calloc(14, sizeof(LV2_Feature*)); + _features = (LV2_Feature**)calloc (15, sizeof(LV2_Feature*)); _features[0] = &_instance_access_feature; _features[1] = &_data_access_feature; _features[2] = &_make_path_feature; _features[3] = _uri_map.urid_map_feature(); _features[4] = _uri_map.urid_unmap_feature(); _features[5] = &_log_feature; + _features[6] = &_def_state_feature; + _features[7] = &_block_length_feature; - unsigned n_features = 6; - _features[n_features++] = &_def_state_feature; + unsigned n_features = 8; lv2_atom_forge_init(&_impl->forge, _uri_map.urid_map()); lv2_atom_forge_init(&_impl->ui_forge, _uri_map.urid_map());