Hi all,
I created an Audio plugin using gen~ and JUCE.
Instead of using an AudioProcessorValueTreeState parameters; like the JUCE demo plugins ,
the code created by max has it’s own class with a large struct which stores all the parameter values.
Everything works pretty well.
It’s possible to save presets in your DAW.
One problem :
Loading a new preset changes the parameters but the sliders get redrawn back at zero.
There is a similar issue when the plugin is loaded initially.
The default values get loaded into the plugin ( at least that’s what it sounds like to me ! ) but the sliders and their values are not updated.
I can’t see anything in the main Editor or Processor classes that refers to loading presets. Where does that happen in JUCE?
Where is the classes that redraw the sliders initially and when a new preset is loaded ?
It seems that the sliders are only redrawn when they are moved but not redrawn when a preset or the plugin is loaded initially.
Perhaps it’s possible for me to write some sort of enormous getter and setter which can convert from an audiotreestate to the struct and back.
The classes come from this …
Lot’s and lot’s of classes to look at and it’s all a bit beyond me to figure out today.
Thanks in advice for some help !
Some relevant code is below …
// my editor has :
if (sliderThatWasMoved == d1LevelSlider)
{
sliderThatWasMoved->getValue();
processor.setParameter(0,sliderThatWasMoved->getValue());
}
// the max class has
/// Set a parameter of a State object
void setparameter(CommonState *cself, long index, t_param value, void *ref) {
State *self = (State *)cself;
switch (index) {
case 0: self->set_d1Level(value); break;
/// Get the state of all parameters of a State object
short getstate(CommonState *cself, char *state) {
return genlib_getstate(cself, state, &getparameter);
}