summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-02-19 03:34:33 +0000
committerDavid Robillard <d@drobilla.net>2012-02-19 03:34:33 +0000
commita16cf55af62ee2ac628575c68460faaa70fa1906 (patch)
tree966251db44d06880bf1e2176ebb7a5446ae7b204
parent53953ed0269a184178e024458c70dbc7abafdb19 (diff)
downloadlilv-a16cf55af62ee2ac628575c68460faaa70fa1906.tar.gz
lilv-a16cf55af62ee2ac628575c68460faaa70fa1906.tar.bz2
lilv-a16cf55af62ee2ac628575c68460faaa70fa1906.zip
Update for latest LV2 changes.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3987 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/state.c19
-rw-r--r--test/lilv_test.c2
-rw-r--r--test/test_plugin.c17
3 files changed, 20 insertions, 18 deletions
diff --git a/src/state.c b/src/state.c
index 9d039ea..85d211b 100644
--- a/src/state.c
+++ b/src/state.c
@@ -22,6 +22,7 @@
#include "lilv_internal.h"
#ifdef HAVE_LV2_STATE
+# include "lv2/lv2plug.in/ns/ext/atom/atom.h"
# include "lv2/lv2plug.in/ns/ext/state/state.h"
#endif
@@ -344,11 +345,11 @@ lilv_state_new_from_instance(const LilvPlugin* plugin,
state->dir = save_dir ? absolute_dir(save_dir, false) : NULL;
#ifdef HAVE_LV2_STATE
- state->state_Path = map->map(map->handle, LV2_STATE_PATH_URI);
+ state->state_Path = map->map(map->handle, LV2_ATOM__Path);
LV2_State_Map_Path pmap = { state, abstract_path, absolute_path };
- LV2_Feature pmap_feature = { LV2_STATE_MAP_PATH_URI, &pmap };
+ LV2_Feature pmap_feature = { LV2_STATE__mapPath, &pmap };
LV2_State_Make_Path pmake = { state, make_path };
- LV2_Feature pmake_feature = { LV2_STATE_MAKE_PATH_URI, &pmake };
+ LV2_Feature pmake_feature = { LV2_STATE__makePath, &pmake };
features = sfeatures = add_features(features, &pmap_feature,
save_dir ? &pmake_feature : NULL);
#endif
@@ -373,7 +374,7 @@ lilv_state_new_from_instance(const LilvPlugin* plugin,
#ifdef HAVE_LV2_STATE
const LV2_Descriptor* desc = instance->lv2_descriptor;
const LV2_State_Interface* iface = (desc->extension_data)
- ? (LV2_State_Interface*)desc->extension_data(LV2_STATE_INTERFACE_URI)
+ ? (LV2_State_Interface*)desc->extension_data(LV2_STATE__Interface)
: NULL;
if (iface) {
@@ -401,14 +402,14 @@ lilv_state_restore(const LilvState* state,
#ifdef HAVE_LV2_STATE
LV2_State_Map_Path map_path = {
(LilvState*)state, abstract_path, absolute_path };
- LV2_Feature map_feature = { LV2_STATE_MAP_PATH_URI, &map_path };
+ LV2_Feature map_feature = { LV2_STATE__mapPath, &map_path };
const LV2_Feature** sfeatures = add_features(features, &map_feature, NULL);
features = sfeatures;
const LV2_Descriptor* desc = instance->lv2_descriptor;
const LV2_State_Interface* iface = (desc->extension_data)
- ? (LV2_State_Interface*)desc->extension_data(LV2_STATE_INTERFACE_URI)
+ ? (LV2_State_Interface*)desc->extension_data(LV2_STATE__Interface)
: NULL;
if (iface) {
@@ -496,7 +497,7 @@ new_state_from_model(LilvWorld* world,
state->dir = dir ? lilv_strdup(dir) : NULL;
#ifdef HAVE_LV2_STATE
- state->state_Path = map->map(map->handle, LV2_STATE_PATH_URI);
+ state->state_Path = map->map(map->handle, LV2_ATOM__Path);
#endif
// Get the plugin URI this state applies to
@@ -560,7 +561,7 @@ new_state_from_model(LilvWorld* world,
#ifdef HAVE_LV2_STATE
SordNode* state_path_node = sord_new_uri(world->world,
- USTR(LV2_STATE_PATH_URI));
+ USTR(LV2_ATOM__Path));
#endif
// Get properties
@@ -599,7 +600,7 @@ new_state_from_model(LilvWorld* world,
} else if (sord_node_equals(sord_node_get_datatype(o),
state_path_node)) {
prop.size = strlen((const char*)sord_node_get_string(o)) + 1;
- prop.type = map->map(map->handle, LV2_STATE_PATH_URI);
+ prop.type = map->map(map->handle, LV2_ATOM__Path);
prop.flags = LV2_STATE_IS_PORTABLE;
prop.value = lilv_path_join(
state->dir, (const char*)sord_node_get_string(o));
diff --git a/test/lilv_test.c b/test/lilv_test.c
index 55986c9..b20b9df 100644
--- a/test/lilv_test.c
+++ b/test/lilv_test.c
@@ -1242,7 +1242,7 @@ test_state(void)
link_dir = lilv_realpath("links");
LV2_State_Make_Path make_path = { NULL, lilv_make_path };
- LV2_Feature make_path_feature = { LV2_STATE_MAKE_PATH_URI, &make_path };
+ LV2_Feature make_path_feature = { LV2_STATE__makePath, &make_path };
const LV2_Feature* ffeatures[] = { &make_path_feature, &map_feature, NULL };
lilv_instance_deactivate(instance);
diff --git a/test/test_plugin.c b/test/test_plugin.c
index 489ea26..ea6d154 100644
--- a/test/test_plugin.c
+++ b/test/test_plugin.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
+#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
@@ -109,7 +110,7 @@ instantiate(const LV2_Descriptor* descriptor,
test->map = (LV2_URID_Map*)features[i]->data;
test->uris.atom_Float = test->map->map(
test->map->handle, NS_ATOM "Float");
- } else if (!strcmp(features[i]->URI, LV2_STATE_MAKE_PATH_URI)) {
+ } else if (!strcmp(features[i]->URI, LV2_STATE__makePath)) {
make_path = (LV2_State_Make_Path*)features[i]->data;
}
}
@@ -168,9 +169,9 @@ save(LV2_Handle instance,
LV2_State_Map_Path* map_path = NULL;
LV2_State_Make_Path* make_path = NULL;
for (int i = 0; features && features[i]; ++i) {
- if (!strcmp(features[i]->URI, LV2_STATE_MAP_PATH_URI)) {
+ if (!strcmp(features[i]->URI, LV2_STATE__mapPath)) {
map_path = (LV2_State_Map_Path*)features[i]->data;
- } else if (!strcmp(features[i]->URI, LV2_STATE_MAKE_PATH_URI)) {
+ } else if (!strcmp(features[i]->URI, LV2_STATE__makePath)) {
make_path = (LV2_State_Make_Path*)features[i]->data;
}
}
@@ -247,7 +248,7 @@ save(LV2_Handle instance,
map_uri(plugin, "http://example.org/extfile"),
apath,
strlen(apath) + 1,
- map_uri(plugin, LV2_STATE_PATH_URI),
+ map_uri(plugin, LV2_ATOM__Path),
LV2_STATE_IS_PORTABLE);
free(apath);
@@ -262,7 +263,7 @@ save(LV2_Handle instance,
map_uri(plugin, "http://example.org/recfile"),
apath,
strlen(apath) + 1,
- map_uri(plugin, LV2_STATE_PATH_URI),
+ map_uri(plugin, LV2_ATOM__Path),
LV2_STATE_IS_PORTABLE);
free(apath);
@@ -279,7 +280,7 @@ save(LV2_Handle instance,
map_uri(plugin, "http://example.org/save-file"),
apath,
strlen(apath) + 1,
- map_uri(plugin, LV2_STATE_PATH_URI),
+ map_uri(plugin, LV2_ATOM__Path),
LV2_STATE_IS_PORTABLE);
free(apath);
}
@@ -297,7 +298,7 @@ restore(LV2_Handle instance,
LV2_State_Map_Path* map_path = NULL;
for (int i = 0; features && features[i]; ++i) {
- if (!strcmp(features[i]->URI, LV2_STATE_MAP_PATH_URI)) {
+ if (!strcmp(features[i]->URI, LV2_STATE__mapPath)) {
map_path = (LV2_State_Map_Path*)features[i]->data;
}
}
@@ -350,7 +351,7 @@ const void*
extension_data(const char* uri)
{
static const LV2_State_Interface state = { save, restore };
- if (!strcmp(uri, LV2_STATE_INTERFACE_URI)) {
+ if (!strcmp(uri, LV2_STATE__Interface)) {
return &state;
}
return NULL;