commit 43c15386f033c8bbdc3c4fb2e3b3a525482302c1
parent c541c44750661c40cb9a01c148eec5be323e1b92
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sun, 30 Jan 2022 18:02:47 +0100
Add tail
Fixes #33
Diffstat:
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/include/clap/ext/tail.h b/include/clap/ext/tail.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "../plugin.h"
+
+static CLAP_CONSTEXPR const char CLAP_EXT_TAIL[] = "clap.tail";
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(push, CLAP_ALIGN)
+
+typedef struct clap_plugin_tail {
+ // Returns tail length in samples.
+ // [main-thread,audio-thread]
+ uint32_t (*get)(const clap_plugin_t *plugin);
+} clap_plugin_tail_t;
+
+typedef struct clap_host_tail {
+ // Tell the host that the tail has changed.
+ // [audio-thread]
+ void (*changed)(const clap_host_t *host);
+} clap_host_tail_t;
+
+#pragma pack(pop)
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/clap/process.h b/include/clap/process.h
@@ -21,6 +21,10 @@ enum {
// Processing succeed, keep processing if the output is not quiet.
CLAP_PROCESS_CONTINUE_IF_NOT_QUIET = 2,
+ // Rely upon the plugin's tail to determine if the plugin should continue to process.
+ // see clap_plugin_tail
+ CLAP_PROCESS_TAIL,
+
// Processing succeed, but no more processing is required,
// until next event or variation in audio input.
CLAP_PROCESS_SLEEP = 3,