summaryrefslogtreecommitdiff
path: root/libs/ardour/lv2_plugin.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-31 19:19:21 +0200
committerDavid Robillard <d@drobilla.net>2019-04-10 10:24:33 +0200
commit30d59c8f6eb31e0e8bd2ae2bef8f5881786eeb08 (patch)
tree09187b6377e561b1428278e9aedf8a58f221efe8 /libs/ardour/lv2_plugin.cc
parent5f18d8ddfd98a06fc4f6a9b00c751bbed0cc4871 (diff)
Remove support for building against LV2 older than 1.2.0
LV2 1.2.0 was released in 2012, over 6 years ago now.
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r--libs/ardour/lv2_plugin.cc34
1 files changed, 2 insertions, 32 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index fe2bde8d1d..50b85f41c0 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -83,10 +83,8 @@
#include "lv2/lv2plug.in/ns/ext/patch/patch.h"
#include "lv2/lv2plug.in/ns/ext/port-groups/port-groups.h"
#include "lv2/lv2plug.in/ns/ext/parameters/parameters.h"
-#ifdef HAVE_LV2_1_2_0
#include "lv2/lv2plug.in/ns/ext/buf-size/buf-size.h"
#include "lv2/lv2plug.in/ns/ext/options/options.h"
-#endif
#include "lv2_evbuf.h"
@@ -182,12 +180,10 @@ public:
LilvNode* patch_writable;
LilvNode* patch_Message;
LilvNode* opts_requiredOptions;
-#ifdef HAVE_LV2_1_2_0
LilvNode* bufz_powerOf2BlockLength;
LilvNode* bufz_fixedBlockLength;
LilvNode* bufz_nominalBlockLength;
LilvNode* bufz_coarseBlockLength;
-#endif
#ifdef HAVE_LV2_1_10_0
LilvNode* atom_int;
@@ -313,14 +309,10 @@ log_printf(LV2_Log_Handle handle,
struct LV2Plugin::Impl {
Impl() : plugin(0), ui(0), ui_type(0), name(0), author(0), instance(0)
, work_iface(0)
-#ifdef HAVE_LV2_1_2_0
, opts_iface(0)
-#endif
, state(0)
, block_length(0)
-#ifdef HAVE_LV2_1_2_0
, options(0)
-#endif
#ifdef LV2_EXTENDED
, queue_draw(0)
, midnam(0)
@@ -339,16 +331,12 @@ struct LV2Plugin::Impl {
LilvNode* author;
LilvInstance* instance;
const LV2_Worker_Interface* work_iface;
-#ifdef HAVE_LV2_1_2_0
const LV2_Options_Interface* opts_iface;
-#endif
LilvState* state;
LV2_Atom_Forge forge;
LV2_Atom_Forge ui_forge;
int32_t block_length;
-#ifdef HAVE_LV2_1_2_0
LV2_Options_Option* options;
-#endif
#ifdef LV2_EXTENDED
LV2_Inline_Display* queue_draw;
LV2_Midnam* midnam;
@@ -465,9 +453,7 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
_features[6] = &_log_feature;
unsigned n_features = 7;
-#ifdef HAVE_LV2_1_2_0
_features[n_features++] = &_def_state_feature;
-#endif
lv2_atom_forge_init(&_impl->forge, _uri_map.urid_map());
lv2_atom_forge_init(&_impl->ui_forge, _uri_map.urid_map());
@@ -501,7 +487,6 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
_features[n_features++] = &_bankpatch_feature;
#endif
-#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)
@@ -536,7 +521,6 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
_options_feature.URI = LV2_OPTIONS__options;
_options_feature.data = _impl->options;
_features[n_features++] = &_options_feature;
-#endif
#ifdef LV2_EXTENDED
seen_bankpatch = false;
@@ -595,15 +579,12 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
}
lilv_node_free(worker_iface_uri);
-
-#ifdef HAVE_LV2_1_2_0
LilvNode* options_iface_uri = lilv_new_uri(_world.world, LV2_OPTIONS__interface);
if (lilv_plugin_has_extension_data(plugin, options_iface_uri)) {
_impl->opts_iface = (const LV2_Options_Interface*)extension_data(
LV2_OPTIONS__interface);
}
lilv_node_free(options_iface_uri);
-#endif
#ifdef LV2_EXTENDED
_display_interface = (const LV2_Inline_Display_Interface*)
@@ -627,11 +608,10 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
}
LilvNodes* optional_features = lilv_plugin_get_optional_features (plugin);
-#ifdef HAVE_LV2_1_2_0
if (lilv_nodes_contains (optional_features, _world.bufz_coarseBlockLength)) {
_no_sample_accurate_ctrl = true;
}
-#endif
+
#ifdef LV2_EXTENDED
if (lilv_nodes_contains (optional_features, _world.lv2_noSampleAccurateCtrl)) {
/* deprecated 2016-Sep-18 in favor of bufz_coarseBlockLength */
@@ -873,7 +853,6 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
int
LV2Plugin::set_block_size (pframes_t nframes)
{
-#ifdef HAVE_LV2_1_2_0
if (_impl->opts_iface) {
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
_impl->block_length = nframes;
@@ -883,7 +862,7 @@ LV2Plugin::set_block_size (pframes_t nframes)
};
_impl->opts_iface->set (_impl->instance->lv2_handle, &block_size_option);
}
-#endif
+
return 0;
}
@@ -933,9 +912,7 @@ LV2Plugin::~LV2Plugin ()
lilv_state_free(_impl->state);
lilv_node_free(_impl->name);
lilv_node_free(_impl->author);
-#ifdef HAVE_LV2_1_2_0
free(_impl->options);
-#endif
#ifdef LV2_EXTENDED
free(_impl->queue_draw);
free(_impl->midnam);
@@ -3253,13 +3230,10 @@ LV2World::LV2World()
auto_automation_controller = lilv_new_uri(world, LV2_AUTOMATE_URI__controller);
inline_display_in_gui = lilv_new_uri(world, LV2_INLINEDISPLAY__in_gui);
#endif
-#ifdef HAVE_LV2_1_2_0
bufz_powerOf2BlockLength = lilv_new_uri(world, LV2_BUF_SIZE__powerOf2BlockLength);
bufz_fixedBlockLength = lilv_new_uri(world, LV2_BUF_SIZE__fixedBlockLength);
bufz_nominalBlockLength = lilv_new_uri(world, "http://lv2plug.in/ns/ext/buf-size#nominalBlockLength");
bufz_coarseBlockLength = lilv_new_uri(world, "http://lv2plug.in/ns/ext/buf-size#coarseBlockLength");
-#endif
-
}
LV2World::~LV2World()
@@ -3267,12 +3241,10 @@ LV2World::~LV2World()
if (!world) {
return;
}
-#ifdef HAVE_LV2_1_2_0
lilv_node_free(bufz_coarseBlockLength);
lilv_node_free(bufz_nominalBlockLength);
lilv_node_free(bufz_fixedBlockLength);
lilv_node_free(bufz_powerOf2BlockLength);
-#endif
#ifdef LV2_EXTENDED
lilv_node_free(lv2_noSampleAccurateCtrl);
lilv_node_free(auto_can_write_automatation);
@@ -3472,7 +3444,6 @@ LV2PluginInfo::discover()
continue;
}
-#ifdef HAVE_LV2_1_2_0
int err = 0;
LilvNodes* required_features = lilv_plugin_get_required_features (p);
LILV_FOREACH(nodes, i, required_features) {
@@ -3523,7 +3494,6 @@ LV2PluginInfo::discover()
if (err) {
continue;
}
-#endif
info->type = LV2;