From 17c6df0bc3043c57d2c02c58284ec4794f656b3c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 30 Mar 2012 23:27:26 +0000 Subject: Fix screwy invalid ExtensionData definitions as classes (now matches how Feature is used). Add status return codes to state methods for error handling. --- plugins/eg-sampler.lv2/sampler.c | 12 ++++++++---- plugins/eg-sampler.lv2/sampler.ttl | 26 ++++++++++++++------------ 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'plugins') 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: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix ui: . -@prefix urid: . -@prefix work: . +@prefix atom: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix state: . +@prefix ui: . +@prefix urid: . +@prefix work: . a lv2:Plugin ; @@ -30,7 +31,8 @@ lv2:requiredFeature urid:map , work:schedule ; lv2:optionalFeature lv2:hardRTCapable ; - lv2:extensionData ; + lv2:extensionData state:interface , + work:interface ; ui:ui ; lv2:port [ a lv2:InputPort , @@ -40,7 +42,7 @@ ; lv2:index 0 ; lv2:symbol "control" ; - lv2:name "Control" ; + lv2:name "Control" ] , [ a lv2:OutputPort , atom:AtomPort ; @@ -48,13 +50,13 @@ atom:supports ; 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" ] . @@ -63,5 +65,5 @@ ui:portNotification [ ui:plugin ; lv2:symbol "notify" ; - ui:notifyType atom:Blank ; + ui:notifyType atom:Blank ] . -- cgit v1.2.1