Recall the old "Plugin Settings"? Where?


#1

Hey guys,

I'm looking for a function, where i can add my code to store my Plugin if the User safes his DAW Projekt, or is closing the Project, also I'm looking for where i can add my code if a user is loading a project with my plugin to recall the old settings.

 

In which file format i have to safe/load the settings?!

AudioProcessor::setStateInformation

&&

AudioProcessor::getStateInformation

are already implemented but "getStateInformation" is only calling when i press the load button from the Plugin.

"setStateInformation" is called when i safe the Projekt, but i cant see a standard file Path or a standard name.

 

//Edit

I had a second look into the AudioProcessor Api and founded:

    void setCurrentProgramStateInformation(const void * data, int sizeInBytes);
    void getCurrentProgramStateInformation(juce::MemoryBlock & destData);

but if i add them to my code Live is crashing when i try to safe a project with my Plugin and i cant reach booth function with a breakpoint, so it seems like I'm on the wrong place?!

 

So hopefully u could help me.

 

Have a nice week.

 

Kindly Regards

TheRabbit
 


#2

Yes, those are the functions to use, and like their comments say, it's just a blob of data that you can use in any way you like.

Have a look at the demo plugin for an example of how to use them.

And if it's crashing, that's not because you're using the wrong methods, it's because you've done something silly - learn to debug your code!


#3

Yeah my mistake, I'm sorry.

 


#4

Hope you get it working :)


#5

getCurrentProgramStateInformation(juce::MemoryBlock & destData)

setCurrentProgramStateInformation(const void * data, int sizeInBytes)

 

I added both functions and put a Debug output in them + sat a breakpoint, but nothing happend in Ableton(9.2.2) & Juce Demo Host. The breakpoints are also not reached

Did i miss something?


#6

You almost certainly missed something but impossible for us to guess what.

Maybe start by adding the "override" keyword?


#7

nope they are already "overriden" :(

 

Processor.h

    virtual void setCurrentProgramStateInformation(const void * data, int sizeInBytes)override;
    virtual void getCurrentProgramStateInformation(juce::MemoryBlock & destData)override;

 

i tryed also

 

    void setCurrentProgramStateInformation(const void * data, int sizeInBytes)override;
    void getCurrentProgramStateInformation(juce::MemoryBlock & destData)override;

Processor.cpp

void AudioProcessor::setCurrentProgramStateInformation(const void * data, int sizeInBytes)
{
    DEBUG_LOG(35, "er versucht zu laden");
}

void AudioProcessor::getCurrentProgramStateInformation(juce::MemoryBlock & destData)
{
    DEBUG_LOG(35, "er versucht zu speichern");
}

 

if i call "getCurrentProgramStateInformation"

the breakpoint reacts and i get and output from my debug.


#8

If the breakpoint works, then presumably if it doesn't get hit, the host isn't calling that method.


#9

mhmh does anyone have a workarround? it must be possible to load some old settings...
 


#10

workaround for what? It does work, that's how all plugins load/save their settings.

It's up to the host to decide when it calls those methods, so maybe save your project or something to trigger it. Or use the juce demo host as a test harness for more control.