diff options
author | David Robillard <d@drobilla.net> | 2012-03-27 00:17:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-27 00:17:35 +0000 |
commit | 4f93a2176809dab5792eca26f59f908ee1aac793 (patch) | |
tree | 474a28263eae5d01d6e623daee1cc458f9db5acb | |
parent | 882cb0ae306d8a26699a1c9224640cc8cf8971a3 (diff) | |
download | lv2-4f93a2176809dab5792eca26f59f908ee1aac793.tar.xz |
Add end_run hook to worker interface.
-rw-r--r-- | lv2/lv2plug.in/ns/ext/worker/worker.h | 12 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/sampler.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lv2/lv2plug.in/ns/ext/worker/worker.h b/lv2/lv2plug.in/ns/ext/worker/worker.h index 6b1e261..b0d87ec 100644 --- a/lv2/lv2plug.in/ns/ext/worker/worker.h +++ b/lv2/lv2plug.in/ns/ext/worker/worker.h @@ -94,6 +94,18 @@ typedef struct _LV2_Worker_Interface { LV2_Worker_Status (*work_response)(LV2_Handle instance, uint32_t size, const void* body); + + /** + Called when all responses for this cycle have been delivered. + + Since work_response() may be called after run() finished, this provides + a hook for code that must run after the cycle is completed. + + This field may be NULL if the plugin has no use for it. Otherwise, the + host MUST call it after every run(), regardless of whether or not any + responses were sent that cycle. + */ + LV2_Worker_Status (*end_run)(LV2_Handle instance); } LV2_Worker_Interface; typedef void* LV2_Worker_Schedule_Handle; diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 229762e..baae81a 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -425,7 +425,7 @@ static const void* extension_data(const char* uri) { static const LV2_State_Interface state = { save, restore }; - static const LV2_Worker_Interface worker = { work, work_response }; + static const LV2_Worker_Interface worker = { work, work_response, NULL }; if (!strcmp(uri, LV2_STATE__Interface)) { return &state; } else if (!strcmp(uri, LV2_WORKER__Interface)) { |