commit 409f4180bdc81f7287d023147c5bfd079b92ed19
parent 8ae1a4be50e46dd06f9114f8d7415571fd73d9a7
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sat, 18 Dec 2021 21:11:18 +0100
Rename file
Diffstat:
4 files changed, 55 insertions(+), 45 deletions(-)
diff --git a/include/clap/all.h b/include/clap/all.h
@@ -27,8 +27,6 @@
#include "ext/draft/track-info.h"
#include "ext/draft/tuning.h"
#include "ext/draft/file-reference.h"
-#include "ext/draft/vst2-convert.h"
-#include "ext/draft/vst3-convert.h"
#include "ext/draft/midi-mappings.h"
#include "converters/vst2-converter.h"
diff --git a/include/clap/converters/vst2-convert.h b/include/clap/converters/vst2-converter.h
diff --git a/include/clap/converters/vst3-convert.h b/include/clap/converters/vst3-convert.h
@@ -1,42 +0,0 @@
-#pragma once
-
-#include "../../clap.h"
-#include "../../stream.h"
-
-static CLAP_CONSTEXPR const char CLAP_EXT_VST3_CONVERT[] = "clap.vst3-convert.draft/0";
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct clap_plugin_vst3_convert {
- // Copies the name and VST3 plugin id that we can convert from.
- // [thread-safe]
- void (*get_vst3_plugin_id)(const clap_plugin *plugin, uint8_t *vst3_plugin_uuid);
-
- // Loads the plugin state from stream using the vst3 chunk.
- // [main-thread]
- bool (*restore_vst3_state)(const clap_plugin *plugin, clap_istream *stream);
-
- // converts the VST3 param id and normalized value to clap param id and
- // normalized value.
- // [thread-safe]
- bool (*convert_normalized_value)(const clap_plugin *plugin,
- uint32_t vst3_param_id,
- double vst3_normalized_value,
- clap_id * clap_param_id,
- double * clap_plain_value);
-
- // converts the vst3 param id and plain value to clap param id and
- // plain value.
- // [thread-safe]
- bool (*convert_plain_value)(const clap_plugin *plugin,
- uint32_t vst3_param_id,
- double vst3_plain_value,
- clap_id * clap_param_id,
- double * clap_plain_value);
-} clap_plugin_vst3_convert;
-
-#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
@@ -0,0 +1,54 @@
+#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_vst3_converter {
+ const char *vst3_plugin_id;
+ const char *clap_plugin_id;
+
+ // [main-thread]
+ bool (*convert_state)(const struct *clap_vst3_converter *converter,
+ const clap_istream *vst3,
+ const clap_ostream *clap);
+
+ // converts the vst3 param id and normalized value to clap param id and
+ // plain value.
+ // [thread-safe]
+ bool (*convert_normalized_value)(const struct *clap_vst3_converter *converter,
+ uint32_t vst3_param_id,
+ double vst3_normalized_value,
+ clap_id *clap_param_id,
+ double *clap_plain_value);
+
+ // converts the vst3 param id and plain value to clap param id and
+ // plain value.
+ // [thread-safe]
+ bool (*convert_plain_value)(const struct *clap_vst3_converter *converter,
+ uint32_t vst3_param_id,
+ double vst3_plain_value,
+ clap_id *clap_param_id,
+ double *clap_plain_value);
+} clap_vst3_converter;
+
+// Factory identifier
+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 {
+ // Get the number of converters
+ uint32_t (*count)(const struct clap_vst3_converter_factory *factory);
+
+ // Get the converter at the given index
+ const clap_vst3_converter *(*get)(const struct clap_vst3_converter_factory *factory,
+ uint32_t index);
+} clap_vst3_converter_factory;
+
+#ifdef __cplusplus
+}
+#endif
+\ No newline at end of file