From c5c4a6e935eecc2d2dac7bb9cccd36057b8dc123 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 23 Dec 2011 02:41:56 +0000 Subject: Add LilvState API for handling plugin state. This makes it simple to save and restore plugin state both in memory and on disk, as well as save presets in a host-sharable way since the disk format is identical to the LV2 presets format. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3899 a436a847-0d15-0410-975c-d299462d15a1 --- src/plugin.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/plugin.c') diff --git a/src/plugin.c b/src/plugin.c index b305291..fd4b300 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -670,7 +670,7 @@ lilv_plugin_has_extension_data(const LilvPlugin* p, return false; } } - + LILV_API LilvNodes* lilv_plugin_get_extension_data(const LilvPlugin* p) @@ -833,8 +833,11 @@ LilvNodes* lilv_plugin_get_related(const LilvPlugin* plugin, const LilvNode* type) { LilvWorld* const world = plugin->world; - LilvNodes* const related = lilv_world_find_nodes( - world, NULL, world->lv2_applies_to_val, lilv_plugin_get_uri(plugin)); + LilvNodes* const related = lilv_world_query_values_internal( + world, + NULL, + world->lv2_appliesTo_node, + lilv_plugin_get_uri(plugin)->val.uri_val); if (!type) { return related; @@ -857,13 +860,6 @@ lilv_plugin_get_related(const LilvPlugin* plugin, const LilvNode* type) return matches; } -static size_t -file_sink(const void* buf, size_t len, void* stream) -{ - FILE* file = (FILE*)stream; - return fwrite(buf, 1, len, file); -} - static SerdEnv* new_lv2_env(const SerdNode* base) { @@ -910,7 +906,7 @@ lilv_plugin_write_description(LilvWorld* world, SERD_STYLE_ABBREVIATED|SERD_STYLE_CURIED, env, NULL, - file_sink, + serd_file_sink, plugin_file); // Write prefixes if this is a new file @@ -950,7 +946,7 @@ lilv_plugin_write_manifest_entry(LilvWorld* world, SERD_STYLE_ABBREVIATED|SERD_STYLE_CURIED, env, NULL, - file_sink, + serd_file_sink, manifest_file); // Write prefixes if this is a new file -- cgit v1.2.1