commit feb11fb2df33af87a5c1ef84efc5fe04b124d15c
parent c32a6739e22310e898df9340948c3b562dcb1105
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Mon, 9 Jan 2023 11:42:00 +0100
audio-ports-activation.h: `set_active()` now returns bool
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ChangeLog.md b/ChangeLog.md
@@ -9,6 +9,7 @@
* [context-menu.h](include/clap/ext/draft/context-menu.h): add "title" menu entry
* [preset-load.h](include/clap/ext/draft/preset-load.h): load from URI instead of path, making the extension more powerful
* [remote-controls.h](include/clap/ext/draft/remote-controls.h): distinguish between device pages and preset pages
+* [audio-ports-activation.h](include/clap/ext/draft/audio-ports-activation.h): `set_active()` now returns bool instead of void, this helps catching problems earlier especially with invalid arguments
## Draft factories
diff --git a/include/clap/ext/draft/audio-ports-activation.h b/include/clap/ext/draft/audio-ports-activation.h
@@ -26,7 +26,7 @@
/// clap_host_audio_ports.rescan(CLAP_AUDIO_PORTS_RESCAN_LIST).
static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS_ACTIVATION[] =
- "clap.audio-ports-activation/draft-0";
+ "clap.audio-ports-activation/draft-1";
#ifdef __cplusplus
extern "C" {
@@ -42,8 +42,9 @@ typedef struct clap_plugin_audio_ports_activation {
// It is only possible to activate and de-activate on the audio-thread if
// can_activate_while_processing() returns true.
//
+ // returns false if failed, or invalid parameters
// [active ? audio-thread : main-thread]
- void(CLAP_ABI *set_active)(const clap_plugin_t *plugin,
+ bool(CLAP_ABI *set_active)(const clap_plugin_t *plugin,
bool is_input,
uint32_t port_index,
bool is_active);