commit 8ae1a4be50e46dd06f9114f8d7415571fd73d9a7
parent c7136a595a513d033b4a3fdf4953898f74e8f8d4
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sat, 18 Dec 2021 21:09:22 +0100
Cleanup the vst2 converter
Diffstat:
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/include/clap/converters/vst2-convert.h b/include/clap/converters/vst2-convert.h
@@ -1,45 +1,53 @@
#pragma once
-#include "../../clap.h"
-#include "../../stream.h"
+#include "../clap.h"
+#include "../stream.h"
#ifdef __cplusplus
extern "C" {
#endif
+// This interface provide all the tool to convert a vst2 plugin instance into a clap plugin instance
typedef struct clap_vst2_converter {
- uint32_t vst2_plugin_id;
+ uint32_t vst2_plugin_id;
const char *vst2_plugin_name;
const char *clap_plugin_id;
// [main-thread]
- bool (*convert_state)(const struct *clap_vst2_converter *converter, const clap_istream *vst2, const clap_ostream *clap);
+ bool (*convert_state)(const struct *clap_vst2_converter *converter,
+ const clap_istream *vst2,
+ const clap_ostream *clap);
// converts the vst2 param id and normalized value to clap param id and
// plain value.
// [thread-safe]
bool (*convert_normalized_value)(const struct *clap_vst2_converter *converter,
- uint32_t vst2_param_id,
- double vst2_normalized_value,
- clap_id * clap_param_id,
- double * clap_plain_value);
+ uint32_t vst2_param_id,
+ double vst2_normalized_value,
+ clap_id *clap_param_id,
+ double *clap_plain_value);
// converts the vst2 param id and plain value to clap param id and
// plain value.
// [thread-safe]
bool (*convert_plain_value)(const struct *clap_vst2_converter *converter,
- uint32_t vst2_param_id,
- double vst2_plain_value,
- clap_id * clap_param_id,
- double * clap_plain_value);
+ uint32_t vst2_param_id,
+ double vst2_plain_value,
+ clap_id *clap_param_id,
+ double *clap_plain_value);
} clap_vst2_converter;
+// Factory identifier
static CLAP_CONSTEXPR const char CLAP_VST2_CONVERTER_FACTORY_ID[] = "clap.vst2-converter";
-typedef struct clap_vst2_converter_factory
-{
+// List all the converters available in the current DSO.
+typedef struct clap_vst2_converter_factory {
+ // Get the number of converters
uint32_t (*count)(const struct clap_vst2_converter_factory *factory);
- const clap_vst2_converter *(*get)(const struct clap_vst2_converter_factory *factory, uint32_t index);
+
+ // Get the converter at the given index
+ const clap_vst2_converter *(*get)(const struct clap_vst2_converter_factory *factory,
+ uint32_t index);
} clap_vst2_converter_factory;
#ifdef __cplusplus