I have a question about turning automation on/off in ProTools.
There is a button called Plug-In Automation Enable at the top of the plug-in.
This button opens a dialog box where you can turn automation on/off (Add/Remove).
There are plug-ins that allow you to do the same thing by using Control + Option + Command + Click in the plug-in GUI.
I would like to know how this is achieved.
The parameters are defined using AudioProcessorValueTreeState.
check AudioProcessorEditor ::getControlParameterIndex
Thank you for any hints.
I have tried it.
int getControlParameterIndex(juce::Component& comp) override {
return dynamic_cast<AudioParameterFloat*>(&comp)->getParameterIndex();
}
The results of the test.
Clicking on the desired component causes proTools to crash.
Am I using the cast incorrectly?
Well I suppose not all you component (if any) inherit from AudioParameterFloat.
This function take as input the widget under your mouse and try to get (if there is one) the associated parameter with it so you need to have a proper implementation of this logic according to your code.
Any advice appreciated.
That was an incorrect cast.
I realized that the component being passed was a slider.
It was a success.
Thanks to the advice I got from otristan.
Thank you very much.
class JuceVstStudy1AudioProcessorEditor : public juce::AudioProcessorEditor
{
public:
int getControlParameterIndex(juce::Component& c) override {
if( juce::String( "TargetCompnentName" ) == c.getName() )
{
return valueTreeState.getParameter(juce::String( "TargetCompnentName" ))->getParameterIndex();
}
return -1;
}