aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-04 20:30:18 +0000
committerDavid Robillard <d@drobilla.net>2012-01-04 20:30:18 +0000
commit68d79ecc564de5652fd7a782c456d882a5a5a775 (patch)
tree716c44b099b8ded04c2f2202f1049eea3e0dc3e2 /plugins
parent7cd85a6942fdd20a722a49d825b34285a3491a47 (diff)
downloadlv2-68d79ecc564de5652fd7a782c456d882a5a5a775.tar.xz
Save files as state:File.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/eg-sampler.lv2/sampler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 088db13..b1feef6 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -84,6 +84,7 @@ typedef struct {
LV2_URID midi_event;
LV2_URID atom_message;
LV2_URID set_message;
+ LV2_URID state_path;
LV2_URID filename_key;
} uris;
@@ -230,6 +231,8 @@ instantiate(const LV2_Descriptor* descriptor,
plugin->map->handle, ATOM_MESSAGE_URI);
plugin->uris.set_message = plugin->map->map(
plugin->map->handle, SET_MESSAGE_URI);
+ plugin->uris.state_path = plugin->map->map(
+ plugin->map->handle, LV2_STATE_PATH_URI);
plugin->uris.filename_key = plugin->map->map(
plugin->map->handle, FILENAME_URI);
}
@@ -363,7 +366,7 @@ save(LV2_Handle instance,
map_uri(plugin, FILENAME_URI),
plugin->samp->filepath,
strlen(plugin->samp->filepath) + 1,
- map_uri(plugin, NS_ATOM "String"),
+ plugin->uris.state_path,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
}
@@ -394,7 +397,7 @@ const void*
extension_data(const char* uri)
{
static const LV2_State_Interface state = { save, restore };
- if (!strcmp(uri, LV2_STATE_URI)) {
+ if (!strcmp(uri, LV2_STATE_URI "#Interface")) {
return &state;
}
return NULL;