Hi,
I am trying to add the feature " Storing and retrieving parameters" to my plugin.
I have used the code that is given in the Juce tutorial
void getStateInformation (MemoryBlock& destData) override
{
auto state = parameters.copyState();
std::unique_ptr xml (state.createXml());
copyXmlToBinary (*xml, destData);
}
But I got the exception at the line
jassert (isValidXmlName (tagName));
When I monitor the tagName it is named “2RuleSynth” (this is the name of my plugin)
I know that Tag names can’t start with the letters xml , a number , or punctuation,
How I can change the PluginName that XML procedure of stateinformation uses?
It depends, if you do it the old way, adding the parameters to the AudioProcessorValueTreeState, you assign a ValueTree at the end of the constructor, which is the root node of the XML.
If you use the new way by supplying a ParameterLayout in the AudioProcessorValueTreeState constructor, the third parameter is a string, which is the tagName of your root XML node.
Thanks Jimmi,
But I did not implemented the JUCE tutorial exactly that you have mentioned, I created another custom class responsible of creation of parameters. That is different than pre initialization parameter layout of PluginProcessor constructor . So I have to use the valueTreeState.state = ValueTree(Identifier(JucePlugin_Name)); in the code
I may not be able to explain it clearly, sorry for that.
Hi, I have the same problem and It doesn’t store states Can anybody please have a look at it ? I did everything i found in tutorials and docs . There are so many post about this topic but everything is mixed and i don’t know which one is the right way to save and load these states .
“Test_Plugin” this worked thank you very much . I was trying implement everything i could find:D I know juce community is huge but somehow on some topics contents are mixed . It is really so hard for me to follow the latest version of methods.
I just want to make sure, Could you please tell me? Is this the latest implementation of value tree state ? Do I need to add more stuff ? if I don’t need to add more ,as a next step I will add a file browser component to provide “preset selection” feature. But first of all i will learn more about xml files.