commit d33c06e4083139cdb9d63e8e268eebe69e0f5cdf
parent b8a4ff7d30f9bee7bc2f52d278e356f019eab350
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sat, 18 Dec 2021 21:36:49 +0100
More work
Diffstat:
3 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/include/clap/converters/clap-converter.h b/include/clap/converters/clap-converter.h
@@ -0,0 +1,45 @@
+#pragma once
+
+#include "../clap.h"
+#include "../stream.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// This interface provide all the tool to convert a vst3 plugin instance into a clap plugin instance
+typedef struct clap_clap_converter {
+ const char *src_plugin_id;
+ const char *dst_plugin_id;
+
+ // [main-thread]
+ bool (*convert_state)(const struct clap_clap_converter *converter,
+ const clap_istream *src,
+ const clap_ostream *dst);
+
+ // converts the vst3 param id and plain value to clap param id and
+ // plain value.
+ // [thread-safe]
+ bool (*convert_plain_value)(const struct clap_clap_converter *converter,
+ clap_id src_param_id,
+ double src_plain_value,
+ clap_id *dst_param_id,
+ double *dst_plain_value);
+} clap_clap_converter;
+
+// Factory identifier
+static CLAP_CONSTEXPR const char CLAP_CLAP_CONVERTER_FACTORY_ID[] = "clap.clap-converter";
+
+// List all the converters available in the current DSO.
+typedef struct clap_clap_converter_factory {
+ // Get the number of converters
+ uint32_t (*count)(const struct clap_clap_converter_factory *factory);
+
+ // Get the converter at the given index
+ const clap_clap_converter *(*get)(const struct clap_clap_converter_factory *factory,
+ uint32_t index);
+} clap_clap_converter_factory;
+
+#ifdef __cplusplus
+}
+#endif
+\ No newline at end of file
diff --git a/include/clap/converters/vst3-converter.h b/include/clap/converters/vst3-converter.h
@@ -37,7 +37,7 @@ typedef struct clap_vst3_converter {
} clap_vst3_converter;
// Factory identifier
-static CLAP_CONSTEXPR const char CLAP_vst3_CONVERTER_FACTORY_ID[] = "clap.vst3-converter";
+static CLAP_CONSTEXPR const char CLAP_VST3_CONVERTER_FACTORY_ID[] = "clap.vst3-converter";
// List all the converters available in the current DSO.
typedef struct clap_vst3_converter_factory {
diff --git a/include/clap/plugin-invalidation.h b/include/clap/plugin-invalidation.h
@@ -28,15 +28,16 @@ typedef struct clap_plugin_invalidation_source {
// This interfaces solves this issue and gives a way to the host to monitor additional files.
struct clap_plugin_invalidation_factory {
// Get the number of invalidation source.
- uint32_t (*count)(void);
+ uint32_t (*count)(const struct clap_plugin_invalidation_factory *factory);
// Get the invalidation source by its index.
// [thread-safe]
- const clap_plugin_invalidation_source *(*get)(uint32_t index);
+ const clap_plugin_invalidation_source *(*get)(const struct clap_plugin_invalidation_factory *factory, uint32_t index);
// In case the host detected a invalidation event, it can call refresh() to let the
// plugin_entry scan the set of plugins available.
- void (*refresh)(void);
+ // If the function returned false, then the plugin needs to be reloaded.
+ bool (*refresh)(const struct clap_plugin_invalidation_factory *factory);
};
#ifdef __cplusplus