clap

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

commit 94d25be60340a50cda23e61a37886cb63593dd3a
parent 03caf3e00321009d6cbc5b53a52fcdb1c0206279
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Sun, 13 Mar 2016 10:20:47 +0100

Improvements

Diffstat:
Minclude/clap/clap.h | 11+++++++----
Minclude/clap/ext/ports.h | 21+++++++++++++++------
2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/include/clap/clap.h b/include/clap/clap.h @@ -135,7 +135,7 @@ enum clap_event_type CLAP_EVENT_JUMP = 15, // attribute jump }; -struct clap_param_event +struct clap_event_param { /* key/voice index */ int8_t key; @@ -232,9 +232,9 @@ struct clap_host /* returns the size of the original string, 0 if not string */ int32_t (*get_attribute)(struct clap_host *host, - const char *attr, - char *buffer, - int32_t size); + const char *attr, + char *buffer, + int32_t size); /* for events generated by the plugin. */ void (*events)(struct clap_host *host, @@ -254,6 +254,9 @@ struct clap_host /* feature extensions */ void *(*extension)(struct clap_host *host, const char *extention_id); + + /* host private data */ + void *host_data; }; //////////// diff --git a/include/clap/ext/ports.h b/include/clap/ext/ports.h @@ -27,8 +27,9 @@ enum clap_audio_port_role struct clap_audio_port_info { + int32_t id; bool is_input; - int channel_count; + int32_t channel_count; enum clap_audio_port_channel_mapping channel_mapping; enum clap_audio_port_role role; char name[CLAP_NAME_SIZE]; @@ -40,7 +41,8 @@ struct clap_audio_port_info struct clap_audio_port { - float **data; + int32_t channel_count; + float **data; }; /* The audio ports configuration has to be done while the plugin is @@ -52,16 +54,23 @@ struct clap_plugin_audio_ports void (*get_info)(struct clap_plugin *plugin, int32_t index, - struct clap_port_info *info); - + struct clap_audio_port_info *info); + + /* Connect the given port to the plugin's port at index. + * user_name is the name of the peer port given by the host/user. + * It can be useful especialy for repeatable ports. + * Returns the id of the port. In case of repeatable port, + * make sure that each connected port has a different id. + * Returns -1 if the connection failed. */ int32_t (*connect)(struct clap_plugin *plugin, - int32_t index, + int32_t port_id, const struct clap_audio_port *port, const char *user_name); void (*disconnect)(struct clap_plugin *plugin, int32_t port_id); + /* Returns the absolute port latency in samples. */ int32_t (*get_latency)(struct clap_plugin *plugin, int32_t port_id); }; @@ -69,7 +78,7 @@ struct clap_plugin_audio_ports struct clap_host_audio_ports { /* Tell the host that the plugin ports has changed. - * The host shall */ + * The host shall scan the ports again. */ void (*changed)(struct clap_host *host, struct clap_plugin *plugin);