Correct way to use beginChangeGesture and endChangeGesture

I am having a problem where this fails:

jassert (! isPerformingGesture);

My plugin worked fine for a while, but with no changes to the code, this starting failing and only in debug mode (since the VST build works fine).

Here are two ways I’ve tried to use the gesture methods:

mLeftDelaySlider.onValueChange = [this, leftDelayParameter] { *leftDelayParameter = mLeftDelaySlider.getValue(); };
mLeftDelaySlider.onDragStart = [leftDelayParameter] {leftDelayParameter->beginChangeGesture();};
mLeftDelaySlider.onDragEnd = [leftDelayParameter] { leftDelayParameter->endChangeGesture(); };

After this stopped working, I tried making the audio editor inherit from slider::Listener and this:

void ChannelDelayAudioProcessorEditor::sliderValueChanged(juce::Slider* slider)
if ( slider == & mLeftDelaySlider ){

I’m not sure the purpose of the gesture methods along with setValueNotifyingHost I know it has something to do with sending changes to the host, because when I remove the first code i tried, the automation doesn’t work in the host.

Any recommendations or insights would be appreciated. Thank you

1 Like

If you use a SliderAttachment it’ll make the calls for you and you don’t have to handle the Slider changes.

If you’re doing a custom control which has EQ nodes, etc then you’d make the calls on mouseDown and mouseUp


1 Like