Glad it works.
N.B. if you use the AudioProcessorValueTreeState, then there is an easy way to save and restore all parameters with one call:
void FooProcessor::getStateInformation (juce::MemoryBlock& destData)
{
juce::MemoryOutputStream stream(destData, false);
state.state.writeToStream (stream);
}
void FooProcessor::setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor)
{
auto tree = juce::ValueTree::readFromData (data, size_t (sizeInBytes));
if (tree.isValid() == false)
return;
state.replaceState (tree);
}
The AudioValueTreeState already contains all parameter values. And it has a public ValueTree member, also called state
. If you store your string as property there, it will automatically be included in the persistent state.
Just as a shortcut. But you are free in the choice how to save and restore and which format to use.