LMMS
Loading...
Searching...
No Matches
plugin.h
Go to the documentation of this file.
1#pragma once
2
3#include "private/macros.h"
4#include "host.h"
5#include "process.h"
6#include "plugin-features.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef struct clap_plugin_descriptor {
13 clap_version_t clap_version; // initialized to CLAP_VERSION
14
15 // Mandatory fields must be set and must not be blank.
16 // Otherwise the fields can be null or blank, though it is safer to make them blank.
17 const char *id; // eg: "com.u-he.diva", mandatory
18 const char *name; // eg: "Diva", mandatory
19 const char *vendor; // eg: "u-he"
20 const char *url; // eg: "https://u-he.com/products/diva/"
21 const char *manual_url; // eg: "https://dl.u-he.com/manuals/plugins/diva/Diva-user-guide.pdf"
22 const char *support_url; // eg: "https://u-he.com/support/"
23 const char *version; // eg: "1.4.4"
24 const char *description; // eg: "The spirit of analogue"
25
26 // Arbitrary list of keywords.
27 // They can be matched by the host indexer and used to classify the plugin.
28 // The array of pointers must be null terminated.
29 // For some standard features see plugin-features.h
30 const char **features;
32
33typedef struct clap_plugin {
35
36 void *plugin_data; // reserved pointer for the plugin
37
38 // Must be called after creating the plugin.
39 // If init returns false, the host must destroy the plugin instance.
40 // [main-thread]
41 bool (CLAP_ABI *init)(const struct clap_plugin *plugin);
42
43 // Free the plugin and its resources.
44 // It is required to deactivate the plugin prior to this call.
45 // [main-thread & !active]
46 void (CLAP_ABI *destroy)(const struct clap_plugin *plugin);
47
48 // Activate and deactivate the plugin.
49 // In this call the plugin may allocate memory and prepare everything needed for the process
50 // call. The process's sample rate will be constant and process's frame count will included in
51 // the [min, max] range, which is bounded by [1, INT32_MAX].
52 // Once activated the latency and port configuration must remain constant, until deactivation.
53 //
54 // [main-thread & !active_state]
55 bool (CLAP_ABI *activate)(const struct clap_plugin *plugin,
59
60 // [main-thread & active_state]
61 void (CLAP_ABI *deactivate)(const struct clap_plugin *plugin);
62
63 // Call start processing before processing.
64 // [audio-thread & active_state & !processing_state]
65 bool (CLAP_ABI *start_processing)(const struct clap_plugin *plugin);
66
67 // Call stop processing before sending the plugin to sleep.
68 // [audio-thread & active_state & processing_state]
69 void (CLAP_ABI *stop_processing)(const struct clap_plugin *plugin);
70
71 // - Clears all buffers, performs a full reset of the processing state (filters, oscillators,
72 // enveloppes, lfo, ...) and kills all voices.
73 // - The parameter's value remain unchanged.
74 // - clap_process.steady_time may jump backward.
75 //
76 // [audio-thread & active_state]
77 void (CLAP_ABI *reset)(const struct clap_plugin *plugin);
78
79 // process audio, events, ...
80 // [audio-thread & active_state & processing_state]
82
83 // Query an extension.
84 // The returned pointer is owned by the plugin.
85 // [thread-safe]
86 const void *(CLAP_ABI *get_extension)(const struct clap_plugin *plugin, const char *id);
87
88 // Called by the host on the main thread in response to a previous call to:
89 // host->request_callback(host);
90 // [main-thread]
91 void (CLAP_ABI *on_main_thread)(const struct clap_plugin *plugin);
93
94#ifdef __cplusplus
95}
96#endif
static void deactivate(LV2_Handle instance)
Definition bindings_test_plugin.c:128
#define CLAP_ABI
Definition macros.h:24
unsigned int uint32_t
Definition mid.cpp:100
struct clap_plugin_descriptor clap_plugin_descriptor_t
struct clap_plugin clap_plugin_t
struct clap_process clap_process_t
Definition plugin.h:12
const char * id
Definition plugin.h:17
const char * name
Definition plugin.h:18
const char * support_url
Definition plugin.h:22
const char ** features
Definition plugin.h:30
const char * vendor
Definition plugin.h:19
clap_version_t clap_version
Definition plugin.h:13
const char * manual_url
Definition plugin.h:21
const char * url
Definition plugin.h:20
const char * description
Definition plugin.h:24
const char * version
Definition plugin.h:23
Definition plugin.h:33
void(CLAP_ABI *deactivate)(const struct clap_plugin *plugin)
bool(CLAP_ABI *activate)(const struct clap_plugin *plugin
void * plugin_data
Definition plugin.h:36
void(CLAP_ABI *reset)(const struct clap_plugin *plugin)
void(CLAP_ABI *on_main_thread)(const struct clap_plugin *plugin)
const void *CLAP_ABI * get_extension(const struct clap_plugin *plugin, const char *id)
double uint32_t uint32_t max_frames_count
Definition plugin.h:58
const clap_process_t * process
Definition plugin.h:81
void(CLAP_ABI *stop_processing)(const struct clap_plugin *plugin)
void(CLAP_ABI *destroy)(const struct clap_plugin *plugin)
const clap_plugin_descriptor_t * desc
Definition plugin.h:34
double sample_rate
Definition plugin.h:56
double uint32_t min_frames_count
Definition plugin.h:57
bool(CLAP_ABI *init)(const struct clap_plugin *plugin)
bool(CLAP_ABI *start_processing)(const struct clap_plugin *plugin)
clap_process_status(CLAP_ABI *process)(const struct clap_plugin *plugin
ZCONST uch * init
Definition extract.c:2392
struct clap_version clap_version_t