commit fb3ef3ab75e3f4f5f06fbd753349766ee90ce3c9
parent 483e4c7b1c9e1f7893bdb22ff84de20d26af08d0
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Mon, 3 Jan 2022 12:48:14 +0100
Have different types for input and output event list
Diffstat:
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/include/clap/events.h b/include/clap/events.h
@@ -225,19 +225,23 @@ typedef struct clap_event_midi2 {
alignas(4) uint32_t data[4];
} clap_event_midi2_t;
-typedef struct clap_event_list {
+// Input event list
+typedef struct clap_input_events {
void *ctx; // reserved pointer for the list
- uint32_t (*size)(const struct clap_event_list *list);
+ 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_event_list *list, uint32_t index);
+ const clap_event_header_t *(*get)(const struct clap_input_events *list, uint32_t index);
+} clap_input_events_t;
+
+// Output event list
+typedef struct clap_output_events {
+ void *ctx; // reserved pointer for the list
// Pushes a copy of the event
- void (*push_back)(const struct clap_event_list *list,
- const clap_event_header_t *event,
- size_t event_size);
-} clap_event_list_t;
+ void (*push_back)(const struct clap_output_events *list, const clap_event_header_t *event);
+} clap_output_events_t;
#pragma pack(pop)
diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h
@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
#include "../plugin.h"
#include "../string-sizes.h"
@@ -189,9 +189,9 @@ typedef struct clap_plugin_params {
//
// [active && !processing : audio-thread]
// [!active : main-thread]
- void (*flush)(const clap_plugin_t *plugin,
- const clap_event_list_t *input_parameter_changes,
- const clap_event_list_t *output_parameter_changes);
+ void (*flush)(const clap_plugin_t *plugin,
+ const clap_input_events_t *in,
+ const clap_output_events_t *out);
} clap_plugin_params_t;
enum {
diff --git a/include/clap/process.h b/include/clap/process.h
@@ -62,8 +62,8 @@ typedef struct clap_process {
//
// If a plugin does not implement clap_plugin_note_ports,
// then it gets a default note input and output.
- const clap_event_list_t *in_events;
- const clap_event_list_t *out_events;
+ const clap_input_events_t *in_events;
+ const clap_output_events_t *out_events;
} clap_process_t;
#pragma pack(pop)