Is it possible to completely disable a control from all outside input?

Sometimes I want to disable a control - in response to other control settings, etc. - to prevent it’s associated parameter value from being changed. On the UI side DisableControl() does that job however that function only disables the UI control - it does not disable DAW automation or the DAW’s “generic editor” for that control.

Is there any way to disable a control/parameter entirely to completely “lock” it from being changed by either the UI, generic editor, or DAW automation?

Thought I’d bump this post as I still have the same question. Any means or suggestions on how to do this?

Not sure if it can help, OnParamChange has “source” parameter which can be useful for some workarounds:
[EParamSource] { kReset, kHost, kPresetRecall, kUI,
kDelegate, kRecompile, kUnknown, kNumParamSources
}
Used to identify the source of a parameter change.

1 Like

Interesting. I never paid much attention to that parameter and just went with whatever it defaults to - but will give it a look. Thank you for the suggestion!

1 Like

But there might be simpler solution to “completely disable” control. I would just use additional flag (declaring in header file):
private:
bool mDisabledParam[kNumParams] = {false};

where control kWhatever gets disabled also changing the flag:
mDisabledParam[kWhatever] = true;
and in OnParamChange prevent any changes to variables (usually control is “tied” to some variable);
OnParamChange(int paramIdx, EParamSource source, int sampleOffset)
{
if (mDisabledParam[paramIdx]{ //Do Nothing
}
else{
switch (paramIdx)
{ …

This would not “completely lock” the control, but it would prevent changes that the control normally does.

Yes, thank you. What you suggested is what I am currently doing, i.e., checking the control enable/disable status in OnParamChange() and only updating the associated variable when the control is enabled.

That takes care of the actual data being used however it creates a new problem in that it is still possible to “move” the “disabled” control using a DAWs generic plugin editor or automation data - creating a potential “what you see is not what you’re getting” conflict. Your DSP variable, in this case, may not match what is shown in the UI.

A control can be blocked from responding to automation data using kFlagCannotAutomate but AFAIK that can only be set in the plugin constructor, not dynamically. If it could be linked to DisableControl() that would get us 2/3 of the way there. I don’t know how, or if it’s even if possible, to block the control from being changed by a DAW’s generic plugin editor.

What I’m trying to avoid is a situation where the DSP variable does not match the control value being displayed. This can happen currently when using DisableControl() even with the workaround in OnParamChange().

1 Like

Have you tried:

SetParameterValue(kWhatever, value); // value (DSP variable) normalized 0. to 1.
if (GetUI()) GetUI()->GetControlWithTag(kCtrlWhatever)->SetValueFromDelegate(value); // value normalized 0. to 1.

OnIdle() seems a convenient place for such calls.
Affects DAW’s generic plugin editor nicely, but I am not sure what would happen if automation is already written?

1 Like

Yes, I am using something like that but for other reasons (linking parameters) and interactions can get complicated.

What I was hoping to find was some form of “DisableControl()” that disables a control entirely so automation data can’t change it and it appears “greyed out/disabled” in the generic plugin editor just like the UI control.

Maybe that’s not possible or would be DAW-specific?