I am only getting started, so perhaps a stupid question, but when using listeners and sendNotification, should I take care to avoid loopbacks, or does Juce internally take care of that?
I learn from Martin Robinson’s book.
There is an example, where you have a label (setEditable) and a slider.
Both have addListener
When you move slider, the sliderValueChanged is to write slider’s value into label’s text.
When you write number into label’s text, labelTextChanged set the slider’s value to that number.
To me it seems, that when I move the slider, it should change the label, which should in turn change the slider, which should in turn change the text (to same values, but whatever).
I tried to make a different code - two sliders and:
void MainContentComponent::sliderValueChanged(Slider* slider)
if (&slider1 == slider) slider2.setValue(slider1.getValue() + 0.1, sendNotification);
if (&slider2 == slider) slider1.setValue(slider2.getValue() + 0.1, sendNotification);
and indeed when i change value of either slider, both goes to maximum… so it seems like my assumption is correct and those notifications can loopback and cause trouble?
Please, could somebody explain this to me?