aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-18 12:01:17 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-18 12:01:17 +0100
commit6b44a44c189198d4ba212d65d37b56d836089f3c (patch)
tree59be470f69358fcfdfc0160a8731cfbdbf67c6f1
parent6ca13cb62f077b7e28407f9ced62cd7b699bb503 (diff)
downloadsherlock.lv2-6b44a44c189198d4ba212d65d37b56d836089f3c.tar.xz
fixes for updated props.lv2.
-rw-r--r--VERSION2
-rw-r--r--atom_inspector.c38
-rw-r--r--midi_inspector.c38
-rw-r--r--osc_inspector.c38
-rw-r--r--sherlock.h40
-rw-r--r--sherlock_nk.c8
6 files changed, 117 insertions, 47 deletions
diff --git a/VERSION b/VERSION
index ac454c6..bda222e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.12.0
+0.13.17
diff --git a/atom_inspector.c b/atom_inspector.c
index 9e71b43..bf46589 100644
--- a/atom_inspector.c
+++ b/atom_inspector.c
@@ -71,9 +71,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
return NULL;
}
- if( !props_register(&handle->props, &stat_overwrite, &handle->state.overwrite, &handle->stash.overwrite)
- || !props_register(&handle->props, &stat_block, &handle->state.block, &handle->stash.block)
- || !props_register(&handle->props, &stat_follow, &handle->state.follow, &handle->stash.follow) )
+ if(!props_register(&handle->props, defs, MAX_NPROPS, &handle->state, &handle->stash))
{
free(handle);
return NULL;
@@ -196,7 +194,7 @@ _state_save(LV2_Handle instance, LV2_State_Store_Function store,
{
handle_t *handle = instance;
- return props_save(&handle->props, &handle->forge, store, state, flags, features);
+ return props_save(&handle->props, store, state, flags, features);
}
static LV2_State_Status
@@ -206,7 +204,7 @@ _state_restore(LV2_Handle instance, LV2_State_Retrieve_Function retrieve,
{
handle_t *handle = instance;
- return props_restore(&handle->props, &handle->forge, retrieve, state, flags, features);
+ return props_restore(&handle->props, retrieve, state, flags, features);
}
static const LV2_State_Interface state_iface = {
@@ -214,11 +212,37 @@ static const LV2_State_Interface state_iface = {
.restore = _state_restore
};
-static const void *
-extension_data(const char *uri)
+static inline LV2_Worker_Status
+_work(LV2_Handle instance, LV2_Worker_Respond_Function respond,
+LV2_Worker_Respond_Handle worker, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work(&handle->props, respond, worker, size, body);
+}
+
+static inline LV2_Worker_Status
+_work_response(LV2_Handle instance, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work_response(&handle->props, size, body);
+}
+
+static const LV2_Worker_Interface work_iface = {
+ .work = _work,
+ .work_response = _work_response,
+ .end_run = NULL
+};
+
+static const void*
+extension_data(const char* uri)
{
if(!strcmp(uri, LV2_STATE__interface))
return &state_iface;
+ else if(!strcmp(uri, LV2_WORKER__interface))
+ return &work_iface;
+
return NULL;
}
diff --git a/midi_inspector.c b/midi_inspector.c
index 29c50a0..761fb09 100644
--- a/midi_inspector.c
+++ b/midi_inspector.c
@@ -76,9 +76,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
return NULL;
}
- if( !props_register(&handle->props, &stat_overwrite, &handle->state.overwrite, &handle->stash.overwrite)
- || !props_register(&handle->props, &stat_block, &handle->state.block, &handle->stash.block)
- || !props_register(&handle->props, &stat_follow, &handle->state.follow, &handle->stash.follow) )
+ if(!props_register(&handle->props, defs, MAX_NPROPS, &handle->state, &handle->stash))
{
free(handle);
return NULL;
@@ -215,7 +213,7 @@ _state_save(LV2_Handle instance, LV2_State_Store_Function store,
{
handle_t *handle = instance;
- return props_save(&handle->props, &handle->forge, store, state, flags, features);
+ return props_save(&handle->props, store, state, flags, features);
}
static LV2_State_Status
@@ -225,7 +223,7 @@ _state_restore(LV2_Handle instance, LV2_State_Retrieve_Function retrieve,
{
handle_t *handle = instance;
- return props_restore(&handle->props, &handle->forge, retrieve, state, flags, features);
+ return props_restore(&handle->props, retrieve, state, flags, features);
}
static const LV2_State_Interface state_iface = {
@@ -233,11 +231,37 @@ static const LV2_State_Interface state_iface = {
.restore = _state_restore
};
-static const void *
-extension_data(const char *uri)
+static inline LV2_Worker_Status
+_work(LV2_Handle instance, LV2_Worker_Respond_Function respond,
+LV2_Worker_Respond_Handle worker, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work(&handle->props, respond, worker, size, body);
+}
+
+static inline LV2_Worker_Status
+_work_response(LV2_Handle instance, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work_response(&handle->props, size, body);
+}
+
+static const LV2_Worker_Interface work_iface = {
+ .work = _work,
+ .work_response = _work_response,
+ .end_run = NULL
+};
+
+static const void*
+extension_data(const char* uri)
{
if(!strcmp(uri, LV2_STATE__interface))
return &state_iface;
+ else if(!strcmp(uri, LV2_WORKER__interface))
+ return &work_iface;
+
return NULL;
}
diff --git a/osc_inspector.c b/osc_inspector.c
index f3ebb58..28f1cb6 100644
--- a/osc_inspector.c
+++ b/osc_inspector.c
@@ -76,9 +76,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
return NULL;
}
- if( !props_register(&handle->props, &stat_overwrite, &handle->state.overwrite, &handle->stash.overwrite)
- || !props_register(&handle->props, &stat_block, &handle->state.block, &handle->stash.block)
- || !props_register(&handle->props, &stat_follow, &handle->state.follow, &handle->stash.follow) )
+ if(!props_register(&handle->props, defs, MAX_NPROPS, &handle->state, &handle->stash))
{
free(handle);
return NULL;
@@ -217,7 +215,7 @@ _state_save(LV2_Handle instance, LV2_State_Store_Function store,
{
handle_t *handle = instance;
- return props_save(&handle->props, &handle->forge, store, state, flags, features);
+ return props_save(&handle->props, store, state, flags, features);
}
static LV2_State_Status
@@ -227,7 +225,7 @@ _state_restore(LV2_Handle instance, LV2_State_Retrieve_Function retrieve,
{
handle_t *handle = instance;
- return props_restore(&handle->props, &handle->forge, retrieve, state, flags, features);
+ return props_restore(&handle->props, retrieve, state, flags, features);
}
static const LV2_State_Interface state_iface = {
@@ -235,11 +233,37 @@ static const LV2_State_Interface state_iface = {
.restore = _state_restore
};
-static const void *
-extension_data(const char *uri)
+static inline LV2_Worker_Status
+_work(LV2_Handle instance, LV2_Worker_Respond_Function respond,
+LV2_Worker_Respond_Handle worker, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work(&handle->props, respond, worker, size, body);
+}
+
+static inline LV2_Worker_Status
+_work_response(LV2_Handle instance, uint32_t size, const void *body)
+{
+ handle_t *handle = instance;
+
+ return props_work_response(&handle->props, size, body);
+}
+
+static const LV2_Worker_Interface work_iface = {
+ .work = _work,
+ .work_response = _work_response,
+ .end_run = NULL
+};
+
+static const void*
+extension_data(const char* uri)
{
if(!strcmp(uri, LV2_STATE__interface))
return &state_iface;
+ else if(!strcmp(uri, LV2_WORKER__interface))
+ return &work_iface;
+
return NULL;
}
diff --git a/sherlock.h b/sherlock.h
index 524a3a2..5940da0 100644
--- a/sherlock.h
+++ b/sherlock.h
@@ -63,29 +63,25 @@ struct _state_t {
int32_t follow;
};
-#define MAX_NPROPS 4
-
-static const props_def_t stat_overwrite = {
- .property = SHERLOCK_URI"#overwrite",
- .access = LV2_PATCH__writable,
- .type = LV2_ATOM__Bool,
- .mode = PROP_MODE_STATIC
-};
-
-static const props_def_t stat_block = {
- .property = SHERLOCK_URI"#block",
- .access = LV2_PATCH__writable,
- .type = LV2_ATOM__Bool,
- .mode = PROP_MODE_STATIC
+#define MAX_NPROPS 3
+
+static const props_def_t defs [MAX_NPROPS] = {
+ {
+ .property = SHERLOCK_URI"#overwrite",
+ .offset = offsetof(state_t, overwrite),
+ .type = LV2_ATOM__Bool,
+ },
+ {
+ .property = SHERLOCK_URI"#block",
+ .offset = offsetof(state_t, block),
+ .type = LV2_ATOM__Bool,
+ },
+ {
+ .property = SHERLOCK_URI"#follow",
+ .offset = offsetof(state_t, follow),
+ .type = LV2_ATOM__Bool,
+ }
};
-
-static const props_def_t stat_follow = {
- .property = SHERLOCK_URI"#follow",
- .access = LV2_PATCH__writable,
- .type = LV2_ATOM__Bool,
- .mode = PROP_MODE_STATIC
-};
-
// there is a bug in LV2 <= 0.10
#if defined(LV2_ATOM_TUPLE_FOREACH)
# undef LV2_ATOM_TUPLE_FOREACH
diff --git a/sherlock_nk.c b/sherlock_nk.c
index c272689..5cc94f0 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -272,14 +272,16 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
}
- if( !(handle->urid.overwrite = props_register(&handle->props, &stat_overwrite, &handle->state.overwrite, &handle->stash.overwrite))
- || !(handle->urid.block = props_register(&handle->props, &stat_block, &handle->state.block, &handle->stash.block))
- || !(handle->urid.follow = props_register(&handle->props, &stat_follow, &handle->state.follow, &handle->stash.follow)) )
+ if(!props_register(&handle->props, defs, MAX_NPROPS, &handle->state, &handle->stash))
{
free(handle);
return NULL;
}
+ handle->urid.overwrite = props_map(&handle->props, defs[0].property);;
+ handle->urid.block = props_map(&handle->props, defs[1].property);;
+ handle->urid.follow = props_map(&handle->props, defs[2].property);;
+
const char *NK_SCALE = getenv("NK_SCALE");
const float scale = NK_SCALE ? atof(NK_SCALE) : 1.f;
handle->dy = 20.f * scale;