diff options
-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)) { |