clap

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

commit 93807f7c9576e8771bce9430f317679db4e3a178
parent 732cc8753e0ff030a5964aca8c55e3eda41edc59
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Fri,  4 Mar 2022 09:23:36 +0100

nodiscard doesn't work on function pointers

Diffstat:
Minclude/clap/converters/clap-converter.h | 33++++++++++++++++-----------------
Minclude/clap/converters/vst2-converter.h | 33++++++++++++++++-----------------
Minclude/clap/converters/vst3-converter.h | 35+++++++++++++++++------------------
Minclude/clap/entry.h | 4++--
Minclude/clap/events.h | 8+++-----
Minclude/clap/ext/audio-ports-config.h | 8+++-----
Minclude/clap/ext/audio-ports.h | 12++++++------
Minclude/clap/ext/draft/ambisonic.h | 8++++----
Minclude/clap/ext/draft/cv.h | 8++++----
Minclude/clap/ext/draft/file-reference.h | 22+++++++++-------------
Minclude/clap/ext/draft/midi-mappings.h | 4+---
Minclude/clap/ext/draft/preset-load.h | 2+-
Minclude/clap/ext/draft/quick-controls.h | 4++--
Minclude/clap/ext/draft/surround.h | 10+++++-----
Minclude/clap/ext/draft/track-info.h | 2+-
Minclude/clap/ext/draft/tuning.h | 2+-
Minclude/clap/ext/event-filter.h | 4+---
Minclude/clap/ext/event-registry.h | 4+---
Minclude/clap/ext/gui.h | 32++++++++++++++------------------
Minclude/clap/ext/latency.h | 2+-
Minclude/clap/ext/note-name.h | 6+++---
Minclude/clap/ext/note-ports.h | 12++++++------
Minclude/clap/ext/params.h | 20++++++++++----------
Minclude/clap/ext/posix-fd-support.h | 6+++---
Minclude/clap/ext/render.h | 4++--
Minclude/clap/ext/state.h | 4++--
Minclude/clap/ext/tail.h | 2+-
Minclude/clap/ext/thread-check.h | 4++--
Minclude/clap/ext/thread-pool.h | 2+-
Minclude/clap/ext/timer-support.h | 4++--
Minclude/clap/host.h | 3+--
Minclude/clap/plugin-factory.h | 13++++++-------
Minclude/clap/plugin-invalidation.h | 6+++---
Minclude/clap/plugin.h | 12++++++------
Minclude/clap/process.h | 1-
Minclude/clap/stream.h | 4++--
36 files changed, 158 insertions(+), 182 deletions(-)

