summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--src/state.c12
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 <d@drobilla.net> Sat, 26 Jan 2013 16:17:52 -0500
+ -- David Robillard <d@drobilla.net> 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;