commit 855b3abe7a01224eef29aac6e1e9c1f880eb1f71
parent aa5e9cb8b63e39fcbf28eba95c5b722702a2a3da
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Thu, 3 Mar 2022 09:39:42 +0100
clap_output_events now has try_push() instead
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/clap/events.h b/include/clap/events.h
@@ -227,10 +227,11 @@ typedef struct clap_event_midi2 {
typedef struct clap_input_events {
void *ctx; // reserved pointer for the list
- uint32_t (*size)(const struct clap_input_events *list);
+ CLAP_NODISCARD uint32_t (*size)(const struct clap_input_events *list);
// Don't free the return event, it belongs to the list
- const clap_event_header_t *(*get)(const struct clap_input_events *list, uint32_t index);
+ CLAP_NODISCARD const clap_event_header_t *(*get)(const struct clap_input_events *list,
+ uint32_t index);
} clap_input_events_t;
// Output event list, events must be sorted by time.
@@ -238,7 +239,9 @@ typedef struct clap_output_events {
void *ctx; // reserved pointer for the list
// Pushes a copy of the event
- void (*push_back)(const struct clap_output_events *list, const clap_event_header_t *event);
+ // returns false if the event could not be pushed to the queue (out of memory?)
+ CLAP_NODISCARD bool (*try_push)(const struct clap_output_events *list,
+ const clap_event_header_t *event);
} clap_output_events_t;
#ifdef __cplusplus