clap

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

commit 97bec9dd6d15b3c351a80877f2ebe11b6e8a4b67
parent 835b819ff8295f6287bc6b4870ca673cbb3d207d
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Sat, 29 Nov 2014 15:49:49 +0100

Improve the preset extension, and move is_offline to the render extension

Diffstat:
Minclude/clap/clap.h | 7+++----
Minclude/clap/ext/presets.h | 3++-
Ainclude/clap/ext/render.h | 24++++++++++++++++++++++++
3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/include/clap/clap.h b/include/clap/clap.h @@ -163,7 +163,7 @@ struct clap_event_control struct clap_event_preset { - uint32_t id; // the preset id + char url[CLAP_URL_SIZE]; // the url to the preset }; struct clap_event_midi @@ -239,7 +239,6 @@ struct clap_process uint32_t samples_count; /* process info */ - bool is_offline; uint64_t song_time; // the song time in samples uint64_t steady_time; // the steady time in samples @@ -277,7 +276,7 @@ struct clap_host enum clap_log_severity severity, const char *msg); - /* future features */ + /* feature extensions */ void *(*extension)(struct clap_host *host, const char *extention_id); }; @@ -321,7 +320,7 @@ struct clap_plugin enum clap_process_status (*process)(struct clap_plugin *plugin, struct clap_process *process); - /* future features */ + /* features extensions */ void *(*extension)(struct clap_plugin *plugin, const char *id); }; diff --git a/include/clap/ext/presets.h b/include/clap/ext/presets.h @@ -7,11 +7,12 @@ struct clap_preset { - uint32_t id; // preset id + char url[CLAP_URL_SIZE]; // location to the patch char name[CLAP_NAME_SIZE]; // display name char desc[CLAP_DESC_SIZE]; // desc and how to use it char author[CLAP_NAME_SIZE]; char tags[CLAP_TAGS_SIZE]; // "tag1;tag2;tag3;..." + uint8_t score; // 0 = garbage, ..., 5 = favorite }; struct clap_plugin_presets diff --git a/include/clap/ext/render.h b/include/clap/ext/render.h @@ -0,0 +1,24 @@ +#ifndef CLAP_EXT_RENDER_H +# define CLAP_EXT_RENDER_H + +# include "../clap.h" + +# define CLAP_EXT_RENDER "clap/render" + +enum clap_plugin_render_mode +{ + CLAP_RENDER_REALTIME = 0, + CLAP_RENDER_OFFLINE = 1, +}; + +struct clap_plugin_render +{ + /* Sets the plugin render mode. + * Returns true on success, false otherwise. + * On failure the render mode is unchanged. + */ + bool (*set_render_mode)(struct clap_plugin *plugin, + enum clap_plugin_render_mode mode); +}; + +#endif /* !CLAP_EXT_RENDER_H */