clap

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

commit 8e53f54e4079edc292225ab608b59a64011e302a
parent 77a4297521c57302f165ffa06a299f38273efaa7
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Mon, 20 Dec 2021 19:46:52 +0100

More '_t'

Diffstat:
Minclude/clap/audio-buffer.h | 2+-
Minclude/clap/color.h | 2+-
Minclude/clap/converters/clap-converter.h | 8++++----
Minclude/clap/converters/vst2-converter.h | 12++++++------
Minclude/clap/converters/vst3-converter.h | 12++++++------
Minclude/clap/entry.h | 4++--
Minclude/clap/events.h | 40++++++++++++++++++++--------------------
Minclude/clap/ext/audio-ports-config.h | 14+++++++-------
Minclude/clap/ext/audio-ports.h | 20++++++++++----------
Minclude/clap/ext/draft/check-for-update.h | 8++++----
Minclude/clap/ext/draft/file-reference.h | 26+++++++++++++-------------
Minclude/clap/ext/draft/midi-mappings.h | 12++++++------
Minclude/clap/ext/draft/preset-load.h | 4++--
Minclude/clap/ext/draft/quick-controls.h | 16++++++++--------
Minclude/clap/ext/draft/track-info.h | 26+++++++++++++-------------
Minclude/clap/ext/draft/tuning.h | 4++--
Minclude/clap/ext/event-filter.h | 8++++----
Minclude/clap/ext/fd-support.h | 12++++++------
Minclude/clap/ext/gui-cocoa.h | 4++--
Minclude/clap/ext/gui-free-standing.h | 4++--
Minclude/clap/ext/gui-win32.h | 4++--
Minclude/clap/ext/gui-x11.h | 7+++----
Minclude/clap/ext/gui.h | 24++++++++++++------------
Minclude/clap/ext/latency.h | 8++++----
Minclude/clap/ext/log.h | 4++--
Minclude/clap/ext/note-name.h | 10+++++-----
Minclude/clap/ext/note-ports.h | 19+++++++++----------
Minclude/clap/ext/params.h | 28++++++++++++++--------------
Minclude/clap/ext/render.h | 4++--
Minclude/clap/ext/state.h | 10+++++-----
Minclude/clap/ext/thread-check.h | 6+++---
Minclude/clap/ext/thread-pool.h | 8++++----
Minclude/clap/ext/timer-support.h | 10+++++-----
Minclude/clap/host.h | 2+-
Minclude/clap/plugin-factory.h | 7+++++--
Minclude/clap/plugin-invalidation.h | 9+++++----
Minclude/clap/plugin.h | 8++++----
Minclude/clap/process.h | 18++++++++----------
Minclude/clap/stream.h | 4++--
39 files changed, 214 insertions(+), 214 deletions(-)

