summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-23 02:41:56 +0000
committerDavid Robillard <d@drobilla.net>2011-12-23 02:41:56 +0000
commitc5c4a6e935eecc2d2dac7bb9cccd36057b8dc123 (patch)
treeaac647c5a0fcc59bfe583bb25c6b508f21db7a19 /src/plugin.c
parentb760711088bb027d7c84eec7c19360d8f02680ec (diff)
downloadlilv-c5c4a6e935eecc2d2dac7bb9cccd36057b8dc123.tar.gz
lilv-c5c4a6e935eecc2d2dac7bb9cccd36057b8dc123.tar.bz2
lilv-c5c4a6e935eecc2d2dac7bb9cccd36057b8dc123.zip
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
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c20
1 files changed, 8 insertions, 12 deletions
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