From 5f6121aba00cd6f91213eff01a486d3e8cb78e91 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Thu, 2 Nov 2023 01:25:47 -0400 Subject: [PATCH 01/27] Add CLAP_PARAM_IS_ENUM to parameter flags Adds a CLAP_PARAM_IS_ENUM flag to clap_param_info_flags to denote an enum parameter. This flag tells the host when a parameter represents a set of named options mapped to integers, which can help the host decide how to present the parameter to users in its UI. --- include/clap/ext/params.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index df60725a..a333c2eb 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -195,6 +195,12 @@ enum { // A simple example would be a DC Offset, changing it will change the output signal and must be // processed. CLAP_PARAM_REQUIRES_PROCESS = 1 << 15, + + // The parameter represents a set of named options mapped to integers. + // It implies that the parameter is stepped. + // + // This flag may help the host decide how to present the parameter to users. + CLAP_PARAM_IS_ENUM = 1 << 16, }; typedef uint32_t clap_param_info_flags; From db714f0a2f73f866fdb60d593d1a5f1966e332cf Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:38:17 -0400 Subject: [PATCH 02/27] Update wording --- include/clap/ext/params.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index a333c2eb..9b613918 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -196,10 +196,9 @@ enum { // processed. CLAP_PARAM_REQUIRES_PROCESS = 1 << 15, - // The parameter represents a set of named options mapped to integers. - // It implies that the parameter is stepped. - // - // This flag may help the host decide how to present the parameter to users. + // Indicates that this parameter represents an enumerated value. + // If you set this flag, then you must set CLAP_PARAM_IS_STEPPED too. + // All values from min to max must have a non blank value_to_text(). CLAP_PARAM_IS_ENUM = 1 << 16, }; typedef uint32_t clap_param_info_flags; From bd4809d9b968cac75a9b15593d9c3e63611857f0 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 3 Nov 2023 03:45:27 +0100 Subject: [PATCH 03/27] Simplify the wording --- include/clap/ext/params.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index 9b613918..d51846c5 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -196,9 +196,9 @@ enum { // processed. CLAP_PARAM_REQUIRES_PROCESS = 1 << 15, - // Indicates that this parameter represents an enumerated value. + // This parameter represents an enumerated value. // If you set this flag, then you must set CLAP_PARAM_IS_STEPPED too. - // All values from min to max must have a non blank value_to_text(). + // All values from min to max must not have a blank value_to_text(). CLAP_PARAM_IS_ENUM = 1 << 16, }; typedef uint32_t clap_param_info_flags; From 5820476b02107b6e62592d1a8afb91d5185ade8c Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 3 Nov 2023 03:47:08 +0100 Subject: [PATCH 04/27] ChangeLog + version.h --- ChangeLog.md | 4 ++++ include/clap/version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index cce7a328..c68248fe 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +# Changes in 1.1.10 + +* [params.h](include/clap/ext/params.h): add `CLAP_PARAM_IS_ENUM` flag. + # Changes in 1.1.9 * [entry.h](include/clap/entry.h): clarify what the `plugin_path` is on macOS diff --git a/include/clap/version.h b/include/clap/version.h index 1b9cc234..33072a2d 100644 --- a/include/clap/version.h +++ b/include/clap/version.h @@ -22,7 +22,7 @@ typedef struct clap_version { #define CLAP_VERSION_MAJOR 1 #define CLAP_VERSION_MINOR 1 -#define CLAP_VERSION_REVISION 9 +#define CLAP_VERSION_REVISION 10 #define CLAP_VERSION_INIT \ { (uint32_t)CLAP_VERSION_MAJOR, (uint32_t)CLAP_VERSION_MINOR, (uint32_t)CLAP_VERSION_REVISION } From e5f86fbcd20183d948f544757479cf1c8c2a5037 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Thu, 2 Nov 2023 23:53:00 -0400 Subject: [PATCH 05/27] Clarify return values in plugin.h --- include/clap/plugin.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/clap/plugin.h b/include/clap/plugin.h index 2fd6530d..8f145cfe 100644 --- a/include/clap/plugin.h +++ b/include/clap/plugin.h @@ -59,6 +59,7 @@ typedef struct clap_plugin { // call. The process's sample rate will be constant and process's frame count will included in // the [min, max] range, which is bounded by [1, INT32_MAX]. // Once activated the latency and port configuration must remain constant, until deactivation. + // Returns true on success. // // [main-thread & !active_state] bool(CLAP_ABI *activate)(const struct clap_plugin *plugin, @@ -69,6 +70,7 @@ typedef struct clap_plugin { void(CLAP_ABI *deactivate)(const struct clap_plugin *plugin); // Call start processing before processing. + // Returns true on success. // [audio-thread & active_state & !processing_state] bool(CLAP_ABI *start_processing)(const struct clap_plugin *plugin); From cde87e213ef3cc867fb20b61d03bd1c7ec882a92 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Thu, 2 Nov 2023 23:59:06 -0400 Subject: [PATCH 06/27] Clarify return values and fix style in audio-ports-config.h --- include/clap/ext/audio-ports-config.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h index 6af65942..4627154c 100644 --- a/include/clap/ext/audio-ports-config.h +++ b/include/clap/ext/audio-ports-config.h @@ -54,20 +54,21 @@ typedef struct clap_audio_ports_config { // 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 + // Gets the number of available configurations // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); - // gets information about a configuration + // Gets information about a configuration + // Returns true on success and stores the result into config. // [main-thread] bool(CLAP_ABI *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. + // Selects the configuration designated by id + // Returns true if the configuration could be applied. // Once applied the host should scan again the audio ports. - // [main-thread,plugin-deactivated] + // [main-thread & plugin-deactivated] bool(CLAP_ABI *select)(const clap_plugin_t *plugin, clap_id config_id); } clap_plugin_audio_ports_config_t; @@ -82,6 +83,7 @@ typedef struct clap_plugin_audio_ports_config_info { // Get info about an audio port, for a given config_id. // This is analogous to clap_plugin_audio_ports.get(). + // Returns true on success and stores the result into info. // [main-thread] bool(CLAP_ABI *get)(const clap_plugin_t *plugin, clap_id config_id, From 8bc0faecb7ab661ccf78876bafceb126f8ae4f0f Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:01:20 -0400 Subject: [PATCH 07/27] Clarify return values and fix typo in audio-ports.h --- include/clap/ext/audio-ports.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h index 46186e76..74b94c32 100644 --- a/include/clap/ext/audio-ports.h +++ b/include/clap/ext/audio-ports.h @@ -67,11 +67,12 @@ typedef struct clap_audio_port_info { // 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 + // Number of ports, for either input or output // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input); - // get info about about an audio port. + // Get info about an audio port. + // Returns true on success and stores the result into info. // [main-thread] bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t index, From 08c43d6508931c63f3e5d4ce2bbfb421e1547a1f Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:02:05 -0400 Subject: [PATCH 08/27] Fix typo in event-registry.h --- include/clap/ext/event-registry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/event-registry.h b/include/clap/ext/event-registry.h index 14c965a4..c89cea47 100644 --- a/include/clap/ext/event-registry.h +++ b/include/clap/ext/event-registry.h @@ -12,7 +12,7 @@ typedef struct clap_host_event_registry { // Queries an event space id. // The space id 0 is reserved for CLAP's core events. See CLAP_CORE_EVENT_SPACE. // - // Return false and sets *space to UINT16_MAX if the space name is unknown to the host. + // Return false and sets *space_id to UINT16_MAX if the space name is unknown to the host. // [main-thread] bool(CLAP_ABI *query)(const clap_host_t *host, const char *space_name, uint16_t *space_id); } clap_host_event_registry_t; From 0efc795adecd7e989ecd7fb298adbb57aec87ffe Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:07:54 -0400 Subject: [PATCH 09/27] Use single-line comments in gui.h --- include/clap/ext/gui.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h index e6df6056..60999e60 100644 --- a/include/clap/ext/gui.h +++ b/include/clap/ext/gui.h @@ -204,25 +204,25 @@ typedef struct clap_host_gui { // [thread-safe & !floating] void(CLAP_ABI *resize_hints_changed)(const clap_host_t *host); - /* Request the host to resize the client area to width, height. - * Return true if the new size is accepted, false otherwise. - * The host doesn't have to call set_size(). - * - * Note: if not called from the main thread, then a return value simply means that the host - * acknowledged the request and will process it asynchronously. If the request then can't be - * satisfied then the host will call set_size() to revert the operation. - * - * [thread-safe & !floating] */ + // Request the host to resize the client area to width, height. + // Return true if the new size is accepted, false otherwise. + // The host doesn't have to call set_size(). + // + // Note: if not called from the main thread, then a return value simply means that the host + // acknowledged the request and will process it asynchronously. If the request then can't be + // satisfied then the host will call set_size() to revert the operation. + // + // [thread-safe & !floating] bool(CLAP_ABI *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. - * [thread-safe] */ + // Request the host to show the plugin gui. + // Return true on success, false otherwise. + // [thread-safe] bool(CLAP_ABI *request_show)(const clap_host_t *host); - /* Request the host to hide the plugin gui. - * Return true on success, false otherwise. - * [thread-safe] */ + // Request the host to hide the plugin gui. + // Return true on success, false otherwise. + // [thread-safe] bool(CLAP_ABI *request_hide)(const clap_host_t *host); // The floating window has been closed, or the connection to the gui has been lost. From aa8c410ba02a549ec1a3b6d9b9bd1e00aba5cdb0 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:10:35 -0400 Subject: [PATCH 10/27] Clarify return values and fix typo in note-ports.h --- include/clap/ext/note-ports.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h index 806dace0..f7ec37b7 100644 --- a/include/clap/ext/note-ports.h +++ b/include/clap/ext/note-ports.h @@ -40,11 +40,12 @@ typedef struct clap_note_port_info { // The note 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 + // Number of ports, for either input or output // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input); - // get info about about a note port. + // Get info about a note port. + // Returns true on success and stores the result into info. // [main-thread] bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t index, From 8b7a4521407218b67d50cecff73c49eaeb43a4d4 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:12:43 -0400 Subject: [PATCH 11/27] Clarify return values in posix-fd-support.h --- include/clap/ext/posix-fd-support.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/clap/ext/posix-fd-support.h b/include/clap/ext/posix-fd-support.h index 5bfd7bf9..c713ec88 100644 --- a/include/clap/ext/posix-fd-support.h +++ b/include/clap/ext/posix-fd-support.h @@ -31,12 +31,15 @@ typedef struct clap_plugin_posix_fd_support { } clap_plugin_posix_fd_support_t; typedef struct clap_host_posix_fd_support { + // Returns true on success. // [main-thread] bool(CLAP_ABI *register_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags); + // Returns true on success. // [main-thread] bool(CLAP_ABI *modify_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags); + // Returns true on success. // [main-thread] bool(CLAP_ABI *unregister_fd)(const clap_host_t *host, int fd); } clap_host_posix_fd_support_t; From 47f1b44f5a3357b07fff2a63155b0393a6c886de Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:14:36 -0400 Subject: [PATCH 12/27] Clarify return values in timer-support.h --- include/clap/ext/timer-support.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/clap/ext/timer-support.h b/include/clap/ext/timer-support.h index b8d13a6e..18f6e065 100644 --- a/include/clap/ext/timer-support.h +++ b/include/clap/ext/timer-support.h @@ -16,10 +16,11 @@ typedef struct clap_plugin_timer_support { 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. + // 30 Hz should be allowed. Returns true on success. // [main-thread] bool(CLAP_ABI *register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id); + // Returns true on success. // [main-thread] bool(CLAP_ABI *unregister_timer)(const clap_host_t *host, clap_id timer_id); } clap_host_timer_support_t; From c61906e270b6f4f14e39b45fda4351918710cadd Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:20:44 -0400 Subject: [PATCH 13/27] Clarify return values and fix typos in context-menu.h --- include/clap/ext/draft/context-menu.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/clap/ext/draft/context-menu.h b/include/clap/ext/draft/context-menu.h index 7e867afd..85c3abbc 100644 --- a/include/clap/ext/draft/context-menu.h +++ b/include/clap/ext/draft/context-menu.h @@ -94,7 +94,8 @@ typedef struct clap_context_menu_builder { void *ctx; // Adds an entry to the menu. - // entry_data type is determined by entry_kind. + // item_data type is determined by item_kind. + // Returns true on success. bool(CLAP_ABI *add_item)(const struct clap_context_menu_builder *builder, clap_context_menu_item_kind_t item_kind, const void *item_data); @@ -107,6 +108,7 @@ typedef struct clap_context_menu_builder { typedef struct clap_plugin_context_menu { // Insert plugin's menu items into the menu builder. // If target is null, assume global context. + // Returns true on success. // [main-thread] bool(CLAP_ABI *populate)(const clap_plugin_t *plugin, const clap_context_menu_target_t *target, @@ -114,6 +116,7 @@ typedef struct clap_plugin_context_menu { // Performs the given action, which was previously provided to the host via populate(). // If target is null, assume global context. + // Returns true on success. // [main-thread] bool(CLAP_ABI *perform)(const clap_plugin_t *plugin, const clap_context_menu_target_t *target, @@ -123,6 +126,7 @@ typedef struct clap_plugin_context_menu { typedef struct clap_host_context_menu { // Insert host's menu items into the menu builder. // If target is null, assume global context. + // Returns true on success. // [main-thread] bool(CLAP_ABI *populate)(const clap_host_t *host, const clap_context_menu_target_t *target, @@ -130,6 +134,7 @@ typedef struct clap_host_context_menu { // Performs the given action, which was previously provided to the plugin via populate(). // If target is null, assume global context. + // Returns true on success. // [main-thread] bool(CLAP_ABI *perform)(const clap_host_t *host, const clap_context_menu_target_t *target, @@ -145,6 +150,7 @@ typedef struct clap_host_context_menu { // If the plugin is using embedded GUI, then x and y are relative to the plugin's window, // otherwise they're absolute coordinate, and screen index might be set accordingly. // If target is null, assume global context. + // Returns true on success. // [main-thread] bool(CLAP_ABI *popup)(const clap_host_t *host, const clap_context_menu_target_t *target, From 555c99d8172863311d054d687d514e20bbbad3a6 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:21:49 -0400 Subject: [PATCH 14/27] Clarify return values in midi-mappings.h --- include/clap/ext/draft/midi-mappings.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h index e7b94a45..ef901db9 100644 --- a/include/clap/ext/draft/midi-mappings.h +++ b/include/clap/ext/draft/midi-mappings.h @@ -27,6 +27,7 @@ typedef struct clap_plugin_midi_mappings { uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); // [main-thread] + // Returns true on success and stores the result into mapping. bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t index, clap_midi_mapping_t *mapping); } clap_plugin_midi_mappings_t; From a401a2f3251c816e3badc432227e11854fbcf147 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:22:42 -0400 Subject: [PATCH 15/27] Clarify return values in preset-load.h --- include/clap/ext/draft/preset-load.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/ext/draft/preset-load.h b/include/clap/ext/draft/preset-load.h index 44ad0cc2..24f66325 100644 --- a/include/clap/ext/draft/preset-load.h +++ b/include/clap/ext/draft/preset-load.h @@ -11,6 +11,7 @@ extern "C" { typedef struct clap_plugin_preset_load { // Loads a preset in the plugin native preset file format from a location. // The preset discovery provider defines the location and load_key to be passed to this function. + // Returns true on success. // // [main-thread] bool(CLAP_ABI *from_location)(const clap_plugin_t *plugin, From 241899d50a1354bff27d19991b7fe194eef9b3eb Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:24:00 -0400 Subject: [PATCH 16/27] Clarify return values in remote-controls.h --- include/clap/ext/draft/remote-controls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/ext/draft/remote-controls.h b/include/clap/ext/draft/remote-controls.h index c5666ce7..07566d0a 100644 --- a/include/clap/ext/draft/remote-controls.h +++ b/include/clap/ext/draft/remote-controls.h @@ -56,6 +56,7 @@ typedef struct clap_plugin_remote_controls { uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); // Get a page by index. + // Returns true on success and stores the result into page. // [main-thread] bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t page_index, From d1eb56defa0c04ec361f9bd3fd63679a6a58c270 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:25:26 -0400 Subject: [PATCH 17/27] Clarify return values in track-info.h --- include/clap/ext/draft/track-info.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h index 4f4db86d..a79e67c3 100644 --- a/include/clap/ext/draft/track-info.h +++ b/include/clap/ext/draft/track-info.h @@ -52,6 +52,7 @@ typedef struct clap_plugin_track_info { typedef struct clap_host_track_info { // Get info about the track the plugin belongs to. + // Returns true on success and stores the result into info. // [main-thread] bool(CLAP_ABI *get)(const clap_host_t *host, clap_track_info_t *info); } clap_host_track_info_t; From 05b1d873d206183f46198262c47ad887de41111b Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:27:50 -0400 Subject: [PATCH 18/27] Remove repeated statement in triggers.h --- include/clap/ext/draft/triggers.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/clap/ext/draft/triggers.h b/include/clap/ext/draft/triggers.h index 9ea84c82..fa1e83a9 100644 --- a/include/clap/ext/draft/triggers.h +++ b/include/clap/ext/draft/triggers.h @@ -88,7 +88,6 @@ typedef struct clap_plugin_triggers { uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); // Copies the trigger's info to trigger_info and returns true on success. - // Returns true on success. // [main-thread] bool(CLAP_ABI *get_info)(const clap_plugin_t *plugin, uint32_t index, From b89953c26f335c0200c6ca507fdc44286865b4fb Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:29:21 -0400 Subject: [PATCH 19/27] Clarify return values in tuning.h --- include/clap/ext/draft/tuning.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/ext/draft/tuning.h b/include/clap/ext/draft/tuning.h index 57d2d84b..db8d9764 100644 --- a/include/clap/ext/draft/tuning.h +++ b/include/clap/ext/draft/tuning.h @@ -64,6 +64,7 @@ typedef struct clap_host_tuning { uint32_t(CLAP_ABI *get_tuning_count)(const clap_host_t *host); // Gets info about a tuning + // Returns true on success and stores the result into info. // [main-thread] bool(CLAP_ABI *get_info)(const clap_host_t *host, uint32_t tuning_index, From c82516c66a2be5cd5799437dd5bb5a6cee9578d2 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:30:56 -0400 Subject: [PATCH 20/27] Fix typo in preset-discovery.h --- include/clap/factory/draft/preset-discovery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/factory/draft/preset-discovery.h b/include/clap/factory/draft/preset-discovery.h index db26f1e9..5ac50e30 100644 --- a/include/clap/factory/draft/preset-discovery.h +++ b/include/clap/factory/draft/preset-discovery.h @@ -131,7 +131,7 @@ typedef struct clap_preset_discovery_metadata_receiver { // the plugin wants but it could also be some other unique id like a database primary key or a // binary offset. It's use is entirely up to the plug-in. // - // If the function returns false, the the provider must stop calling back into the receiver. + // If the function returns false, then the provider must stop calling back into the receiver. bool(CLAP_ABI *begin_preset)(const struct clap_preset_discovery_metadata_receiver *receiver, const char *name, const char *load_key); From a8e6a06bd4d3c6845c02fa9e401c6a33981c11a2 Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Fri, 3 Nov 2023 00:32:59 -0400 Subject: [PATCH 21/27] Clarify return values in preset-discovery.h --- include/clap/factory/draft/preset-discovery.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/clap/factory/draft/preset-discovery.h b/include/clap/factory/draft/preset-discovery.h index 5ac50e30..05223d9d 100644 --- a/include/clap/factory/draft/preset-discovery.h +++ b/include/clap/factory/draft/preset-discovery.h @@ -242,6 +242,7 @@ typedef struct clap_preset_discovery_provider { void(CLAP_ABI *destroy)(const struct clap_preset_discovery_provider *provider); // reads metadata from the given file and passes them to the metadata receiver + // Returns true on success. bool(CLAP_ABI *get_metadata)(const struct clap_preset_discovery_provider *provider, uint32_t location_kind, const char *location, From 92217e0c98d1ed5fb0629e1b00c0453dc17d2e9b Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Fri, 3 Nov 2023 00:51:38 -0400 Subject: [PATCH 22/27] Fix style --- include/clap/ext/note-ports.h | 2 +- include/clap/ext/timer-support.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h index f7ec37b7..f91b527f 100644 --- a/include/clap/ext/note-ports.h +++ b/include/clap/ext/note-ports.h @@ -40,7 +40,7 @@ typedef struct clap_note_port_info { // The note 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 + // Number of ports, for either input or output. // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input); diff --git a/include/clap/ext/timer-support.h b/include/clap/ext/timer-support.h index 18f6e065..221de967 100644 --- a/include/clap/ext/timer-support.h +++ b/include/clap/ext/timer-support.h @@ -16,7 +16,8 @@ typedef struct clap_plugin_timer_support { 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. Returns true on success. + // 30 Hz should be allowed. + // Returns true on success. // [main-thread] bool(CLAP_ABI *register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id); From b8e5375122923079651def85d09773bb3ad2e0c6 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 3 Nov 2023 15:28:32 +0100 Subject: [PATCH 23/27] Update changelog --- ChangeLog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index c68248fe..f3f3a81c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,9 @@ # Changes in 1.1.10 * [params.h](include/clap/ext/params.h): add `CLAP_PARAM_IS_ENUM` flag. +* various documentation improvements: + * clarification on the return value of many functions + * typos # Changes in 1.1.9 From 420a5426effb4a3bc8ce33e7ab7d3ffb84d94b42 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 3 Nov 2023 15:33:45 +0100 Subject: [PATCH 24/27] Few more documentation cleanup --- include/clap/ext/params.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index d51846c5..2ec7e025 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -256,19 +256,23 @@ typedef struct clap_plugin_params { // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); - // Copies the parameter's info to param_info. Returns true on success. + // Copies the parameter's info to param_info. + // Returns true on success. // [main-thread] bool(CLAP_ABI *get_info)(const clap_plugin_t *plugin, uint32_t param_index, clap_param_info_t *param_info); - // Writes the parameter's current value to out_value. Returns true on success. + // Writes the parameter's current value to out_value. + // Returns true on success. // [main-thread] bool(CLAP_ABI *get_value)(const clap_plugin_t *plugin, clap_id param_id, double *out_value); // Fills out_buffer with a null-terminated UTF-8 string that represents the parameter at the - // given 'value' argument. eg: "2.3 kHz". Returns true on success. The host should always use - // this to format parameter values before displaying it to the user. [main-thread] + // given 'value' argument. eg: "2.3 kHz". The host should always use this to format parameter + // values before displaying it to the user. + // Returns true on success. + // [main-thread] bool(CLAP_ABI *value_to_text)(const clap_plugin_t *plugin, clap_id param_id, double value, @@ -276,7 +280,8 @@ typedef struct clap_plugin_params { uint32_t out_buffer_capacity); // Converts the null-terminated UTF-8 param_value_text into a double and writes it to out_value. - // Returns true on success. The host can use this to convert user input into a parameter value. + // The host can use this to convert user input into a parameter value. + // Returns true on success. // [main-thread] bool(CLAP_ABI *text_to_value)(const clap_plugin_t *plugin, clap_id param_id, From de9aa5d3b0c6902076ec29ed2bbbcf410d032ba2 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Sat, 4 Nov 2023 11:29:23 +0100 Subject: [PATCH 25/27] Update include/clap/ext/draft/midi-mappings.h Co-authored-by: Trinitou <106991375+Trinitou@users.noreply.github.com> --- include/clap/ext/draft/midi-mappings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h index ef901db9..c584e9d8 100644 --- a/include/clap/ext/draft/midi-mappings.h +++ b/include/clap/ext/draft/midi-mappings.h @@ -26,8 +26,8 @@ typedef struct clap_plugin_midi_mappings { // [main-thread] uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin); - // [main-thread] // Returns true on success and stores the result into mapping. + // [main-thread] bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t index, clap_midi_mapping_t *mapping); } clap_plugin_midi_mappings_t; From 5b24f8023b68e2a455633868b5df460a09a58ff0 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Sat, 4 Nov 2023 11:29:34 +0100 Subject: [PATCH 26/27] Update include/clap/ext/draft/preset-load.h Co-authored-by: Trinitou <106991375+Trinitou@users.noreply.github.com> --- include/clap/ext/draft/preset-load.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/clap/ext/draft/preset-load.h b/include/clap/ext/draft/preset-load.h index 24f66325..92263f11 100644 --- a/include/clap/ext/draft/preset-load.h +++ b/include/clap/ext/draft/preset-load.h @@ -12,7 +12,6 @@ typedef struct clap_plugin_preset_load { // Loads a preset in the plugin native preset file format from a location. // The preset discovery provider defines the location and load_key to be passed to this function. // Returns true on success. - // // [main-thread] bool(CLAP_ABI *from_location)(const clap_plugin_t *plugin, uint32_t location_kind, From 5651cd65cb2b65d1cd32d557020cba794b577594 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Sat, 4 Nov 2023 11:32:32 +0100 Subject: [PATCH 27/27] Apply suggestions from code review Co-authored-by: Trinitou <106991375+Trinitou@users.noreply.github.com> --- include/clap/ext/gui.h | 1 - include/clap/plugin.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h index 60999e60..7704da91 100644 --- a/include/clap/ext/gui.h +++ b/include/clap/ext/gui.h @@ -211,7 +211,6 @@ typedef struct clap_host_gui { // Note: if not called from the main thread, then a return value simply means that the host // acknowledged the request and will process it asynchronously. If the request then can't be // satisfied then the host will call set_size() to revert the operation. - // // [thread-safe & !floating] bool(CLAP_ABI *request_resize)(const clap_host_t *host, uint32_t width, uint32_t height); diff --git a/include/clap/plugin.h b/include/clap/plugin.h index 8f145cfe..97ead816 100644 --- a/include/clap/plugin.h +++ b/include/clap/plugin.h @@ -60,7 +60,6 @@ typedef struct clap_plugin { // the [min, max] range, which is bounded by [1, INT32_MAX]. // Once activated the latency and port configuration must remain constant, until deactivation. // Returns true on success. - // // [main-thread & !active_state] bool(CLAP_ABI *activate)(const struct clap_plugin *plugin, double sample_rate,