diff --git a/include/clap/audio-buffer.h b/include/clap/audio-buffer.h @@ -13,7 +13,7 @@ typedef struct clap_audio_buffer { uint32_t channel_count; uint32_t latency; // latency from/to the audio interface uint64_t constant_mask; // mask & (1 << N) to test if channel N is constant -} clap_audio_buffer; +} clap_audio_buffer_t; #ifdef __cplusplus } diff --git a/include/clap/color.h b/include/clap/color.h @@ -11,7 +11,7 @@ typedef struct clap_color { uint8_t green; uint8_t blue; uint8_t alpha; -} clap_color; +} clap_color_t; #ifdef __cplusplus } diff --git a/include/clap/converters/clap-converter.h b/include/clap/converters/clap-converter.h @@ -25,7 +25,7 @@ typedef struct clap_clap_converter { double src_plain_value, clap_id *dst_param_id, double *dst_plain_value); -} clap_clap_converter; +} clap_clap_converter_t; // Factory identifier static CLAP_CONSTEXPR const char CLAP_CLAP_CONVERTER_FACTORY_ID[] = "clap.clap-converter"; @@ -36,9 +36,9 @@ typedef struct clap_clap_converter_factory { uint32_t (*count)(const struct clap_clap_converter_factory *factory); // Get the converter at the given index - const clap_clap_converter *(*get)(const struct clap_clap_converter_factory *factory, - uint32_t index); -} clap_clap_converter_factory; + const clap_clap_converter_t *(*get)(const struct clap_clap_converter_factory *factory, + uint32_t index); +} clap_clap_converter_factory_t; #ifdef __cplusplus } diff --git a/include/clap/converters/vst2-converter.h b/include/clap/converters/vst2-converter.h @@ -15,8 +15,8 @@ typedef struct clap_vst2_converter { // [main-thread] bool (*convert_state)(const struct clap_vst2_converter *converter, - const clap_istream *vst2, - const clap_ostream *clap); + const clap_istream_t *vst2, + const clap_ostream_t *clap); // converts the vst2 param id and normalized value to clap param id and // plain value. @@ -35,7 +35,7 @@ typedef struct clap_vst2_converter { double vst2_plain_value, clap_id *clap_param_id, double *clap_plain_value); -} clap_vst2_converter; +} clap_vst2_converter_t; // Factory identifier static CLAP_CONSTEXPR const char CLAP_VST2_CONVERTER_FACTORY_ID[] = "clap.vst2-converter"; @@ -46,9 +46,9 @@ typedef struct clap_vst2_converter_factory { uint32_t (*count)(const struct clap_vst2_converter_factory *factory); // Get the converter at the given index - const clap_vst2_converter *(*get)(const struct clap_vst2_converter_factory *factory, - uint32_t index); -} clap_vst2_converter_factory; + const clap_vst2_converter_t *(*get)(const struct clap_vst2_converter_factory *factory, + uint32_t index); +} clap_vst2_converter_factory_t; #ifdef __cplusplus } diff --git a/include/clap/converters/vst3-converter.h b/include/clap/converters/vst3-converter.h @@ -14,8 +14,8 @@ typedef struct clap_vst3_converter { // [main-thread] bool (*convert_state)(const struct clap_vst3_converter *converter, - const clap_istream *vst3, - const clap_ostream *clap); + const clap_istream_t *vst3, + const clap_ostream_t *clap); // converts the vst3 param id and normalized value to clap param id and // plain value. @@ -34,7 +34,7 @@ typedef struct clap_vst3_converter { double vst3_plain_value, clap_id *clap_param_id, double *clap_plain_value); -} clap_vst3_converter; +} clap_vst3_converter_t; // Factory identifier static CLAP_CONSTEXPR const char CLAP_VST3_CONVERTER_FACTORY_ID[] = "clap.vst3-converter"; @@ -45,9 +45,9 @@ typedef struct clap_vst3_converter_factory { uint32_t (*count)(const struct clap_vst3_converter_factory *factory); // Get the converter at the given index - const clap_vst3_converter *(*get)(const struct clap_vst3_converter_factory *factory, - uint32_t index); -} clap_vst3_converter_factory; + const clap_vst3_converter_t *(*get)(const struct clap_vst3_converter_factory *factory, + uint32_t index); +} clap_vst3_converter_factory_t; #ifdef __cplusplus } diff --git a/include/clap/entry.h b/include/clap/entry.h @@ -23,10 +23,10 @@ typedef struct clap_plugin_entry { // Get the pointer to a factory. // See plugin-factory.h, vst2-converter.h ... const void *(*get_factory)(const char *factory_id); -} clap_plugin_entry; +} clap_plugin_entry_t; /* Entry point */ -CLAP_EXPORT extern const clap_plugin_entry clap_entry; +CLAP_EXPORT extern const clap_plugin_entry_t clap_entry; #ifdef __cplusplus } diff --git a/include/clap/events.h b/include/clap/events.h @@ -36,7 +36,7 @@ typedef struct clap_event_note { int32_t key; // 0..127 int32_t channel; // 0..15 double velocity; // 0..1 -} clap_event_note; +} clap_event_note_t; enum { // x >= 0, use 20 * log(4 * x) @@ -68,7 +68,7 @@ typedef struct clap_event_note_expression { int32_t channel; double value; // see expression for the range -} clap_event_note_expression; +} clap_event_note_expression_t; enum { // live user adjustment begun @@ -95,7 +95,7 @@ typedef struct clap_event_param_value { clap_event_param_flags flags; double value; -} clap_event_param_value; +} clap_event_param_value_t; typedef struct clap_event_param_mod { // target parameter @@ -108,7 +108,7 @@ typedef struct clap_event_param_mod { int32_t channel; double amount; // modulation amount -} clap_event_param_mod; +} clap_event_param_mod_t; enum { CLAP_TRANSPORT_HAS_TEMPO = 1 << 0, @@ -142,7 +142,7 @@ typedef struct clap_event_transport { int16_t tsig_num; // time signature numerator int16_t tsig_denom; // time signature denominator -} clap_event_transport; +} clap_event_transport_t; typedef struct clap_event_note_mask { int32_t port_index; @@ -156,34 +156,34 @@ typedef struct clap_event_note_mask { // 010 1011 0101 -> locrian scale uint16_t note_mask; uint8_t root_note; // 0..11, 0 for C -} clap_event_note_mask; +} clap_event_note_mask_t; typedef struct clap_event_midi { int32_t port_index; uint8_t data[3]; -} clap_event_midi; +} clap_event_midi_t; typedef struct clap_event_midi_sysex { int32_t port_index; const uint8_t *buffer; // midi buffer uint32_t size; -} clap_event_midi_sysex; +} clap_event_midi_sysex_t; typedef struct clap_event { clap_event_type type; uint32_t time; // offset from the first sample in the process block union { - clap_event_note note; - clap_event_note_expression note_expression; - clap_event_param_value param_value; - clap_event_param_mod param_mod; - clap_event_transport time_info; - clap_event_note_mask note_mask; - clap_event_midi midi; - clap_event_midi_sysex midi_sysex; + clap_event_note_t note; + clap_event_note_expression_t note_expression; + clap_event_param_value_t param_value; + clap_event_param_mod_t param_mod; + clap_event_transport_t time_info; + clap_event_note_mask_t note_mask; + clap_event_midi_t midi; + clap_event_midi_sysex_t midi_sysex; }; -} clap_event; +} clap_event_t; typedef struct clap_event_list { void *ctx; // reserved pointer for the list @@ -191,11 +191,11 @@ typedef struct clap_event_list { uint32_t (*size)(const struct clap_event_list *list); // Don't free the return event, it belongs to the list - const clap_event *(*get)(const struct clap_event_list *list, uint32_t index); + const clap_event_t *(*get)(const struct clap_event_list *list, uint32_t index); // Makes a copy of the event - void (*push_back)(const struct clap_event_list *list, const clap_event *event); -} clap_event_list; + void (*push_back)(const struct clap_event_list *list, const clap_event_t *event); +} clap_event_list_t; #ifdef __cplusplus } diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h @@ -40,29 +40,29 @@ typedef struct clap_audio_ports_config { // main output info uint32_t output_channel_count; clap_chmap output_channel_map; -} clap_audio_ports_config; +} clap_audio_ports_config_t; // The audio ports config scan has to be done while the plugin is deactivated. typedef struct clap_plugin_audio_ports_config { // gets the number of available configurations // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // gets information about a configuration // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t index, clap_audio_ports_config *config); + bool (*get)(const clap_plugin_t *plugin, uint32_t index, clap_audio_ports_config_t *config); // selects the configuration designated by id // returns true if the configuration could be applied // [main-thread,plugin-deactivated] - bool (*select)(const clap_plugin *plugin, clap_id config_id); -} clap_plugin_audio_ports_config; + bool (*select)(const clap_plugin_t *plugin, clap_id config_id); +} clap_plugin_audio_ports_config_t; typedef struct clap_host_audio_ports_config { // Rescan the full list of configs. // [main-thread] - void (*rescan)(const clap_host *host); -} clap_host_audio_ports_config; + void (*rescan)(const clap_host_t *host); +} clap_host_audio_ports_config_t; #ifdef __cplusplus } diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h @@ -31,21 +31,21 @@ typedef struct clap_audio_port_info { bool in_place; // if true the daw can use the same buffer for input // and output, only for main input to main output -} clap_audio_port_info; +} clap_audio_port_info_t; // The audio ports scan has to be done while the plugin is deactivated. typedef struct clap_plugin_audio_ports { // number of ports, for either input or output // [main-thread] - uint32_t (*count)(const clap_plugin *plugin, bool is_input); + uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); // get info about about an audio port. // [main-thread] - bool (*get)(const clap_plugin *plugin, - uint32_t index, - bool is_input, - clap_audio_port_info *info); -} clap_plugin_audio_ports; + bool (*get)(const clap_plugin_t *plugin, + uint32_t index, + bool is_input, + clap_audio_port_info_t *info); +} clap_plugin_audio_ports_t; enum { // The ports have changed, the host shall perform a full scan of the ports. @@ -60,12 +60,12 @@ enum { typedef struct clap_host_audio_ports { // [main-thread] - uint32_t (*get_preferred_sample_size)(const clap_host *host); + uint32_t (*get_preferred_sample_size)(const clap_host_t *host); // Rescan the full list of audio ports according to the flags. // [main-thread] - void (*rescan)(const clap_host *host, uint32_t flags); -} clap_host_audio_ports; + void (*rescan)(const clap_host_t *host, uint32_t flags); +} clap_host_audio_ports_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/check-for-update.h b/include/clap/ext/draft/check-for-update.h @@ -14,17 +14,17 @@ typedef struct clap_check_for_update_info { const char *url; bool is_stable; -} clap_check_for_update_info; +} clap_check_for_update_info_t; typedef struct clap_plugin_check_for_update { // [main-thread] - void (*check)(const clap_host *host, bool include_beta); + void (*check)(const clap_host_t *host, bool include_beta); } clap_plugin_check_for_update; typedef struct clap_host_check_for_update { // [main-thread] - void (*on_new_version)(const clap_host *host, const clap_check_for_update_info *update_info); -} clap_host_check_for_update; + void (*on_new_version)(const clap_host_t *host, const clap_check_for_update_info_t *update_info); +} clap_host_check_for_update_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/file-reference.h b/include/clap/ext/draft/file-reference.h @@ -27,43 +27,43 @@ typedef struct clap_file_reference { clap_id resource_id; char path[CLAP_PATH_SIZE]; bool belongs_to_plugin_collection; -} clap_file_reference; +} clap_file_reference_t; typedef struct clap_plugin_file_reference { // returns the number of file reference this plugin has // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // gets the file reference at index // returns true on success // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t index, clap_file_reference *file_reference); + bool (*get)(const clap_plugin_t *plugin, uint32_t index, clap_file_reference_t *file_reference); // This method does not compute the hash. // It is only used in case of missing resource. The host may have additionnal known resource // location and may be able to locate the file by using its known hash. // [main-thread] - bool (*get_hash)(const clap_plugin *plugin, - clap_id resource_id, - clap_hash hash, - uint8_t * digest, - uint32_t digest_size); + bool (*get_hash)(const clap_plugin_t *plugin, + clap_id resource_id, + clap_hash hash, + uint8_t *digest, + uint32_t digest_size); // updates the path to a file reference // [main-thread] - bool (*update_path)(const clap_plugin *plugin, clap_id resource_id, const char *path); + bool (*update_path)(const clap_plugin_t *plugin, clap_id resource_id, const char *path); // [main-thread] - bool (*save_resources)(const clap_plugin *plugin); -} clap_plugin_file_reference; + bool (*save_resources)(const clap_plugin_t *plugin); +} clap_plugin_file_reference_t; typedef struct clap_host_file_reference { // informs the host that the file references have changed, the host should schedule a full rescan // [main-thread] - void (*changed)(const clap_host *host); + void (*changed)(const clap_host_t *host); // [main-thread] - void (*set_dirty)(const clap_host *host, clap_id resource_id); + void (*set_dirty)(const clap_host_t *host, clap_id resource_id); } clap_host_file_reference; #ifdef __cplusplus diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h @@ -20,20 +20,20 @@ typedef struct clap_midi_mapping { int32_t channel; int32_t number; clap_id param_id; -} clap_midi_mapping; +} clap_midi_mapping_t; typedef struct clap_plugin_midi_mappings { // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t index, clap_midi_mapping *mapping); -} clap_plugin_midi_mappings; + bool (*get)(const clap_plugin_t *plugin, uint32_t index, clap_midi_mapping_t *mapping); +} clap_plugin_midi_mappings_t; typedef struct clap_host_midi_mappings { // [main-thread] - void (*changed)(const clap_host *host); -} clap_host_midi_mappings; + void (*changed)(const clap_host_t *host); +} clap_host_midi_mappings_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/preset-load.h b/include/clap/ext/draft/preset-load.h @@ -11,8 +11,8 @@ extern "C" { typedef struct clap_plugin_preset_load { // Loads a preset in the plugin native preset file format from a path. // [main-thread] - bool (*from_file)(const clap_plugin *plugin, const char *path); -} clap_plugin_preset_load; + bool (*from_file)(const clap_plugin_t *plugin, const char *path); +} clap_plugin_preset_load_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h @@ -16,21 +16,21 @@ typedef struct clap_quick_controls_page { char name[CLAP_NAME_SIZE]; char keywords[CLAP_KEYWORDS_SIZE]; clap_id param_ids[CLAP_QUICK_CONTROLS_COUNT]; -} clap_quick_controls_page; +} clap_quick_controls_page_t; typedef struct clap_plugin_quick_controls { // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t page_index, clap_quick_controls_page *page); + bool (*get)(const clap_plugin_t *plugin, uint32_t page_index, clap_quick_controls_page_t *page); // [main-thread] - void (*select)(const clap_plugin *plugin, clap_id page_id); + void (*select)(const clap_plugin_t *plugin, clap_id page_id); // [main-thread] - clap_id (*get_selected)(const clap_plugin *plugin); -} clap_plugin_quick_controls; + clap_id (*get_selected)(const clap_plugin_t *plugin); +} clap_plugin_quick_controls_t; enum { CLAP_QUICK_CONTROLS_PAGES_CHANGED = 1 << 0, @@ -41,8 +41,8 @@ typedef uint32_t clap_quick_controls_changed_flags; typedef struct clap_host_quick_controls { // Informs the host that the quick controls have changed. // [main-thread] - void (*changed)(const clap_host *host, clap_quick_controls_changed_flags flags); -} clap_host_quick_controls; + void (*changed)(const clap_host_t *host, clap_quick_controls_changed_flags flags); +} clap_host_quick_controls_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h @@ -12,26 +12,26 @@ extern "C" { #endif typedef struct clap_track_info { - clap_id id; - int32_t index; - char name[CLAP_NAME_SIZE]; - char path[512]; // Like "/group1/group2/drum-machine/drum-pad-13" - int32_t channel_count; - clap_chmap channel_map; - clap_color color; - bool is_return_track; -} clap_track_info; + clap_id id; + int32_t index; + char name[CLAP_NAME_SIZE]; + char path[512]; // Like "/group1/group2/drum-machine/drum-pad-13" + int32_t channel_count; + clap_chmap channel_map; + clap_color_t color; + bool is_return_track; +} clap_track_info_t; typedef struct clap_plugin_track_info { // [main-thread] - void (*changed)(const clap_plugin *plugin); -} clap_plugin_track_info; + void (*changed)(const clap_plugin_t *plugin); +} clap_plugin_track_info_t; typedef struct clap_host_track_info { // Get info about the track the plugin belongs to. // [main-thread] - bool (*get)(const clap_host *host, clap_track_info *info); -} clap_host_track_info; + bool (*get)(const clap_host_t *host, clap_track_info_t *info); +} clap_host_track_info_t; #ifdef __cplusplus } diff --git a/include/clap/ext/draft/tuning.h b/include/clap/ext/draft/tuning.h @@ -16,8 +16,8 @@ typedef struct clap_host_tuning { // The plugin is not supposed to query it for each samples, // but at a rate that makes sense for low frequency modulations. // [audio-thread] - double (*get)(const clap_host *host, int32_t key, int32_t channel); -} clap_host_tuning; + double (*get)(const clap_host_t *host, int32_t key, int32_t channel); +} clap_host_tuning_t; #ifdef __cplusplus } diff --git a/include/clap/ext/event-filter.h b/include/clap/ext/event-filter.h @@ -15,16 +15,16 @@ extern "C" { typedef struct clap_plugin_event_filter { // Returns true if the plugin is interested in the given event type. // [main-thread] - bool (*accepts)(const clap_plugin *plugin, clap_event_type event_type); -} clap_plugin_event_filter; + bool (*accepts)(const clap_plugin_t *plugin, clap_event_type event_type); +} clap_plugin_event_filter_t; typedef struct clap_host_event_filter { // Informs the host that the set of accepted event type changed. // This requires the plugin to be deactivated. // [main-thread] - void (*changed)(const clap_host *host); -} clap_host_event_filter; + void (*changed)(const clap_host_t *host); +} clap_host_event_filter_t; #ifdef __cplusplus } diff --git a/include/clap/ext/fd-support.h b/include/clap/ext/fd-support.h @@ -31,19 +31,19 @@ typedef struct clap_plugin_fd_support { // done writting. // // [main-thread] - void (*on_fd)(const clap_plugin *plugin, clap_fd fd, clap_fd_flags flags); -} clap_plugin_fd_support; + void (*on_fd)(const clap_plugin_t *plugin, clap_fd fd, clap_fd_flags flags); +} clap_plugin_fd_support_t; typedef struct clap_host_fd_support { // [main-thread] - bool (*register_fd)(const clap_host *host, clap_fd fd, clap_fd_flags flags); + bool (*register_fd)(const clap_host_t *host, clap_fd fd, clap_fd_flags flags); // [main-thread] - bool (*modify_fd)(const clap_host *host, clap_fd fd, clap_fd_flags flags); + bool (*modify_fd)(const clap_host_t *host, clap_fd fd, clap_fd_flags flags); // [main-thread] - bool (*unregister_fd)(const clap_host *host, clap_fd fd); -} clap_host_fd_support; + bool (*unregister_fd)(const clap_host_t *host, clap_fd fd); +} clap_host_fd_support_t; #ifdef __cplusplus } diff --git a/include/clap/ext/gui-cocoa.h b/include/clap/ext/gui-cocoa.h @@ -10,8 +10,8 @@ extern "C" { typedef struct clap_plugin_gui_cocoa { // [main-thread] - bool (*attach)(const clap_plugin *plugin, void *nsView); -} clap_plugin_gui_cocoa; + bool (*attach)(const clap_plugin_t *plugin, void *nsView); +} clap_plugin_gui_cocoa_t; #ifdef __cplusplus } diff --git a/include/clap/ext/gui-free-standing.h b/include/clap/ext/gui-free-standing.h @@ -12,8 +12,8 @@ typedef struct clap_plugin_gui_free_standing { // Opens the plugin window as a free standing window, which means it is not // embedded in the host and managed by the plugin. // [main-thread] - bool (*open)(const clap_plugin * plugin); -} clap_plugin_gui_free_standing; + bool (*open)(const clap_plugin_t * plugin); +} clap_plugin_gui_free_standing_t; #ifdef __cplusplus } diff --git a/include/clap/ext/gui-win32.h b/include/clap/ext/gui-win32.h @@ -13,8 +13,8 @@ typedef void *clap_hwnd; typedef struct clap_plugin_gui_win32 { // [main-thread] - bool (*attach)(const clap_plugin *plugin, clap_hwnd window); -} clap_plugin_gui_win32; + bool (*attach)(const clap_plugin_t *plugin, clap_hwnd window); +} clap_plugin_gui_win32_t; #ifdef __cplusplus } diff --git a/include/clap/ext/gui-x11.h b/include/clap/ext/gui-x11.h @@ -10,11 +10,10 @@ extern "C" { typedef struct clap_plugin_gui_x11 { // Use the protocol XEmbed + // https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html // [main-thread] - bool (*attach)(const clap_plugin * plugin, - const char * display_name, - unsigned long window); -} clap_plugin_gui_x11; + bool (*attach)(const clap_plugin_t *plugin, const char *display_name, unsigned long window); +} clap_plugin_gui_x11_t; #ifdef __cplusplus } diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h @@ -33,23 +33,23 @@ typedef struct clap_plugin_gui { // Create and allocate all resources necessary for the gui. // After this call, the GUI is ready to be shown but it is not yet visible. // [main-thread] - bool (*create)(const clap_plugin *plugin); + bool (*create)(const clap_plugin_t *plugin); // Free all resources associated with the gui. // [main-thread] - void (*destroy)(const clap_plugin *plugin); + void (*destroy)(const clap_plugin_t *plugin); // Set the absolute GUI scaling factor. // [main-thread] - void (*set_scale)(const clap_plugin *plugin, double scale); + void (*set_scale)(const clap_plugin_t *plugin, double scale); // Get the current size of the plugin UI, with the scaling applied. // clap_plugin_gui->create() must have been called prior to asking the size. // [main-thread] - bool (*get_size)(const clap_plugin *plugin, uint32_t *width, uint32_t *height); + bool (*get_size)(const clap_plugin_t *plugin, uint32_t *width, uint32_t *height); // [main-thread] - bool (*can_resize)(const clap_plugin *plugin); + bool (*can_resize)(const clap_plugin_t *plugin); // If the plugin gui is resizable, then the plugin will calculate the closest // usable size to the given arguments. @@ -57,29 +57,29 @@ typedef struct clap_plugin_gui { // This method does not change the size. // // [main-thread] - void (*round_size)(const clap_plugin *plugin, uint32_t *width, uint32_t *height); + void (*round_size)(const clap_plugin_t *plugin, uint32_t *width, uint32_t *height); // Sets the window size // Returns true if the size is supported. // [main-thread] - bool (*set_size)(const clap_plugin *plugin, uint32_t width, uint32_t height); + bool (*set_size)(const clap_plugin_t *plugin, uint32_t width, uint32_t height); // Show the window. // [main-thread] - void (*show)(const clap_plugin *plugin); + void (*show)(const clap_plugin_t *plugin); // Hide the window, this method do not free the resources, it just hides // the window content. Yet it maybe a good idea to stop painting timers. // [main-thread] - void (*hide)(const clap_plugin *plugin); -} clap_plugin_gui; + void (*hide)(const clap_plugin_t *plugin); +} clap_plugin_gui_t; typedef struct clap_host_gui { /* Request the host to resize the client area to width, height. * Return true on success, false otherwise. * [thread-safe] */ - bool (*resize)(const clap_host *host, uint32_t width, uint32_t height); -} clap_host_gui; + bool (*resize)(const clap_host_t *host, uint32_t width, uint32_t height); +} clap_host_gui_t; #ifdef __cplusplus } diff --git a/include/clap/ext/latency.h b/include/clap/ext/latency.h @@ -13,16 +13,16 @@ extern "C" { typedef struct clap_plugin_latency { // Returns the plugin latency. // [main-thread] - uint32_t (*get)(const clap_plugin *plugin); -} clap_plugin_latency; + uint32_t (*get)(const clap_plugin_t *plugin); +} clap_plugin_latency_t; typedef struct clap_host_latency { // Tell the host that the latency changed. // The latency is only allowed to change if the plugin is deactivated. // If the plugin is activated, call host->request_restart() // [main-thread] - void (*changed)(const clap_host *host); -} clap_host_latency; + void (*changed)(const clap_host_t *host); +} clap_host_latency_t; #ifdef __cplusplus } diff --git a/include/clap/ext/log.h b/include/clap/ext/log.h @@ -25,8 +25,8 @@ typedef int32_t clap_log_severity; typedef struct clap_host_log { // Log a message through the host. // [thread-safe] - void (*log)(const clap_host *host, clap_log_severity severity, const char *msg); -} clap_host_log; + void (*log)(const clap_host_t *host, clap_log_severity severity, const char *msg); +} clap_host_log_t; #ifdef __cplusplus } diff --git a/include/clap/ext/note-name.h b/include/clap/ext/note-name.h @@ -15,23 +15,23 @@ typedef struct clap_note_name { int32_t port; int32_t key; int32_t channel; // -1 for every channels -} clap_note_name; +} clap_note_name_t; typedef struct clap_plugin_note_name { // Return the number of note names // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // Returns true on success and stores the result into note_name // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t index, clap_note_name *note_name); + bool (*get)(const clap_plugin_t *plugin, uint32_t index, clap_note_name_t *note_name); } clap_plugin_note_name; typedef struct clap_host_note_name { // Informs the host that the note names has changed. // [main-thread] - void (*changed)(const clap_host *host); -} clap_host_note_name; + void (*changed)(const clap_host_t *host); +} clap_host_note_name_t; #ifdef __cplusplus } diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h @@ -1,6 +1,5 @@ #pragma once - #include "../clap.h" #include "../chmap.h" #include "../string-sizes.h" @@ -22,21 +21,21 @@ extern "C" { typedef struct clap_note_port_info { clap_id id; // stable identifier char name[CLAP_NAME_SIZE]; // displayable name, i18n? -} clap_note_port_info; +} clap_note_port_info_t; // The audio ports scan has to be done while the plugin is deactivated. typedef struct clap_plugin_note_ports { // number of ports, for either input or output // [main-thread] - uint32_t (*count)(const clap_plugin *plugin, bool is_input); + uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); // get info about about a note port. // [main-thread] - bool (*get)(const clap_plugin * plugin, - uint32_t index, - bool is_input, - clap_note_port_info *info); -} clap_plugin_note_ports; + bool (*get)(const clap_plugin_t *plugin, + uint32_t index, + bool is_input, + clap_note_port_info_t *info); +} clap_plugin_note_ports_t; enum { // The ports have changed, the host shall perform a full scan of the ports. @@ -52,8 +51,8 @@ enum { typedef struct clap_host_note_ports { // Rescan the full list of audio ports according to the flags. // [main-thread] - void (*rescan)(const clap_host *host, uint32_t flags); -} clap_host_note_ports; + void (*rescan)(const clap_host_t *host, uint32_t flags); +} clap_host_note_ports_t; #ifdef __cplusplus } diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h @@ -150,31 +150,31 @@ typedef struct clap_param_info { double min_value; // minimum plain value double max_value; // maximum plain value double default_value; // default plain value -} clap_param_info; +} clap_param_info_t; typedef struct clap_plugin_params { // Returns the number of parameters. // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // Copies the parameter's info to param_info and returns true on success. // [main-thread] - bool (*get_info)(const clap_plugin *plugin, int32_t param_index, clap_param_info *param_info); + bool (*get_info)(const clap_plugin_t *plugin, int32_t param_index, clap_param_info_t *param_info); // Gets the parameter plain value. // [main-thread] - bool (*get_value)(const clap_plugin *plugin, clap_id param_id, double *value); + bool (*get_value)(const clap_plugin_t *plugin, clap_id param_id, double *value); // Formats the display text for the given parameter value. // The host should always format the parameter value to text using this function // before displaying it to the user. // [main-thread] bool (*value_to_text)( - const clap_plugin *plugin, clap_id param_id, double value, char *display, uint32_t size); + const clap_plugin_t *plugin, clap_id param_id, double value, char *display, uint32_t size); // Converts the display text to a parameter value. // [main-thread] - bool (*text_to_value)(const clap_plugin *plugin, + bool (*text_to_value)(const clap_plugin_t *plugin, clap_id param_id, const char * display, double * value); @@ -185,10 +185,10 @@ typedef struct clap_plugin_params { // // [active && !processing : audio-thread] // [!active : main-thread] - void (*flush)(const clap_plugin * plugin, - const clap_event_list *input_parameter_changes, - const clap_event_list *output_parameter_changes); -} clap_plugin_params; + void (*flush)(const clap_plugin_t * plugin, + const clap_event_list_t *input_parameter_changes, + const clap_event_list_t *output_parameter_changes); +} clap_plugin_params_t; enum { // The parameter values did change, eg. after loading a preset. @@ -244,11 +244,11 @@ typedef uint32_t clap_param_clear_flags; typedef struct clap_host_params { // Rescan the full list of parameters according to the flags. // [main-thread] - void (*rescan)(const clap_host *host, clap_param_rescan_flags flags); + void (*rescan)(const clap_host_t *host, clap_param_rescan_flags flags); // Clears references to a parameter // [main-thread] - void (*clear)(const clap_host *host, clap_id param_id, clap_param_clear_flags flags); + void (*clear)(const clap_host_t *host, clap_id param_id, clap_param_clear_flags flags); // Request the host to call clap_plugin_params->fush(). // This is useful if the plugin has parameters value changes to report to the host but the plugin @@ -260,8 +260,8 @@ typedef struct clap_host_params { // This must not be called on the [audio-thread]. // // [thread-safe] - void (*request_flush)(const clap_host *host); -} clap_host_params; + void (*request_flush)(const clap_host_t *host); +} clap_host_params_t; #ifdef __cplusplus } diff --git a/include/clap/ext/render.h b/include/clap/ext/render.h @@ -24,8 +24,8 @@ typedef int32_t clap_plugin_render_mode; // implement this extension. typedef struct clap_plugin_render { // [main-thread] - void (*set)(const clap_plugin *plugin, clap_plugin_render_mode mode); -} clap_plugin_render; + void (*set)(const clap_plugin_t *plugin, clap_plugin_render_mode mode); +} clap_plugin_render_t; #ifdef __cplusplus } diff --git a/include/clap/ext/state.h b/include/clap/ext/state.h @@ -13,20 +13,20 @@ typedef struct clap_plugin_state { // Saves the plugin state into stream. // Returns true if the state was correctly saved. // [main-thread] - bool (*save)(const clap_plugin *plugin, clap_ostream *stream); + bool (*save)(const clap_plugin_t *plugin, clap_ostream_t *stream); // Loads the plugin state from stream. // Returns true if the state was correctly restored. // [main-thread] - bool (*load)(const clap_plugin *plugin, clap_istream *stream); -} clap_plugin_state; + bool (*load)(const clap_plugin_t *plugin, clap_istream_t *stream); +} clap_plugin_state_t; typedef struct clap_host_state { // Tell the host that the plugin state has changed and should be saved again. // If a parameter value changes, then it is implicit that the state is dirty. // [main-thread] - void (*mark_dirty)(const clap_host *host); -} clap_host_state; + void (*mark_dirty)(const clap_host_t *host); +} clap_host_state_t; #ifdef __cplusplus } diff --git a/include/clap/ext/thread-check.h b/include/clap/ext/thread-check.h @@ -14,12 +14,12 @@ extern "C" { typedef struct clap_host_thread_check { // Returns true if "this" thread is the main thread. // [thread-safe] - bool (*is_main_thread)(const clap_host *host); + bool (*is_main_thread)(const clap_host_t *host); // Returns true if "this" thread is one of the audio threads. // [thread-safe] - bool (*is_audio_thread)(const clap_host *host); -} clap_host_thread_check; + bool (*is_audio_thread)(const clap_host_t *host); +} clap_host_thread_check_t; #ifdef __cplusplus } diff --git a/include/clap/ext/thread-pool.h b/include/clap/ext/thread-pool.h @@ -46,8 +46,8 @@ extern "C" { typedef struct clap_plugin_thread_pool { // Called by the thread pool - void (*exec)(const clap_plugin *plugin, uint32_t task_index); -} clap_plugin_thread_pool; + void (*exec)(const clap_plugin_t *plugin, uint32_t task_index); +} clap_plugin_thread_pool_t; typedef struct clap_host_thread_pool { // Schedule num_tasks jobs in the host thread pool. @@ -58,8 +58,8 @@ typedef struct clap_host_thread_pool { // The host should check that the plugin is within the process call, and if not, reject the exec // request. // [audio-thread] - bool (*request_exec)(const clap_host *host, uint32_t num_tasks); -} clap_host_thread_pool; + bool (*request_exec)(const clap_host_t *host, uint32_t num_tasks); +} clap_host_thread_pool_t; #ifdef __cplusplus } diff --git a/include/clap/ext/timer-support.h b/include/clap/ext/timer-support.h @@ -12,19 +12,19 @@ extern "C" { typedef struct clap_plugin_timer_support { // [main-thread] - void (*on_timer)(const clap_plugin *plugin, clap_id timer_id); -} clap_plugin_timer_support; + void (*on_timer)(const clap_plugin_t *plugin, clap_id timer_id); +} clap_plugin_timer_support_t; typedef struct clap_host_timer_support { // Registers a periodic timer. // The host may adjust the period if it is under a certain threshold. // 30 Hz should be allowed. // [main-thread] - bool (*register_timer)(const clap_host *host, uint32_t period_ms, clap_id *timer_id); + bool (*register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id); // [main-thread] - bool (*unregister_timer)(const clap_host *host, clap_id timer_id); -} clap_host_timer_support; + bool (*unregister_timer)(const clap_host_t *host, clap_id timer_id); +} clap_host_timer_support_t; #ifdef __cplusplus } diff --git a/include/clap/host.h b/include/clap/host.h @@ -34,7 +34,7 @@ typedef struct clap_host { // Request the host to schedule a call to plugin->on_main_thread(plugin) on the main thread. // [thread-safe] void (*request_callback)(const struct clap_host *host); -} clap_host; +} clap_host_t; #ifdef __cplusplus } diff --git a/include/clap/plugin-factory.h b/include/clap/plugin-factory.h @@ -18,14 +18,17 @@ struct clap_plugin_factory { * Returns null in case of error. * The descriptor does not need to be freed. * [thread-safe] */ - const clap_plugin_descriptor *(*get_plugin_descriptor)(const struct clap_plugin_factory *factory, uint32_t index); + const clap_plugin_descriptor_t *(*get_plugin_descriptor)( + const struct clap_plugin_factory *factory, uint32_t index); /* Create a clap_plugin by its plugin_id. * The returned pointer must be freed by calling plugin->destroy(plugin); * The plugin is not allowed to use the host callbacks in the create method. * Returns null in case of error. * [thread-safe] */ - const clap_plugin *(*create_plugin)(const struct clap_plugin_factory *factory, const clap_host *host, const char *plugin_id); + const clap_plugin_t *(*create_plugin)(const struct clap_plugin_factory *factory, + const clap_host_t *host, + const char *plugin_id); }; #ifdef __cplusplus diff --git a/include/clap/plugin-invalidation.h b/include/clap/plugin-invalidation.h @@ -20,25 +20,26 @@ typedef struct clap_plugin_invalidation_source { // should the directory be scanned recursively? bool recursive_scan; -} clap_plugin_invalidation_source; +} clap_plugin_invalidation_source_t; // Used to figure out when a plugin needs to be scanned again. // Imagine a situation with a single entry point: my-plugin.clap which then scans itself // a set of "sub-plugins". New plugin may be available even if my-plugin.clap file doesn't change. // This interfaces solves this issue and gives a way to the host to monitor additional files. -struct clap_plugin_invalidation_factory { +typedef struct clap_plugin_invalidation_factory { // Get the number of invalidation source. uint32_t (*count)(const struct clap_plugin_invalidation_factory *factory); // Get the invalidation source by its index. // [thread-safe] - const clap_plugin_invalidation_source *(*get)(const struct clap_plugin_invalidation_factory *factory, uint32_t index); + const clap_plugin_invalidation_source_t *(*get)( + const struct clap_plugin_invalidation_factory *factory, uint32_t index); // In case the host detected a invalidation event, it can call refresh() to let the // plugin_entry scan the set of plugins available. // If the function returned false, then the plugin needs to be reloaded. bool (*refresh)(const struct clap_plugin_invalidation_factory *factory); -}; +} clap_plugin_invalidation_factory_t; #ifdef __cplusplus } diff --git a/include/clap/plugin.h b/include/clap/plugin.h @@ -53,10 +53,10 @@ typedef struct clap_plugin_descriptor { const char *keywords; uint64_t plugin_type; // bitfield of clap_plugin_type -} clap_plugin_descriptor; +} clap_plugin_descriptor_t; typedef struct clap_plugin { - const clap_plugin_descriptor *desc; + const clap_plugin_descriptor_t *desc; void *plugin_data; // reserved pointer for the plugin @@ -88,7 +88,7 @@ typedef struct clap_plugin { /* process audio, events, ... * [audio-thread] */ - clap_process_status (*process)(const struct clap_plugin *plugin, const clap_process *process); + clap_process_status (*process)(const struct clap_plugin *plugin, const clap_process_t *process); /* Query an extension. * The returned pointer is owned by the plugin. @@ -99,7 +99,7 @@ typedef struct clap_plugin { // host->request_callback(host); // [main-thread] void (*on_main_thread)(const struct clap_plugin *plugin); -} clap_plugin; +} clap_plugin_t; #ifdef __cplusplus } diff --git a/include/clap/process.h b/include/clap/process.h @@ -23,15 +23,13 @@ enum { }; typedef int32_t clap_process_status; - - typedef struct clap_process { uint64_t steady_time; // a steady sample time counter, requiered uint32_t frames_count; // number of frame to process // time info at sample 0 // If null, then this is a free running host, no transport events will be provided - const clap_event_transport *transport; + const clap_event_transport_t *transport; // Audio buffers, they must have the same count as specified // by clap_plugin_audio_ports->get_count(). @@ -39,15 +37,15 @@ typedef struct clap_process { // // If a plugin does not implement clap_plugin_audio_ports, // then it gets a default stereo input and output. - const clap_audio_buffer *audio_inputs; - const clap_audio_buffer *audio_outputs; - uint32_t audio_inputs_count; - uint32_t audio_outputs_count; + const clap_audio_buffer_t *audio_inputs; + const clap_audio_buffer_t *audio_outputs; + uint32_t audio_inputs_count; + uint32_t audio_outputs_count; /* events */ - const clap_event_list *in_events; - const clap_event_list *out_events; -} clap_process; + const clap_event_list_t *in_events; + const clap_event_list_t *out_events; +} clap_process_t; #ifdef __cplusplus } diff --git a/include/clap/stream.h b/include/clap/stream.h @@ -13,7 +13,7 @@ typedef struct clap_istream { * 0 for end of file. * -1 on error. */ int64_t (*read)(struct clap_istream *stream, void *buffer, uint64_t size); -} clap_istream; +} clap_istream_t; typedef struct clap_ostream { void *ctx; // reserved pointer for the stream @@ -21,7 +21,7 @@ typedef struct clap_ostream { /* returns the number of bytes written. * -1 on error. */ int64_t (*write)(struct clap_ostream *stream, const void *buffer, uint64_t size); -} clap_ostream; +} clap_ostream_t; #ifdef __cplusplus }