Hi there, I’m somewhat new to JUCE but have a UI Component problem with my plugin that’s been puzzling me especially since I’ve been successful in implementing parameter->UI/UI->parameter updates elsewhere in my plugin.
Description:
In my PluginProcessor I have an array of delayParameters[8] and an array of panParameters[8]. In my editor I have an array of sliders, delayS[8] and panS[8]. (These of course each correspond to the parameters in my processor.
In order to update the parameters from a Slider event I have a Listener function sliderValueChanged that updates these parameters:
void editor::sliderValueChanged (Slider *slider)
{
for( int i = 0; i<8; i++){
if (slider == &delayS[i]){
processor.delayParameters[i]->setValueNotifyingHost((float) delayS[i].getValue());
}
if (slider == &panS[i]){
processor.panParameters[i]->setValueNotifyingHost((float) panS[i].getValue());
}
}
}
To update the sliders from a parameter change I’m using a timerCallback method:
void NewProjectAudioProcessorEditor::timerCallback(){
for(int i = 0; i<8; i++){
delayS[i].setValue(processor.delayParameters[i]->get(), dontSendNotification);
panS[i].setValue(processor.panParameters[i]->get(), dontSendNotification);
}
}
[LINK]
Behavior Example
As I said, for the delay sliders/parameters this works fine, but I get the following behavior when I try updating pan parameters from the slider. The framerate is low, but notice how it seems as if the parameters are overriding the slider. Something seems wrong with the value exchange, but I’m doing nothing different to how I setup my sliders.
Potentially helpful info:
For my timer callback function I call
startTimer(30);
at the start of the editor constructor.
This is how I am setting up my array of sliders
for(int i = 0; i< 8; i++){ //for each slider
delayS[i].setSliderStyle (Slider::LinearBarVertical);
delayS[i].setRange(0.0, 1.0, 0.01);
delayS[i].setTextBoxStyle (Slider::NoTextBox, false, 90, 0);
delayS[i].setPopupDisplayEnabled (true, this);
delayS[i].setTextValueSuffix (" Delay Wet");
delayS[i].setValue(p.delayParameters[i]->get());
mt.getTabContentComponent(0)->addAndMakeVisible(&delayS[i]);
delayS[i].addListener(this);
delayS[i].setLookAndFeel (&laf2);
panS[i].setSliderStyle (Slider::LinearBarVertical);
panS[i].setRange (-1.0, 1.0, 0.01);
panS[i].setTextBoxStyle (Slider::NoTextBox, false, 90, 0);
panS[i].setPopupDisplayEnabled (true, this);
panS[i].setTextValueSuffix (" Pan");
panS[i].setValue(p.panParameters[i]->get());
mt.getTabContentComponent(1)->addAndMakeVisible(&panS[i]);
panS[i].addListener(this);
panS[i].setLookAndFeel (&laf2);
}