aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2017-12-21 18:16:11 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2017-12-21 18:16:11 +0100
commitf97c3a7982d3a635dc3d396af633aa1dc09b4193 (patch)
tree23a41c29409308cebfdf17b3b0ce5d4702cf3dfa
parentcce795b1fabb4fbc377b3da6347560ee29f74b17 (diff)
downloadlv2lint-f97c3a7982d3a635dc3d396af633aa1dc09b4193.zip
lv2lint-f97c3a7982d3a635dc3d396af633aa1dc09b4193.tar.gz
lv2lint-f97c3a7982d3a635dc3d396af633aa1dc09b4193.tar.bz2
lv2lint-f97c3a7982d3a635dc3d396af633aa1dc09b4193.tar.xz
Prototype loading default state.
-rw-r--r--VERSION2
-rw-r--r--lv2lint.c27
2 files changed, 28 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index ba218fd..87fb753 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.203
+0.1.205
diff --git a/lv2lint.c b/lv2lint.c
index 188cbe2..4d44f17 100644
--- a/lv2lint.c
+++ b/lv2lint.c
@@ -619,6 +619,13 @@ test_visibility(const char *path, const char *description)
}
#endif
+static void
+_state_set_value(const char *symbol, void *data,
+ const void *value, uint32_t size, uint32_t type)
+{
+ //FIXME
+}
+
int
main(int argc, char **argv)
{
@@ -1059,6 +1066,26 @@ main(int argc, char **argv)
app.idisp_iface = lilv_instance_get_extension_data(app.instance, LV2_INLINEDISPLAY__interface);
app.state_iface = lilv_instance_get_extension_data(app.instance, LV2_STATE__interface);
app.opts_iface = lilv_instance_get_extension_data(app.instance, LV2_OPTIONS__interface);
+
+ const bool has_load_default = lilv_plugin_has_feature(app.plugin,
+ app.uris.state_loadDefaultState);
+ if(has_load_default)
+ {
+ const LilvNode *pset = lilv_plugin_get_uri(app.plugin);
+
+ lilv_world_load_resource(app.world, pset);
+
+ LilvState *state = lilv_state_new_from_world(app.world, &map, pset);
+ if(state)
+ {
+ lilv_state_restore(state, app.instance, _state_set_value, &app,
+ LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE, NULL); //FIXME features
+
+ lilv_state_free(state);
+ }
+
+ lilv_world_unload_resource(app.world, pset);
+ }
}
if(!test_plugin(&app))