diff --git a/include/clap/converters/clap-converter.h b/include/clap/converters/clap-converter.h @@ -13,25 +13,25 @@ typedef struct clap_clap_converter { const char *dst_plugin_id; // [main-thread] - CLAP_NODISCARD bool (*convert_state)(const struct clap_clap_converter *converter, - const clap_istream_t *src, - const clap_ostream_t *dst); + bool (*convert_state)(const struct clap_clap_converter *converter, + const clap_istream_t *src, + const clap_ostream_t *dst); // converts the clap param id and normalized value. // [thread-safe] - CLAP_NODISCARD bool (*convert_normalized_value)(const struct clap_clap_converter *converter, - clap_id src_param_id, - double src_normalized_value, - clap_id *dst_param_id, - double *dst_normalized_value); + bool (*convert_normalized_value)(const struct clap_clap_converter *converter, + clap_id src_param_id, + double src_normalized_value, + clap_id *dst_param_id, + double *dst_normalized_value); // converts the clap param id and plain value. // [thread-safe] - CLAP_NODISCARD bool (*convert_plain_value)(const struct clap_clap_converter *converter, - clap_id src_param_id, - double src_plain_value, - clap_id *dst_param_id, - double *dst_plain_value); + bool (*convert_plain_value)(const struct clap_clap_converter *converter, + clap_id src_param_id, + double src_plain_value, + clap_id *dst_param_id, + double *dst_plain_value); } clap_clap_converter_t; // Factory identifier @@ -40,12 +40,11 @@ static CLAP_CONSTEXPR const char CLAP_CLAP_CONVERTER_FACTORY_ID[] = "clap.clap-c // List all the converters available in the current DSO. typedef struct clap_clap_converter_factory { // Get the number of converters - CLAP_NODISCARD uint32_t (*count)(const struct clap_clap_converter_factory *factory); + uint32_t (*count)(const struct clap_clap_converter_factory *factory); // Get the converter at the given index - CLAP_NODISCARD const - clap_clap_converter_t *(*get)(const struct clap_clap_converter_factory *factory, - uint32_t index); + 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 @@ -14,25 +14,25 @@ typedef struct clap_vst2_converter { const char *clap_plugin_id; // [main-thread] - CLAP_NODISCARD bool (*convert_state)(const struct clap_vst2_converter *converter, - const clap_istream_t *vst2, - const clap_ostream_t *clap); + bool (*convert_state)(const struct clap_vst2_converter *converter, + const clap_istream_t *vst2, + const clap_ostream_t *clap); // converts the vst2 param id and normalized value to clap. // [thread-safe] - CLAP_NODISCARD bool (*convert_normalized_value)(const struct clap_vst2_converter *converter, - uint32_t vst2_param_id, - double vst2_normalized_value, - clap_id *clap_param_id, - double *clap_normalized_value); + bool (*convert_normalized_value)(const struct clap_vst2_converter *converter, + uint32_t vst2_param_id, + double vst2_normalized_value, + clap_id *clap_param_id, + double *clap_normalized_value); // converts the vst2 param id and plain value to clap. // [thread-safe] - CLAP_NODISCARD bool (*convert_plain_value)(const struct clap_vst2_converter *converter, - uint32_t vst2_param_id, - double vst2_plain_value, - clap_id *clap_param_id, - double *clap_plain_value); + bool (*convert_plain_value)(const struct clap_vst2_converter *converter, + uint32_t vst2_param_id, + double vst2_plain_value, + clap_id *clap_param_id, + double *clap_plain_value); } clap_vst2_converter_t; // Factory identifier @@ -41,12 +41,11 @@ static CLAP_CONSTEXPR const char CLAP_VST2_CONVERTER_FACTORY_ID[] = "clap.vst2-c // List all the converters available in the current DSO. typedef struct clap_vst2_converter_factory { // Get the number of converters - CLAP_NODISCARD uint32_t (*count)(const struct clap_vst2_converter_factory *factory); + uint32_t (*count)(const struct clap_vst2_converter_factory *factory); // Get the converter at the given index - CLAP_NODISCARD const - clap_vst2_converter_t *(*get)(const struct clap_vst2_converter_factory *factory, - uint32_t index); + 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 @@ -15,26 +15,26 @@ typedef struct clap_vst3_converter { const char *clap_plugin_id; // [main-thread] - CLAP_NODISCARD bool (*convert_state)(const struct clap_vst3_converter *converter, - const clap_istream_t *vst3_processor, - const clap_istream_t *vst3_editor, - const clap_ostream_t *clap); + bool (*convert_state)(const struct clap_vst3_converter *converter, + const clap_istream_t *vst3_processor, + const clap_istream_t *vst3_editor, + const clap_ostream_t *clap); // converts the vst3 param id and normalized value to clap. // [thread-safe] - CLAP_NODISCARD bool (*convert_normalized_value)(const struct clap_vst3_converter *converter, - uint32_t vst3_param_id, - double vst3_normalized_value, - clap_id *clap_param_id, - double *clap_normaliezd_value); + bool (*convert_normalized_value)(const struct clap_vst3_converter *converter, + uint32_t vst3_param_id, + double vst3_normalized_value, + clap_id *clap_param_id, + double *clap_normaliezd_value); // converts the vst3 param id and plain value to clap. // [thread-safe] - CLAP_NODISCARD bool (*convert_plain_value)(const struct clap_vst3_converter *converter, - uint32_t vst3_param_id, - double vst3_plain_value, - clap_id *clap_param_id, - double *clap_plain_value); + bool (*convert_plain_value)(const struct clap_vst3_converter *converter, + uint32_t vst3_param_id, + double vst3_plain_value, + clap_id *clap_param_id, + double *clap_plain_value); } clap_vst3_converter_t; // Factory identifier @@ -43,12 +43,11 @@ static CLAP_CONSTEXPR const char CLAP_VST3_CONVERTER_FACTORY_ID[] = "clap.vst3-c // List all the converters available in the current DSO. typedef struct clap_vst3_converter_factory { // Get the number of converters - CLAP_NODISCARD uint32_t (*count)(const struct clap_vst3_converter_factory *factory); + uint32_t (*count)(const struct clap_vst3_converter_factory *factory); // Get the converter at the given index - CLAP_NODISCARD const - clap_vst3_converter_t *(*get)(const struct clap_vst3_converter_factory *factory, - uint32_t index); + 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 @@ -38,7 +38,7 @@ typedef struct clap_plugin_entry { // // If the initialization depends upon expensive computation, maybe try to do them ahead of time // and cache the result. - CLAP_NODISCARD bool (*init)(const char *plugin_path); + bool (*init)(const char *plugin_path); // No more calls into the DSO must be made after calling deinit(). void (*deinit)(void); @@ -48,7 +48,7 @@ typedef struct clap_plugin_entry { // // Returns null if the factory is not provided. // The returned pointer must *not* be freed by the caller. - CLAP_NODISCARD const void *(*get_factory)(const char *factory_id); + const void *(*get_factory)(const char *factory_id); } clap_plugin_entry_t; /* Entry point */ diff --git a/include/clap/events.h b/include/clap/events.h @@ -227,11 +227,10 @@ typedef struct clap_event_midi2 { typedef struct clap_input_events { void *ctx; // reserved pointer for the list - CLAP_NODISCARD uint32_t (*size)(const struct clap_input_events *list); + uint32_t (*size)(const struct clap_input_events *list); // Don't free the return event, it belongs to the list - CLAP_NODISCARD const clap_event_header_t *(*get)(const struct clap_input_events *list, - uint32_t index); + const clap_event_header_t *(*get)(const struct clap_input_events *list, uint32_t index); } clap_input_events_t; // Output event list, events must be sorted by time. @@ -240,8 +239,7 @@ typedef struct clap_output_events { // Pushes a copy of the event // returns false if the event could not be pushed to the queue (out of memory?) - CLAP_NODISCARD bool (*try_push)(const struct clap_output_events *list, - const clap_event_header_t *event); + bool (*try_push)(const struct clap_output_events *list, const clap_event_header_t *event); } clap_output_events_t; #ifdef __cplusplus diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h @@ -45,18 +45,16 @@ typedef struct clap_audio_ports_config { typedef struct clap_plugin_audio_ports_config { // gets the number of available configurations // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // gets information about a configuration // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, - uint32_t index, - clap_audio_ports_config_t *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] - CLAP_NODISCARD bool (*select)(const clap_plugin_t *plugin, clap_id config_id); + bool (*select)(const clap_plugin_t *plugin, clap_id config_id); } clap_plugin_audio_ports_config_t; typedef struct clap_host_audio_ports_config { diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h @@ -57,14 +57,14 @@ typedef struct clap_audio_port_info { typedef struct clap_plugin_audio_ports { // number of ports, for either input or output // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); + uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); // get info about about an audio port. // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, - uint32_t index, - bool is_input, - clap_audio_port_info_t *info); + 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 { @@ -90,7 +90,7 @@ enum { typedef struct clap_host_audio_ports { // Checks if the host allows a plugin to change a given aspect of the audio ports definition. // [main-thread] - CLAP_NODISCARD bool (*is_rescan_flag_supported)(uint32_t flag); + bool (*is_rescan_flag_supported)(uint32_t flag); // Rescan the full list of audio ports according to the flags. // It is illegal to ask the host to rescan with a flag that is not supported. diff --git a/include/clap/ext/draft/ambisonic.h b/include/clap/ext/draft/ambisonic.h @@ -36,10 +36,10 @@ typedef struct clap_ambisonic_info { typedef struct clap_plugin_ambisonic { // Returns true on success // [main-thread] - CLAP_NODISCARD bool (*get_info)(const clap_plugin_t *plugin, - bool is_input, - uint32_t port_index, - clap_ambisonic_info_t *info); + bool (*get_info)(const clap_plugin_t *plugin, + bool is_input, + uint32_t port_index, + clap_ambisonic_info_t *info); } clap_plugin_ambisonic_t; diff --git a/include/clap/ext/draft/cv.h b/include/clap/ext/draft/cv.h @@ -23,10 +23,10 @@ typedef struct clap_plugin_cv { // Stores into the channel_map array, the surround identifer of each channels. // Returns the number of elements stored in channel_map // [main-thread] - CLAP_NODISCARD uint32_t (*get_channel_type)(const clap_plugin_t *plugin, - bool is_input, - uint32_t port_index, - uint32_t channel_index); + uint32_t (*get_channel_type)(const clap_plugin_t *plugin, + bool is_input, + uint32_t port_index, + uint32_t channel_index); } clap_plugin_cv_t; typedef struct clap_host_cv { diff --git a/include/clap/ext/draft/file-reference.h b/include/clap/ext/draft/file-reference.h @@ -32,33 +32,29 @@ typedef struct clap_file_reference { typedef struct clap_plugin_file_reference { // returns the number of file reference this plugin has // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // gets the file reference at index // returns true on success // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, - uint32_t index, - clap_file_reference_t *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] - CLAP_NODISCARD bool (*get_hash)(const clap_plugin_t *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] - CLAP_NODISCARD bool (*update_path)(const clap_plugin_t *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] - CLAP_NODISCARD bool (*save_resources)(const clap_plugin_t *plugin); + bool (*save_resources)(const clap_plugin_t *plugin); } clap_plugin_file_reference_t; typedef struct clap_host_file_reference { diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h @@ -27,9 +27,7 @@ typedef struct clap_plugin_midi_mappings { uint32_t (*count)(const clap_plugin_t *plugin); // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, - uint32_t index, - clap_midi_mapping_t *mapping); + 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 { diff --git a/include/clap/ext/draft/preset-load.h b/include/clap/ext/draft/preset-load.h @@ -11,7 +11,7 @@ extern "C" { typedef struct clap_plugin_preset_load { // Loads a preset in the plugin native preset file format from a path. // [main-thread] - CLAP_NODISCARD bool (*from_file)(const clap_plugin_t *plugin, const char *path); + 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 @@ -13,8 +13,8 @@ enum { CLAP_QUICK_CONTROLS_COUNT = 8 }; typedef struct clap_quick_controls_page { clap_id id; - char name[CLAP_NAME_SIZE]; - char keywords[CLAP_KEYWORDS_SIZE]; + char name[CLAP_NAME_SIZE]; + char keywords[CLAP_KEYWORDS_SIZE]; clap_id param_ids[CLAP_QUICK_CONTROLS_COUNT]; } clap_quick_controls_page_t; diff --git a/include/clap/ext/draft/surround.h b/include/clap/ext/draft/surround.h @@ -57,11 +57,11 @@ typedef struct clap_plugin_surround { // Stores into the channel_map array, the surround identifer of each channels. // Returns the number of elements stored in channel_map // [main-thread] - CLAP_NODISCARD uint32_t (*get_channel_map)(const clap_plugin_t *plugin, - bool is_input, - uint32_t port_index, - uint8_t *channel_map, - uint32_t channel_map_capacity); + uint32_t (*get_channel_map)(const clap_plugin_t *plugin, + bool is_input, + uint32_t port_index, + uint8_t *channel_map, + uint32_t channel_map_capacity); // Informs the plugin that the host preferred channel map has changed. // [main-thread] diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h @@ -29,7 +29,7 @@ typedef struct clap_plugin_track_info { typedef struct clap_host_track_info { // Get info about the track the plugin belongs to. // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_host_t *host, clap_track_info_t *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,7 +16,7 @@ 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] - CLAP_NODISCARD double (*get)(const clap_host_t *host, int32_t key, int32_t channel); + 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 @@ -19,9 +19,7 @@ extern "C" { typedef struct clap_plugin_event_filter { // Returns true if the plugin is interested in the given event type. // [main-thread] - CLAP_NODISCARD bool (*accepts)(const clap_plugin_t *plugin, - uint16_t space_id, - uint16_t event_type); + bool (*accepts)(const clap_plugin_t *plugin, uint16_t space_id, uint16_t event_type); } clap_plugin_event_filter_t; typedef struct clap_host_event_filter { diff --git a/include/clap/ext/event-registry.h b/include/clap/ext/event-registry.h @@ -14,9 +14,7 @@ typedef struct clap_host_event_registry { // // Return false and sets *space to UINT16_MAX if the space name is unknown to the host. // [main-thread] - CLAP_NODISCARD bool (*query)(const clap_host_t *host, - const char *space_name, - uint16_t *space_id); + bool (*query)(const clap_host_t *host, const char *space_name, uint16_t *space_id); } clap_host_event_registry_t; #ifdef __cplusplus diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h @@ -79,12 +79,12 @@ typedef struct clap_gui_window { typedef struct clap_plugin_gui { // Returns true if the requested gui api is supported // [main-thread] - CLAP_NODISCARD bool (*is_api_supported)(const clap_plugin_t *plugin, uint32_t api); + bool (*is_api_supported)(const clap_plugin_t *plugin, uint32_t api); // Create and allocate all resources necessary for the gui, and for the given windowing API. // After this call, the GUI is ready to be shown but it is not yet visible. // [main-thread] - CLAP_NODISCARD bool (*create)(const clap_plugin_t *plugin, uint32_t api); + bool (*create)(const clap_plugin_t *plugin, uint32_t api); // Free all resources associated with the gui. // [main-thread] @@ -96,40 +96,36 @@ typedef struct clap_plugin_gui { // // Return false if the plugin can't apply the scaling; true on success. // [main-thread,optional] - CLAP_NODISCARD bool (*set_scale)(const clap_plugin_t *plugin, double scale); + bool (*set_scale)(const clap_plugin_t *plugin, double scale); // Get the current size of the plugin UI. // clap_plugin_gui->create() must have been called prior to asking the size. // [main-thread] - CLAP_NODISCARD bool (*get_size)(const clap_plugin_t *plugin, uint32_t *width, uint32_t *height); + bool (*get_size)(const clap_plugin_t *plugin, uint32_t *width, uint32_t *height); // [main-thread] - CLAP_NODISCARD bool (*can_resize)(const clap_plugin_t *plugin); + bool (*can_resize)(const clap_plugin_t *plugin); // If the plugin gui is resizable, then the plugin will calculate the closest // usable size which fits in the given size. // This method does not change the size. // // [main-thread] - CLAP_NODISCARD bool (*adjust_size)(const clap_plugin_t *plugin, - uint32_t *width, - uint32_t *height); + bool (*adjust_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] - CLAP_NODISCARD bool (*set_size)(const clap_plugin_t *plugin, uint32_t width, uint32_t height); + bool (*set_size)(const clap_plugin_t *plugin, uint32_t width, uint32_t height); // Attaches the plugin's window to the given parent window. // [main-thread] - CLAP_NODISCARD bool (*attach)(const clap_plugin_t *plugin, - const clap_gui_window_t *parent_window); + bool (*attach)(const clap_plugin_t *plugin, const clap_gui_window_t *parent_window); // In case the window was created with the "free" windowing API. // Sets the window to which the plugin's window shall stay above. // [main-thread] - CLAP_NODISCARD bool (*set_transient)(const clap_plugin_t *plugin, - const clap_gui_window_t *daw_window); + bool (*set_transient)(const clap_plugin_t *plugin, const clap_gui_window_t *daw_window); // Suggests a window title. Only useful when using the "free" windowing API. // [main-thread] @@ -137,12 +133,12 @@ typedef struct clap_plugin_gui { // Show the window. // [main-thread] - CLAP_NODISCARD bool (*show)(const clap_plugin_t *plugin); + bool (*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] - CLAP_NODISCARD bool (*hide)(const clap_plugin_t *plugin); + bool (*hide)(const clap_plugin_t *plugin); } clap_plugin_gui_t; typedef struct clap_host_gui { @@ -150,17 +146,17 @@ typedef struct clap_host_gui { * Return true if the new size is accepted, false otherwise. * The host doesn't have to call set_size(). * [main-thread] */ - CLAP_NODISCARD bool (*request_resize)(const clap_host_t *host, uint32_t width, uint32_t height); + bool (*request_resize)(const clap_host_t *host, uint32_t width, uint32_t height); /* Request the host to show the plugin gui. * Return true on success, false otherwise. * [main-thread] */ - CLAP_NODISCARD bool (*request_show)(const clap_host_t *host); + bool (*request_show)(const clap_host_t *host); /* Request the host to hide the plugin gui. * Return true on success, false otherwise. * [main-thread] */ - CLAP_NODISCARD bool (*request_hide)(const clap_host_t *host); + bool (*request_hide)(const clap_host_t *host); } clap_host_gui_t; #ifdef __cplusplus diff --git a/include/clap/ext/latency.h b/include/clap/ext/latency.h @@ -12,7 +12,7 @@ extern "C" { typedef struct clap_plugin_latency { // Returns the plugin latency. // [main-thread] - CLAP_NODISCARD uint32_t (*get)(const clap_plugin_t *plugin); + uint32_t (*get)(const clap_plugin_t *plugin); } clap_plugin_latency_t; typedef struct clap_host_latency { diff --git a/include/clap/ext/note-name.h b/include/clap/ext/note-name.h @@ -10,7 +10,7 @@ extern "C" { static CLAP_CONSTEXPR const char CLAP_EXT_NOTE_NAME[] = "clap.note-name"; typedef struct clap_note_name { - char name[CLAP_NAME_SIZE]; + char name[CLAP_NAME_SIZE]; int16_t port; // -1 for every ports int16_t key; // -1 for every keys int16_t channel; // -1 for every channels @@ -19,11 +19,11 @@ typedef struct clap_note_name { typedef struct clap_plugin_note_name { // Return the number of note names // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // Returns true on success and stores the result into note_name // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, uint32_t index, clap_note_name_t *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 { diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h @@ -43,14 +43,14 @@ typedef struct clap_note_port_info { typedef struct clap_plugin_note_ports { // number of ports, for either input or output // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); + uint32_t (*count)(const clap_plugin_t *plugin, bool is_input); // get info about about a note port. // [main-thread] - CLAP_NODISCARD bool (*get)(const clap_plugin_t *plugin, - uint32_t index, - bool is_input, - clap_note_port_info_t *info); + 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 { @@ -67,7 +67,7 @@ enum { typedef struct clap_host_note_ports { // Query which dialects the host supports // [main-thread] - CLAP_NODISCARD uint32_t (*supported_dialects)(const clap_host_t *host); + uint32_t (*supported_dialects)(const clap_host_t *host); // Rescan the full list of note ports according to the flags. // [main-thread] diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h @@ -166,31 +166,31 @@ typedef struct clap_param_info { typedef struct clap_plugin_params { // Returns the number of parameters. // [main-thread] - CLAP_NODISCARD uint32_t (*count)(const clap_plugin_t *plugin); + uint32_t (*count)(const clap_plugin_t *plugin); // Copies the parameter's info to param_info and returns true on success. // [main-thread] - CLAP_NODISCARD bool (*get_info)(const clap_plugin_t *plugin, - uint32_t param_index, - clap_param_info_t *param_info); + bool (*get_info)(const clap_plugin_t *plugin, + uint32_t param_index, + clap_param_info_t *param_info); // Gets the parameter plain value. // [main-thread] - CLAP_NODISCARD bool (*get_value)(const clap_plugin_t *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] - CLAP_NODISCARD bool (*value_to_text)( + bool (*value_to_text)( 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] - CLAP_NODISCARD bool (*text_to_value)(const clap_plugin_t *plugin, - clap_id param_id, - const char *display, - double *value); + bool (*text_to_value)(const clap_plugin_t *plugin, + clap_id param_id, + const char *display, + double *value); // Flushes a set of parameter changes. // This method must not be called concurrently to clap_plugin->process(). diff --git a/include/clap/ext/posix-fd-support.h b/include/clap/ext/posix-fd-support.h @@ -27,13 +27,13 @@ typedef struct clap_plugin_posix_fd_support { typedef struct clap_host_posix_fd_support { // [main-thread] - CLAP_NODISCARD bool (*register_fd)(const clap_host_t *host, int fd, int flags); + bool (*register_fd)(const clap_host_t *host, int fd, int flags); // [main-thread] - CLAP_NODISCARD bool (*modify_fd)(const clap_host_t *host, int fd, int flags); + bool (*modify_fd)(const clap_host_t *host, int fd, int flags); // [main-thread] - CLAP_NODISCARD bool (*unregister_fd)(const clap_host_t *host, int fd); + bool (*unregister_fd)(const clap_host_t *host, int fd); } clap_host_posix_fd_support_t; #ifdef __cplusplus diff --git a/include/clap/ext/render.h b/include/clap/ext/render.h @@ -27,11 +27,11 @@ typedef struct clap_plugin_render { // Returns true if the plugin has an hard requirement to process in real-time. // This is especially useful for plugin acting as a proxy to an hardware device. // [main-thread] - CLAP_NODISCARD bool (*has_hard_realtime_requirement)(const clap_plugin_t *plugin); + bool (*has_hard_realtime_requirement)(const clap_plugin_t *plugin); // Returns true if the rendering mode could be applied. // [main-thread] - CLAP_NODISCARD bool (*set)(const clap_plugin_t *plugin, clap_plugin_render_mode mode); + bool (*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,12 +13,12 @@ typedef struct clap_plugin_state { // Saves the plugin state into stream. // Returns true if the state was correctly saved. // [main-thread] - CLAP_NODISCARD bool (*save)(const clap_plugin_t *plugin, clap_ostream_t *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] - CLAP_NODISCARD bool (*load)(const clap_plugin_t *plugin, clap_istream_t *stream); + bool (*load)(const clap_plugin_t *plugin, clap_istream_t *stream); } clap_plugin_state_t; typedef struct clap_host_state { diff --git a/include/clap/ext/tail.h b/include/clap/ext/tail.h @@ -11,7 +11,7 @@ extern "C" { typedef struct clap_plugin_tail { // Returns tail length in samples. // [main-thread,audio-thread] - CLAP_NODISCARD uint32_t (*get)(const clap_plugin_t *plugin); + uint32_t (*get)(const clap_plugin_t *plugin); } clap_plugin_tail_t; typedef struct clap_host_tail { diff --git a/include/clap/ext/thread-check.h b/include/clap/ext/thread-check.h @@ -14,11 +14,11 @@ extern "C" { typedef struct clap_host_thread_check { // Returns true if "this" thread is the main thread. // [thread-safe] - CLAP_NODISCARD bool (*is_main_thread)(const clap_host_t *host); + bool (*is_main_thread)(const clap_host_t *host); // Returns true if "this" thread is one of the audio threads. // [thread-safe] - CLAP_NODISCARD bool (*is_audio_thread)(const clap_host_t *host); + 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 @@ -58,7 +58,7 @@ 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] - CLAP_NODISCARD bool (*request_exec)(const clap_host_t *host, uint32_t num_tasks); + 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 @@ -18,10 +18,10 @@ typedef struct clap_host_timer_support { // The host may adjust the period if it is under a certain threshold. // 30 Hz should be allowed. // [main-thread] - CLAP_NODISCARD bool (*register_timer)(const clap_host_t *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] - CLAP_NODISCARD bool (*unregister_timer)(const clap_host_t *host, clap_id timer_id); + 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 @@ -19,8 +19,7 @@ typedef struct clap_host { // Query an extension. // [thread-safe] - CLAP_NODISCARD const void *(*get_extension)(const struct clap_host *host, - const char *extension_id); + const void *(*get_extension)(const struct clap_host *host, const char *extension_id); // Request the host to deactivate and then reactivate the plugin. // The operation may be delayed by the host. diff --git a/include/clap/plugin-factory.h b/include/clap/plugin-factory.h @@ -15,24 +15,23 @@ extern "C" { typedef struct clap_plugin_factory { /* Get the number of plugins available. * [thread-safe] */ - CLAP_NODISCARD uint32_t (*get_plugin_count)(const struct clap_plugin_factory *factory); + uint32_t (*get_plugin_count)(const struct clap_plugin_factory *factory); /* Retrieves a plugin descriptor by its index. * Returns null in case of error. * The descriptor must not be freed. * [thread-safe] */ - CLAP_NODISCARD const - clap_plugin_descriptor_t *(*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] */ - CLAP_NODISCARD const clap_plugin_t *(*create_plugin)(const struct clap_plugin_factory *factory, - const clap_host_t *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); } clap_plugin_factory_t; #ifdef __cplusplus diff --git a/include/clap/plugin-invalidation.h b/include/clap/plugin-invalidation.h @@ -27,17 +27,17 @@ static const CLAP_CONSTEXPR char CLAP_PLUGIN_INVALIDATION_FACTORY_ID[] = // This interfaces solves this issue and gives a way to the host to monitor additional files. typedef struct clap_plugin_invalidation_factory { // Get the number of invalidation source. - CLAP_NODISCARD uint32_t (*count)(const struct clap_plugin_invalidation_factory *factory); + uint32_t (*count)(const struct clap_plugin_invalidation_factory *factory); // Get the invalidation source by its index. // [thread-safe] - CLAP_NODISCARD const clap_plugin_invalidation_source_t *(*get)( + 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. - CLAP_NODISCARD bool (*refresh)(const struct clap_plugin_invalidation_factory *factory); + 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,7 +53,7 @@ typedef struct clap_plugin { // Must be called after creating the plugin. // If init returns false, the host must destroy the plugin instance. // [main-thread] - CLAP_NODISCARD bool (*init)(const struct clap_plugin *plugin); + bool (*init)(const struct clap_plugin *plugin); // Free the plugin and its resources. // It is not required to deactivate the plugin prior to this call. @@ -67,16 +67,16 @@ typedef struct clap_plugin { // Once activated the latency and port configuration must remain constant, until deactivation. // // [main-thread & !active_state] - CLAP_NODISCARD bool (*activate)(const struct clap_plugin *plugin, - double sample_rate, - uint32_t min_frames_count, - uint32_t max_frames_count); + bool (*activate)(const struct clap_plugin *plugin, + double sample_rate, + uint32_t min_frames_count, + uint32_t max_frames_count); // [main-thread & active_state] void (*deactivate)(const struct clap_plugin *plugin); // Call start processing before processing. // [audio-thread & active_state & !processing_state] - CLAP_NODISCARD bool (*start_processing)(const struct clap_plugin *plugin); + bool (*start_processing)(const struct clap_plugin *plugin); // Call stop processing before sending the plugin to sleep. // [audio-thread & active_state & processing_state] diff --git a/include/clap/process.h b/include/clap/process.h @@ -3,7 +3,6 @@ #include "events.h" #include "audio-buffer.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/include/clap/stream.h b/include/clap/stream.h @@ -13,7 +13,7 @@ typedef struct clap_istream { /* returns the number of bytes read. * 0 for end of file. * -1 on error. */ - CLAP_NODISCARD int64_t (*read)(struct clap_istream *stream, void *buffer, uint64_t size); + int64_t (*read)(struct clap_istream *stream, void *buffer, uint64_t size); } clap_istream_t; typedef struct clap_ostream { @@ -21,7 +21,7 @@ typedef struct clap_ostream { /* returns the number of bytes written. * -1 on error. */ - CLAP_NODISCARD int64_t (*write)(struct clap_ostream *stream, const void *buffer, uint64_t size); + int64_t (*write)(struct clap_ostream *stream, const void *buffer, uint64_t size); } clap_ostream_t; #ifdef __cplusplus