From fe294dfcf5b009d7dd5dd18b7a26f71eb619a893 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 24 Jul 2016 19:16:10 -0400 Subject: Add lilv_state_set_metadata() This allows setting useful metadata on a state description accessible to hosts but not plugins, such as pset:bank and rdfs:comment. Based on patch from Hanspeter Portner. --- test/lilv_test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/lilv_test.c') diff --git a/test/lilv_test.c b/test/lilv_test.c index ca73b42..eb06dcd 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -1661,6 +1661,18 @@ test_state(void) get_port_value, world, 0, NULL); TEST_ASSERT(lilv_state_equals(state2, state4)); + // Set some metadata properties + lilv_state_set_metadata(state, map.map(map.handle, LILV_NS_RDFS "comment"), + "This is a comment", + strlen("This is a comment") + 1, + map.map(map.handle, "http://lv2plug.in/ns/ext/atom#Literal"), + LV2_STATE_IS_POD); + lilv_state_set_metadata(state, map.map(map.handle, "http://example.org/metablob"), + "LIVEBEEF", + strlen("LIVEBEEF") + 1, + map.map(map.handle, "http://example.org/MetaBlob"), + 0); + // Save state to a directory int ret = lilv_state_save(world, &map, &unmap, state, NULL, "state/state.lv2", "state.ttl"); -- cgit v1.2.1