1
0
Fork 0

Hide non-automatable parameters

This commit is contained in:
Robbert van der Helm 2022-03-23 13:51:21 +01:00
parent 0655ce35d8
commit c6a34a63c4
2 changed files with 8 additions and 6 deletions

View file

@ -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<P: ClapPlugin> Wrapper<P> {
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
}

View file

@ -355,7 +355,7 @@ impl<P: Vst3Plugin> IEditController for Wrapper<P> {
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
};
}