1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#pragma once
#include "private/std.h"
#include "private/macros.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct clap_plugin_invalidation_source {
// Directory containing the file(s) to scan, must be absolute
const char *directory;
// globing pattern, in the form *.dll
const char *filename_glob;
// should the directory be scanned recursively?
bool recursive_scan;
} clap_plugin_invalidation_source_t;
static const CLAP_CONSTEXPR char CLAP_PLUGIN_INVALIDATION_FACTORY_ID[] =
"clap.plugin-invalidation-factory/draft0";
// 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". 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.
typedef struct clap_plugin_invalidation_factory {
// Get the number of invalidation source.
uint32_t(CLAP_ABI *count)(const struct clap_plugin_invalidation_factory *factory);
// Get the invalidation source by its index.
// [thread-safe]
const clap_plugin_invalidation_source_t *(CLAP_ABI *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 update the set of plugins available.
// If the function returned false, then the plugin needs to be reloaded.
bool(CLAP_ABI *refresh)(const struct clap_plugin_invalidation_factory *factory);
} clap_plugin_invalidation_factory_t;
#ifdef __cplusplus
}
#endif
|