From c6a34a63c4568ec0e4c6e0c4c00c96cebc9a0f33 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 23 Mar 2022 13:51:21 +0100 Subject: [PATCH] Hide non-automatable parameters --- src/wrapper/clap/wrapper.rs | 12 +++++++----- src/wrapper/vst3/wrapper.rs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index 25fd0bda..a57a1b25 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -31,7 +31,8 @@ use clap_sys::ext::note_ports::{ }; use clap_sys::ext::params::{ clap_host_params, clap_param_info, clap_plugin_params, CLAP_EXT_PARAMS, - CLAP_PARAM_IS_AUTOMATABLE, CLAP_PARAM_IS_BYPASS, CLAP_PARAM_IS_STEPPED, + CLAP_PARAM_IS_AUTOMATABLE, CLAP_PARAM_IS_BYPASS, CLAP_PARAM_IS_HIDDEN, CLAP_PARAM_IS_READONLY, + CLAP_PARAM_IS_STEPPED, }; use clap_sys::ext::state::{clap_plugin_state, CLAP_EXT_STATE}; use clap_sys::ext::tail::{clap_plugin_tail, CLAP_EXT_TAIL}; @@ -1744,10 +1745,11 @@ impl Wrapper

{ let automatable = !param_ptr.flags().contains(ParamFlags::NON_AUTOMATABLE); param_info.id = *param_hash; - param_info.flags = 0; - if automatable { - param_info.flags |= CLAP_PARAM_IS_AUTOMATABLE - } + param_info.flags = if automatable { + CLAP_PARAM_IS_AUTOMATABLE + } else { + CLAP_PARAM_IS_HIDDEN | CLAP_PARAM_IS_READONLY + }; if step_count.is_some() { param_info.flags |= CLAP_PARAM_IS_STEPPED } diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index 8f0f5a1d..4b8d6d4f 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -355,7 +355,7 @@ impl IEditController for Wrapper

{ info.flags = if automatable { vst3_sys::vst::ParameterFlags::kCanAutomate as i32 } else { - vst3_sys::vst::ParameterFlags::kNoFlags as i32 + vst3_sys::vst::ParameterFlags::kIsReadOnly as i32 | (1 << 4) // kIsHidden }; }