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 1/2] 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 2/2] 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;