From 67303a64e1a7e6aa683ae39c54c32ad8bd0730ab Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 27 Jan 2013 02:36:18 +0000 Subject: Don't print errors when loading plugin description as default state. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5010 a436a847-0d15-0410-975c-d299462d15a1 --- NEWS | 5 +++-- src/state.c | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index e79a665..bfaeea2 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,8 @@ lilv (0.15.0) unstable; * Add lilv_nodes_merge() * Make lilv_plugin_get_port_by_designation() return a const pointer * Make state loading functions fall back to lv2:default for port values, - so a plugin description can be loaded as default state. + so a plugin description can be loaded as default state + * Ignore state ports with no value instead of printing an error * Support atom:supports in lilv_port_supports_event() * Add va_list variant of lilv_plugin_get_num_ports_of_class() * Fix several plugin functions that failed to load data if called first @@ -14,7 +15,7 @@ lilv (0.15.0) unstable; * lilvmm.hpp: Add several missing methods * Update to waf 1.7.8 and autowaf r90 (install docs to versioned directory) - -- David Robillard Sat, 26 Jan 2013 16:17:52 -0500 + -- David Robillard Sat, 26 Jan 2013 21:14:13 -0500 lilv (0.14.4) stable; diff --git a/src/state.c b/src/state.c index 081aaf0..d693f1a 100644 --- a/src/state.c +++ b/src/state.c @@ -463,6 +463,12 @@ new_state_from_model(LilvWorld* world, state->dir = lilv_strdup((const char*)sord_node_get_string(graph)); } sord_iter_free(i); + } else if (sord_search(model, + node, + world->uris.rdf_a, + world->uris.lv2_Plugin, 0)) { + // Loading plugin description as state (default state) + state->plugin_uri = lilv_node_new_from_node(world, node); } else { LILV_ERRORF("State %s missing lv2:appliesTo property\n", sord_node_get_string(node)); @@ -500,11 +506,7 @@ new_state_from_model(LilvWorld* world, if (!symbol) { LILV_ERRORF("State `%s' port missing symbol.\n", sord_node_get_string(node)); - } else if (!value) { - LILV_ERRORF("State `%s' port `%s' missing value.\n", - sord_node_get_string(symbol), - sord_node_get_string(node)); - } else { + } else if (value) { chunk.len = 0; sratom_read(sratom, &forge, world->world, model, value); LV2_Atom* atom = (LV2_Atom*)chunk.buf; -- cgit v1.2.1