Persistence

I followed the tutorial from the gain example, there are some errors like these lines :
void** in = getChannelBuffersPointer (processSetup, datainputs[0]);
void** out = getChannelBuffersPointer (processSetup, dataoutputs[0]);
those should be:
void** in = getChannelBuffersPointer (processSetup, data.inputs[0]);
void** out = getChannelBuffersPointer (processSetup, data.outputs[0]);
I tried to create the persistance of the parameters with the get/set implementation but I just couldn’t make them work.
I implement them, save the project and everytime I re-open the project they are in their default state.

Yeah, you’ right. There are these typos and the missing part is that the controller also needs to load the state and set its parameter accordingly:

tresult PLUGIN_API PlugController::setComponentState (IBStream* state)
{
	// Here you get the state of the component (Processor part)
	if (!state)
		return kResultFalse;

    IBStreamer streamer (state, kLittleEndian);
    float savedParam1 = 0.f;
    if (streamer.readFloat (savedParam1) == false)
        return kResultFalse;

	// sync with our parameter
	if (auto param = getParameter (GainParams::kParamGainId))
		param->setNormalized (savedParam1);

    return kResultOk;
}

Thanks a lot, I discover it by looking at the “hello world” example along with the bypass method. I didn´t post it because it was about midnight. I think I will make a video about this.