3 #include "private/macros.h"
6 #include "plugin-features.h"
12 typedef struct clap_plugin_descriptor
{
13 clap_version_t clap_version
; // initialized to CLAP_VERSION
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"
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
;
31 } clap_plugin_descriptor_t
;
33 typedef struct clap_plugin
{
34 const clap_plugin_descriptor_t
*desc
;
36 void *plugin_data
; // reserved pointer for the plugin
38 // Must be called after creating the plugin.
39 // If init returns false, the host must destroy the plugin instance.
41 bool (CLAP_ABI
*init
)(const struct clap_plugin
*plugin
);
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
);
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.
54 // [main-thread & !active_state]
55 bool (CLAP_ABI
*activate
)(const struct clap_plugin
*plugin
,
57 uint32_t min_frames_count
,
58 uint32_t max_frames_count
);
60 // [main-thread & active_state]
61 void (CLAP_ABI
*deactivate
)(const struct clap_plugin
*plugin
);
63 // Call start processing before processing.
64 // [audio-thread & active_state & !processing_state]
65 bool (CLAP_ABI
*start_processing
)(const struct clap_plugin
*plugin
);
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
);
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.
76 // [audio-thread & active_state]
77 void (CLAP_ABI
*reset
)(const struct clap_plugin
*plugin
);
79 // process audio, events, ...
80 // [audio-thread & active_state & processing_state]
81 clap_process_status (CLAP_ABI
*process
)(const struct clap_plugin
*plugin
, const clap_process_t
*process
);
83 // Query an extension.
84 // The returned pointer is owned by the plugin.
86 const void *(CLAP_ABI
*get_extension
)(const struct clap_plugin
*plugin
, const char *id
);
88 // Called by the host on the main thread in response to a previous call to:
89 // host->request_callback(host);
91 void (CLAP_ABI
*on_main_thread
)(const struct clap_plugin
*plugin
);