diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2017-04-06 16:01:26 +0200 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2017-04-06 16:01:26 +0200 |
commit | 288b25dec6d06c2594b9a23f2619d1b81c1f659d (patch) | |
tree | e1e322a7e67e4f1a35999935975124eff6fc7ef2 /osc_inspector.c | |
parent | 2c9f90ba6238c0cfb7fbd1c1025efebcd0818f25 (diff) | |
download | sherlock.lv2-288b25dec6d06c2594b9a23f2619d1b81c1f659d.tar.xz |
fixes for updated props.lv2.
Diffstat (limited to 'osc_inspector.c')
-rw-r--r-- | osc_inspector.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/osc_inspector.c b/osc_inspector.c index 28f1cb6..69e09fd 100644 --- a/osc_inspector.c +++ b/osc_inspector.c @@ -69,19 +69,15 @@ instantiate(const LV2_Descriptor* descriptor, double rate, lv2_osc_urid_init(&handle->osc_urid, handle->map); lv2_atom_forge_init(&handle->forge, handle->map); - if(!props_init(&handle->props, MAX_NPROPS, descriptor->URI, handle->map, handle)) + if(!props_init(&handle->props, descriptor->URI, + defs, MAX_NPROPS, &handle->state, &handle->stash, + handle->map, handle)) { fprintf(stderr, "failed to allocate property structure\n"); free(handle); return NULL; } - if(!props_register(&handle->props, defs, MAX_NPROPS, &handle->state, &handle->stash)) - { - free(handle); - return NULL; - } - return handle; } @@ -123,6 +119,8 @@ run(LV2_Handle instance, uint32_t nsamples) lv2_atom_forge_set_buffer(forge, (uint8_t *)handle->control_out, capacity); ref = lv2_atom_forge_sequence_head(forge, frame, 0); + props_idle(&handle->props, forge, 0, &ref); + LV2_ATOM_SEQUENCE_FOREACH(handle->control_in, ev) { const LV2_Atom_Object *obj = (const LV2_Atom_Object *)&ev->body; @@ -233,36 +231,11 @@ static const LV2_State_Interface state_iface = { .restore = _state_restore }; -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; } |