summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-27 21:25:34 +0000
committerDavid Robillard <d@drobilla.net>2013-01-27 21:25:34 +0000
commit4469f499a47ab6192bb483f9bcc5f6e6f9c2c37b (patch)
tree32515550ca9a4b6e0b3461ba1e215f376e71570b /libs
parent6375b5d278e6ca766de879d26fc6beb5eb11ca3c (diff)
Only load default state with lilv >= 0.15.0 (currently svn only) to avoid warnings.
git-svn-id: svn://localhost/ardour2/branches/3.0@14013 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/lv2_plugin.cc11
-rw-r--r--libs/ardour/wscript2
2 files changed, 10 insertions, 3 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index d464ed6f2e..58f5844501 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -303,7 +303,7 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
lilv_node_free(state_uri);
lilv_node_free(state_iface_uri);
- _features = (LV2_Feature**)calloc(10, sizeof(LV2_Feature*));
+ _features = (LV2_Feature**)calloc(11, sizeof(LV2_Feature*));
_features[0] = &_instance_access_feature;
_features[1] = &_data_access_feature;
_features[2] = &_make_path_feature;
@@ -311,11 +311,14 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
_features[4] = _uri_map.urid_map_feature();
_features[5] = _uri_map.urid_unmap_feature();
_features[6] = &_log_feature;
- _features[7] = &_def_state_feature;
+
+ unsigned n_features = 7;
+#ifdef HAVE_NEW_LV2
+ _features[n_features++] = &_def_state_feature;
+#endif
lv2_atom_forge_init(&_impl->forge, _uri_map.urid_map());
- unsigned n_features = 8;
#ifdef HAVE_NEW_LV2
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
LV2_Options_Option options[] = {
@@ -387,12 +390,14 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
throw failed_constructor();
}
+#ifdef HAVE_NEW_LILV
// Load default state
LilvState* state = lilv_state_new_from_world(
_world.world, _uri_map.urid_map(), lilv_plugin_get_uri(_impl->plugin));
if (state) {
lilv_state_restore(state, _impl->instance, NULL, NULL, 0, NULL);
}
+#endif
_sample_rate = rate;
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index c916e4390c..6bd69a0964 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -270,6 +270,8 @@ def configure(conf):
atleast_version='0.2.0', mandatory=True)
autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
atleast_version='0.14.0', mandatory=True)
+ autowaf.check_pkg(conf, 'lilv-0', uselib_store='NEW_LILV',
+ atleast_version='0.15.0', mandatory=True)
autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
atleast_version='0.6.0', mandatory=False)
conf.define ('LV2_SUPPORT', 1)