commit c1674ef65d5f767a1acfb1965d6edc6c17410fcf
parent 12a7f08372f354211ef188285b1f1e9b07faf969
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Wed, 14 Dec 2022 15:09:14 +0100
Rework param indication
Diffstat:
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/include/clap/ext/draft/param-indication.h b/include/clap/ext/draft/param-indication.h
@@ -3,32 +3,51 @@
#include "../params.h"
#include "../../color.h"
-// This extension lets the host tell the plugin to display a little color based indication on the parameter.
-// This can be used to indicate:
+// This extension lets the host tell the plugin to display a little color based indication on the
+// parameter. This can be used to indicate:
// - a physical controller is mapped to a parameter
// - the parameter is current playing an automation
// - the parameter is overriding the automation
// - etc...
//
-// The color semantic depends upon the host here and the goal is to have a consistent experience across all plugins.
+// The color semantic depends upon the host here and the goal is to have a consistent experience
+// across all plugins.
-static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_INDICATION[] = "clap.param-indication.draft/1";
+static CLAP_CONSTEXPR const char CLAP_EXT_PARAM_INDICATION[] = "clap.param-indication.draft/2";
#ifdef __cplusplus
extern "C" {
#endif
+enum {
+ CLAP_PARAM_INDICATION_AUTOMATION_NONE,
+ CLAP_PARAM_INDICATION_AUTOMATION_PLAYBACK,
+ CLAP_PARAM_INDICATION_AUTOMATION_RECORD,
+ CLAP_PARAM_INDICATION_AUTOMATION_OVERRIDE,
+};
+
typedef struct clap_plugin_param_indication {
- // Sets or clears an indication.
- // If the host doesn't use indicaton color, then indication_color should be null.
- // If has_indication is false, then the indication_color is ignored.
+ // Sets or clears a mapping indication.
+ // If the host doesn't use an indicaton color, then color should be null.
+ // If has_mapping is false, then the color is ignored.
+ //
+ // Parameter indications should not be saved in the plugin context, and are off by default.
+ // [main-thread]
+ void(CLAP_ABI *set_mapping)(const clap_plugin_t *plugin,
+ clap_id param_id,
+ bool has_mapping,
+ const clap_color_t *color);
+
+ // Sets or clears an automation indication.
+ // If the host doesn't use an indicaton color, then color should be null.
+ // If automation_state is CLAP_PARAM_INDICATION_AUTOMATION_NONE, then the color is ignored.
//
// Parameter indications should not be saved in the plugin context, and are off by default.
// [main-thread]
- void(CLAP_ABI *set)(const clap_plugin_t *plugin,
- clap_id param_id,
- bool has_indication,
- const clap_color_t *indication_color);
+ void(CLAP_ABI *set_automation)(const clap_plugin_t *plugin,
+ clap_id param_id,
+ uint32_t automation_state,
+ const clap_color_t *color);
} clap_plugin_param_indication_t;
#ifdef __cplusplus