commit b8a4ff7d30f9bee7bc2f52d278e356f019eab350
parent 7125ccaf1edf92fe42eb9c031659dc519226eb63
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sat, 18 Dec 2021 21:26:24 +0100
More work
Diffstat:
4 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/include/clap/all.h b/include/clap/all.h
@@ -2,6 +2,10 @@
#include "clap.h"
+#include "entry.h"
+#include "plugin-factory.h"
+#include "plugin-invalidation.h"
+
#include "ext/audio-ports.h"
#include "ext/audio-ports-config.h"
#include "ext/gui.h"
diff --git a/include/clap/entry.h b/include/clap/entry.h
@@ -7,17 +7,25 @@
extern "C" {
#endif
+// This interface is the entry point of the dynamic library.
+//
+// Every methods must be thread-safe.
typedef struct clap_plugin_entry {
- clap_version clap_version; // initialized to CLAP_VERSION
+ clap_version clap_version; // initialized to CLAP_VERSION
+ // Must be called fist
bool (*init)(const char *plugin_path);
+
+ // No more calls into the DSO must be made after calling deinit().
void (*deinit)(void);
- const void (*get_factory)(const char *factory_id);
+ // Get the pointer to a factory.
+ // See plugin-factory.h, vst2-converter.h ...
+ const void *(*get_factory)(const char *factory_id);
} clap_plugin_entry;
/* Entry point */
-CLAP_EXPORT extern const clap_plugin_entry clap_plugin_entry;
+CLAP_EXPORT extern const clap_plugin_entry clap_entry;
#ifdef __cplusplus
}
diff --git a/include/clap/plugin-factory.h b/include/clap/plugin-factory.h
@@ -2,20 +2,12 @@
#include "plugin.h"
+static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[] = "clap.plugin-factory";
+
#ifdef __cplusplus
extern "C" {
#endif
-#define CLAP_PLUGIN_FACTORY_ID "clap.plugin-factory"
-
-// This interface is the entry point of the dynamic library.
-//
-// There is an invalidation mechanism for the set of plugins which is based on files.
-// The host can watch the plugin DSO's mtime and a set of files's mtime provided by
-// get_clap_invalidation_source().
-//
-// The set of plugins must not change, except during a call to refresh() by the host.
-//
// Every methods must be thread-safe.
struct clap_plugin_factory {
/* Get the number of plugins available.
diff --git a/include/clap/plugin-invalidation.h b/include/clap/plugin-invalidation.h
@@ -1,11 +1,16 @@
#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "macros.h"
+
+static const CLAP_CONSTEXPR char CLAP_PLUGIN_INVALIDATION_ID[] = "clap.plugin-invalidation";
+
#ifdef __cplusplus
extern "C" {
#endif
-#define CLAP_PLUGIN_INVALIDATION_ID "clap.plugin-invalidation"
-
typedef struct clap_plugin_invalidation_source {
// Directory containing the file(s) to scan
const char *directory;
@@ -19,8 +24,9 @@ typedef struct clap_plugin_invalidation_source {
// Used to figure out when a plugin needs to be scanned again.
// Imagine a situation with a single entry point: my-plugin.clap which then scans itself
-// a set of "sub-plugins",
-struct clap_plugin_invalidation {
+// a set of "sub-plugins". New plugin may be available even if my-plugin.clap file doesn't change.
+// 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);