aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-30 23:27:26 +0000
committerDavid Robillard <d@drobilla.net>2012-03-30 23:27:26 +0000
commit17c6df0bc3043c57d2c02c58284ec4794f656b3c (patch)
treee1729e4891aca09fe4a0f560618a74a8fc608833 /plugins
parent689d75259a7187b2cb6a592025f11bc7d3aa58a2 (diff)
downloadlv2-17c6df0bc3043c57d2c02c58284ec4794f656b3c.tar.xz
Fix screwy invalid ExtensionData definitions as classes (now matches how Feature is used).
Add status return codes to state methods for error handling.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/eg-sampler.lv2/sampler.c12
-rw-r--r--plugins/eg-sampler.lv2/sampler.ttl26
2 files changed, 22 insertions, 16 deletions
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index baae81a..fa6adbe 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -367,7 +367,7 @@ run(LV2_Handle instance,
}
}
-static void
+static LV2_State_Status
save(LV2_Handle instance,
LV2_State_Store_Function store,
LV2_State_Handle handle,
@@ -393,9 +393,11 @@ save(LV2_Handle instance,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
free(apath);
+
+ return LV2_STATE_SUCCESS;
}
-static void
+static LV2_State_Status
restore(LV2_Handle instance,
LV2_State_Retrieve_Function retrieve,
LV2_State_Handle handle,
@@ -419,6 +421,8 @@ restore(LV2_Handle instance,
free_sample(plugin->sample);
plugin->sample = load_sample(plugin, path);
}
+
+ return LV2_STATE_SUCCESS;
}
static const void*
@@ -426,9 +430,9 @@ extension_data(const char* uri)
{
static const LV2_State_Interface state = { save, restore };
static const LV2_Worker_Interface worker = { work, work_response, NULL };
- if (!strcmp(uri, LV2_STATE__Interface)) {
+ if (!strcmp(uri, LV2_STATE__interface)) {
return &state;
- } else if (!strcmp(uri, LV2_WORKER__Interface)) {
+ } else if (!strcmp(uri, LV2_WORKER__interface)) {
return &worker;
}
return NULL;
diff --git a/plugins/eg-sampler.lv2/sampler.ttl b/plugins/eg-sampler.lv2/sampler.ttl
index e6bd816..140992e 100644
--- a/plugins/eg-sampler.lv2/sampler.ttl
+++ b/plugins/eg-sampler.lv2/sampler.ttl
@@ -15,13 +15,14 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
-@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
-@prefix work: <http://lv2plug.in/ns/ext/worker#> .
+@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix state: <http://lv2plug.in/ns/ext/state#> .
+@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
+@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
+@prefix work: <http://lv2plug.in/ns/ext/worker#> .
<http://lv2plug.in/plugins/eg-sampler>
a lv2:Plugin ;
@@ -30,7 +31,8 @@
lv2:requiredFeature urid:map ,
work:schedule ;
lv2:optionalFeature lv2:hardRTCapable ;
- lv2:extensionData <http://lv2plug.in/ns/ext/state#Interface> ;
+ lv2:extensionData state:interface ,
+ work:interface ;
ui:ui <http://lv2plug.in/plugins/eg-sampler#ui> ;
lv2:port [
a lv2:InputPort ,
@@ -40,7 +42,7 @@
<http://lv2plug.in/ns/ext/patch#Message> ;
lv2:index 0 ;
lv2:symbol "control" ;
- lv2:name "Control" ;
+ lv2:name "Control"
] , [
a lv2:OutputPort ,
atom:AtomPort ;
@@ -48,13 +50,13 @@
atom:supports <http://lv2plug.in/ns/ext/patch#Message> ;
lv2:index 1 ;
lv2:symbol "notify" ;
- lv2:name "Notify" ;
+ lv2:name "Notify"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 2 ;
lv2:symbol "out" ;
- lv2:name "Out" ;
+ lv2:name "Out"
] .
<http://lv2plug.in/plugins/eg-sampler#ui>
@@ -63,5 +65,5 @@
ui:portNotification [
ui:plugin <http://lv2plug.in/plugins/eg-sampler> ;
lv2:symbol "notify" ;
- ui:notifyType atom:Blank ;
+ ui:notifyType atom:Blank
] .