From: David Robillard Date: Sun, 27 Jan 2013 21:25:34 +0000 (+0000) Subject: Only load default state with lilv >= 0.15.0 (currently svn only) to avoid warnings. X-Git-Tag: 3.0~125 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=4469f499a47ab6192bb483f9bcc5f6e6f9c2c37b;p=ardour.git 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 --- 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)