commit 7687d43dc0533489a667a124613b5561f3d2103e
parent 757fdf6ee5c0d12b8dca10becfcbfee85e01a5d4
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Fri, 30 Dec 2022 18:38:36 +0100
Merge branch 'next' into preset-discovery
Diffstat:
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/ChangeLog.md b/ChangeLog.md
@@ -8,10 +8,10 @@
* Remove UTF-8 BOM from a few files
* [plugin-template.c](src/plugin-template.c): add state impl and some comments
* [audio-ports-activation.h](include/clap/ext/draft/audio-ports-activation.h): improved documentation
-* [version.h](include/clap/version.h): Add a CLAP_VERSION_GE(maj,min,rev), _EQ and _LT macro. Remove the
- uint32_t cast from CLAP_VERSION_MAJOR, _MINOR, and _REVISION macro, and introduce it to the CLAP_VERSION_INIT
- macro. If you rely on these macros being a uint32_t or parse this header using external software, this
- may be a breaking change.
+* [version.h](include/clap/version.h):
+ * Add a CLAP_VERSION_GE(maj,min,rev), _EQ and _LT macro.
+ * Remove the uint32_t cast from CLAP_VERSION_MAJOR, _MINOR, and _REVISION macro, and introduce it to the CLAP_VERSION_INIT macro.
+ * If you rely on these macros being a uint32_t or parse this header using external software, this may be a breaking change.
# Changes in 1.1.4
diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h
@@ -97,7 +97,7 @@
/// ..... . .
/// before: . . and after: . .
///
-/// Advices for the host:
+/// Advice for the host:
/// - store plain values in the document (automation)
/// - store modulation amount in plain value delta, not in percentage
/// - when you apply a CC mapping, remember the min/max plain values so you can adjust
diff --git a/include/clap/host.h b/include/clap/host.h
@@ -15,7 +15,7 @@ typedef struct clap_host {
const char *name; // eg: "Bitwig Studio"
const char *vendor; // eg: "Bitwig GmbH"
const char *url; // eg: "https://bitwig.com"
- const char *version; // eg: "4.3", see plugin.h for advices on how to format the version
+ const char *version; // eg: "4.3", see plugin.h for advice on how to format the version
// Query an extension.
// It is forbidden to call it before plugin->init().
diff --git a/src/plugin-template.c b/src/plugin-template.c
@@ -132,10 +132,11 @@ static bool my_plug_init(const struct clap_plugin *plugin) {
my_plug_t *plug = plugin->plugin_data;
// Fetch host's extensions here
- plug->host_log = plug->host->get_extension(plug->host, CLAP_EXT_LOG);
- plug->host_thread_check = plug->host->get_extension(plug->host, CLAP_EXT_THREAD_CHECK);
- plug->host_latency = plug->host->get_extension(plug->host, CLAP_EXT_LATENCY);
- plug->host_state = plug->host->get_extension(plug->host, CLAP_EXT_STATE);
+ // Make sure to check that the interface functions are not null pointers
+ plug->host_log = (const clap_host_log_t *)plug->host->get_extension(plug->host, CLAP_EXT_LOG);
+ plug->host_thread_check = (const clap_host_thread_check_t *)plug->host->get_extension(plug->host, CLAP_EXT_THREAD_CHECK);
+ plug->host_latency = (const clap_host_latency_t *)plug->host->get_extension(plug->host, CLAP_EXT_LATENCY);
+ plug->host_state = (const clap_host_state_t *)plug->host->get_extension(plug->host, CLAP_EXT_STATE);
return true;
}