diff --git a/CHANGELOG.md b/CHANGELOG.md index 5232060..95cda82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed +- Having both the `CLAP_PARAM_IS_READONLY` flag and any of the + `CLAP_PARAM_IS_AUTOMATABLE` or `CLAP_PARAM_IS_MODULATABLE` flags set now + results in an error. - The logic for which parameters can be randomized has changed. Previously all parameters marked as automatable could be changed. Now parameters marked as hidden or readonly are ignored instead, as non-automatable parameters can diff --git a/src/plugin/ext/params.rs b/src/plugin/ext/params.rs index b78ac06..1ee0ed1 100644 --- a/src/plugin/ext/params.rs +++ b/src/plugin/ext/params.rs @@ -292,6 +292,17 @@ impl Params<'_> { info.id ) } + if ((info.flags & CLAP_PARAM_IS_READONLY) != 0) + && ((info.flags & CLAP_PARAM_IS_AUTOMATABLE) != 0 + || (info.flags & CLAP_PARAM_IS_MODULATABLE) != 0) + { + anyhow::bail!( + "Parameter '{}' (stable ID {}) has the CLAP_PARAM_IS_READONLY flag set, but \ + it is also marked as automatable or modulatable. This is likely a bug.", + &name, + info.id + ) + } let processed_info = Param { name,