LMMS
Loading...
Searching...
No Matches
plugin-factory.h
Go to the documentation of this file.
1#pragma once
2
3#include "plugin.h"
4
5static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[] = "clap.plugin-factory";
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11// Every method must be thread-safe.
12// It is very important to be able to scan the plugin as quickly as possible.
13//
14// If the content of the factory may change due to external events, like the user installed
15typedef struct clap_plugin_factory {
16 // Get the number of plugins available.
17 // [thread-safe]
18 uint32_t (CLAP_ABI *get_plugin_count)(const struct clap_plugin_factory *factory);
19
20 // Retrieves a plugin descriptor by its index.
21 // Returns null in case of error.
22 // The descriptor must not be freed.
23 // [thread-safe]
25 const struct clap_plugin_factory *factory, uint32_t index);
26
27 // Create a clap_plugin by its plugin_id.
28 // The returned pointer must be freed by calling plugin->destroy(plugin);
29 // The plugin is not allowed to use the host callbacks in the create method.
30 // Returns null in case of error.
31 // [thread-safe]
33 const clap_host_t *host,
34 const char *plugin_id);
36
37#ifdef __cplusplus
38}
39#endif
struct clap_host clap_host_t
#define CLAP_ABI
Definition macros.h:24
#define CLAP_CONSTEXPR
Definition macros.h:32
static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[]
Definition plugin-factory.h:5
struct clap_plugin_factory clap_plugin_factory_t
struct clap_plugin_descriptor clap_plugin_descriptor_t
struct clap_plugin clap_plugin_t
Definition plugin-factory.h:15
const clap_plugin_descriptor_t *CLAP_ABI * get_plugin_descriptor(const struct clap_plugin_factory *factory, uint32_t index)
uint32_t(CLAP_ABI *get_plugin_count)(const struct clap_plugin_factory *factory)
const clap_plugin_t *CLAP_ABI * create_plugin(const struct clap_plugin_factory *factory, const clap_host_t *host, const char *plugin_id)