Hi,
In an earlier project of mine I had some sliders in my GUI addressing a parameter from some other class of mine (Actually Jules OpenGlDemo class from the JuceDemo) which I invoked using the changeListenerCallback method - this worked fine using the following code:
void DemoEditorComponent::changeListenerCallback (void* source)
{
if (source == getFilter())
{
updateParametersFromFilter();
}
else if (source == gainSlider)
{
getFilter()->setParameterNotifyingHost (0, (float) gainSlider->getValue());
}
else if (source == zoomSlider)
{
gl->canvas->zoomFactor = (float) zoomSlider->getValue(); <-my class
}
Now I’m working on another project using the JuceAudioPlugin v1.13 which seems to use the sliderValueChanged(Slider*) method. My problem is that I can’t seem to change a parameter living in my own class (the project compiles but changing the slider doesn’t change the zoomFactor parameter) . I use the following code:
[code]void DemoEditorComponent::changeListenerCallback (void* source)
{
// this is the filter telling us that it’s changed, so we’ll update our
// display of the time, midi message, etc.
if (source == getFilter())
updateParametersFromFilter();
elseif (source == zoomSlider)
gl->canvas->zoomFactor = (float)zoomSlider->getValue();
}
void DemoEditorComponent::sliderValueChanged(Slider*)
{
getFilter()->setParameterNotifyingHost (0, (float) gainSlider->getValue());
getFilter()->setParameterNotifyingHost (1, (float) zoomSlider->getValue());
}[/code]
Does that mean that I cannot address parameters living in other classes than the getFilter() or is my code wrong?
Sorry if the question is trivial!