summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-05 00:02:31 +0200
committerRobin Gareus <robin@gareus.org>2015-08-05 00:02:55 +0200
commit53e969e925eb087459eba620770e95abb46945be (patch)
tree8f41aba239b5d644d396477d0e19127c7bb77258
parent507006a9a6c3f80f069b45a684796f7ac2953bc5 (diff)
pass complete blocksize range to LV2 plugin. fixes #6498
the buffersize may change anytime (split cycles), also plugin analysis uses a 4096 sample window.
-rw-r--r--libs/ardour/ardour/lv2_plugin.h1
-rw-r--r--libs/ardour/lv2_plugin.cc11
2 files changed, 8 insertions, 4 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index 21b7fde1d1..0a83ffe63a 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -240,7 +240,6 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
LV2_Feature _def_state_feature;
// Options passed to plugin
- int32_t _block_length;
int32_t _seq_size;
mutable unsigned _state_version;
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 4f3964eaa5..e5b8ffd91e 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -309,7 +309,6 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
_latency_control_port = 0;
_next_cycle_start = std::numeric_limits<framepos_t>::max();
_next_cycle_speed = 1.0;
- _block_length = _engine.samples_per_cycle();
_seq_size = _engine.raw_buffer_size(DataType::MIDI);
_state_version = 0;
_was_activated = false;
@@ -355,11 +354,17 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
#ifdef HAVE_LV2_1_2_0
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
+ static const int32_t _min_block_length = 1; // may happen during split-cycles
+ static const int32_t _max_block_length = 8192; // max possible (with all engines and during export)
+ /* @drobilla: Does it make sense to re-instantiate all plugins
+ * whenever the buffersize changes?
+ * Is there a way to find plugins that require the min/max blocksize option?
+ */
LV2_Options_Option options[] = {
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id(LV2_BUF_SIZE__minBlockLength),
- sizeof(int32_t), atom_Int, &_block_length },
+ sizeof(int32_t), atom_Int, &_min_block_length },
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id(LV2_BUF_SIZE__maxBlockLength),
- sizeof(int32_t), atom_Int, &_block_length },
+ sizeof(int32_t), atom_Int, &_max_block_length },
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id(LV2_BUF_SIZE__sequenceSize),
sizeof(int32_t), atom_Int, &_seq_size },
{ LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL }