13
0

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
This commit is contained in:
David Robillard 2013-01-27 21:25:34 +00:00
parent 6375b5d278
commit 4469f499a4
2 changed files with 10 additions and 3 deletions

View File

@ -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;

View File

@ -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)