clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit 64123f4f71d5ce021b8bf88a724d18362856cb84
parent 075d5b000b32166993d07e6025430a6fe5a502cd
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Sat, 15 Oct 2016 22:34:51 +0200

Update exts

Diffstat:
Minclude/clap/ext/params.h | 12+++++++-----
Minclude/clap/ext/ports.h | 3++-
Minclude/clap/ext/presets.h | 27+++++++++++++++++++++------
3 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h @@ -9,6 +9,7 @@ extern "C" { #endif # define CLAP_EXT_PARAMS "clap/params" +# define CLAP_ROOT_MODULE_ID "" enum clap_param_type { @@ -18,6 +19,7 @@ enum clap_param_type CLAP_PARAM_ENUM = 3, // uses value.i }; +/* This is useful for the knob scaling. */ enum clap_param_scale { CLAP_PARAM_SCALE_LINEAR = 0, @@ -90,11 +92,11 @@ struct clap_plugin_params * automation. * * To disconnect the automation, set buffer to NULL. */ - bool (*set_param_buffer)(struct clap_plugin *plugin, - int32_t param_index, - int32_t channel, - int32_t note, - struct clap_audio_port *port); + bool (*set_param_port)(struct clap_plugin *plugin, + int32_t param_index, + int32_t channel, + int32_t note, + struct clap_audio_port *port); }; struct clap_host_params diff --git a/include/clap/ext/ports.h b/include/clap/ext/ports.h @@ -80,7 +80,8 @@ struct clap_plugin_audio_ports struct clap_host_audio_ports { /* Tell the host that the plugin ports has changed. - * The host shall scan the ports again. */ + * The host shall deactivate the plugin and then + * scan the ports again. */ void (*changed)(struct clap_host *host, struct clap_plugin *plugin); diff --git a/include/clap/ext/presets.h b/include/clap/ext/presets.h @@ -5,19 +5,22 @@ # define CLAP_EXT_PRESETS "clap/presets" +/* describes a single preset */ struct clap_preset_info { char plugin_id[CLAP_ID_SIZE]; // used to identify which plugin can load the preset char id[CLAP_ID_SIZE]; // used to identify a preset in a preset bank - char name[CLAP_NAME_SIZE]; // display name + char name[CLAP_NAME_SIZE]; // preset name char desc[CLAP_DESC_SIZE]; // desc and how to use it - char author[CLAP_NAME_SIZE]; + char author[CLAP_NAME_SIZE]; // author's name char categories[CLAP_TAGS_SIZE]; // "cat1;cat2;cat3;..." char tags[CLAP_TAGS_SIZE]; // "tag1;tag2;tag3;..." int8_t score; // 0 = garbage, ..., 100 = best, -1 = no score }; -/* Interface implemented by the plugin */ +/* Interface implemented by the plugin. + * Used to create a preset library, get info about the current preset and + * load a preset. */ struct clap_plugin_preset { /* Create a preset library for this plugin */ @@ -44,6 +47,15 @@ struct clap_bank_handle; * 0 and many presets. */ struct clap_preset_library { + /* The identifier of the preset library. + * As one preset library might be able to parse the presets for + * multiple different plugins, it is useful to identify a + * preset library by an id and a version, so the DAW can use + * the most recent version of every preset library which share + * the same id, and scan only once. */ + char id[CLAP_ID_SIZE]; + int32_t version; // version of the preset library + /* Copies at most *path_size bytes into path. * If directory_index is bigger than the number of directories, * then return false. */ @@ -52,13 +64,16 @@ struct clap_preset_library char *path, int32_t *path_size); - bool (*open_bank)(struct clap_preset_library *library, - const char *path, - struct clap_bank_handle *handle); + bool (*open_bank)(struct clap_preset_library *library, + const char *path, + struct clap_bank_handle **handle); void (*close_bank)(struct clap_preset_library *library, struct clap_bank_handle *handle); + /* Returns the number of presets in the bank. + * If it is not known, return -2. + * On error return -1. */ int32_t (*get_bank_size)(struct clap_preset_library *library, struct clap_bank_handle *handle);