diff --git a/CMakePresets.json b/CMakePresets.json index e2d9ea7c..8144fdd2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -28,7 +28,7 @@ "displayName": "MSVC", "description": "Configure and generate MSVC project files for all configurations", "binaryDir": "${sourceDir}/builds/${presetName}", - "generator": "Visual Studio 17 2022", + "generator": "Visual Studio 18 2026", "cacheVariables": { "CMAKE_EXPORT_COMPILE_COMMANDS": { "type": "boolean", diff --git a/ChangeLog.md b/ChangeLog.md index 4b080b9c..ae4abf38 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,8 @@ +# Changes in 1.2.10 + +* [param-hovered.h](include/clap/ext/draft/param-hovered.h): new extension to tell the host when a parameter is mouse hovered within the plugin's GUI. +* [params.h](include/clap/ext/params.h): clarify `CLAP_PARAM_IS_BYPASS`. + # Changes in 1.2.9 * [param-origin.h](include/clap/ext/draft/param-origin.h): new extension to provides an optional value per parameter that lets the host draw a visual indication for the parameter's origin diff --git a/include/clap/all.h b/include/clap/all.h index 398a2066..a1063f96 100644 --- a/include/clap/all.h +++ b/include/clap/all.h @@ -14,6 +14,7 @@ #include "ext/draft/mini-curve-display.h" #include "ext/draft/octave-number.h" #include "ext/draft/params-origin.h" +#include "ext/draft/param-hovered.h" #include "ext/draft/project-location.h" #include "ext/draft/resource-directory.h" #include "ext/draft/scratch-memory.h" diff --git a/include/clap/ext/draft/background-state-context.h b/include/clap/ext/draft/background-state-context.h index e76dae04..96e02492 100644 --- a/include/clap/ext/draft/background-state-context.h +++ b/include/clap/ext/draft/background-state-context.h @@ -8,7 +8,7 @@ /// Some plugin needs to perform complex computation or even I/O during state loading or saving and /// this blocks the main thread. /// -/// This extension is here to offer an alternative way to load or save the plugin plugin from a +/// This extension is here to offer an alternative way to load or save the plugin from a /// background thread, to keep the main-thread running. /// /// Background save and load must not be concurrent to main-thread save and load. diff --git a/include/clap/ext/draft/param-hovered.h b/include/clap/ext/draft/param-hovered.h new file mode 100644 index 00000000..a863d47b --- /dev/null +++ b/include/clap/ext/draft/param-hovered.h @@ -0,0 +1,29 @@ +#pragma once + +#include "../../plugin.h" + +// This extension lets a plugin report to the host the parameter's clap_id of its last hovered UI +// control and whether it is currently hovered (usually hovered by pointer device). + +static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_HOVERED[] = "clap.param-hovered/1"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_host_param_hovered { + // Plugin informs the host about a new hover state. + // + // Should be called whenever the hovered UI control's parameter ID changes or when it changes + // from hovered to not being hovered. + // + // Only one parameter can be hovered at a time. Use CLAP_INVALID_ID as param_id if no parameter + // is hovered. + // + // [main-thread] + void(CLAP_ABI *update)(const clap_host_t *host, clap_id hovered_param_id); +} clap_host_param_hovered_t; + +#ifdef __cplusplus +} +#endif diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index 2f857696..08800bb8 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -147,8 +147,12 @@ enum { // This parameter is used to merge the plugin and host bypass button. // It implies that the parameter is stepped. + // Only zero or one bypass parameter is allowed per plugin. // min: 0 -> bypass off // max: 1 -> bypass on + // The value of this parameter should not influence whether the host calls plugin->process() or + // not. If a plugin wants to save CPU cycles during bypass, the plugin will implement that in its + // process() routine, possibly returning CLAP_PROCESS_SLEEP at some point. CLAP_PARAM_IS_BYPASS = 1 << 4, // When set: diff --git a/include/clap/version.h b/include/clap/version.h index fddd7d7d..cfba5553 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 2 -#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 }