Hello,
I’m new to Juce and this forum. I started from the AudioprocessorValueTreeStateTutorial.
I want to add Parameters that are not automateable.
So i added Valuetree as child of parameters.state in TutorialProcessor:
ValueTree guiTree = ValueTree("GuiTree"); //
guiTree.setProperty("String1", "ok1", nullptr);
guiTree.setProperty("String2", "ok2", nullptr);
parameters.state.appendChild(guiTree, nullptr);
I added a ValuetreeListener Class. In genericEditor i added a member and create object of ValuetreeListener:
listener = new ValueTreeListener(valueTreeState.state);
If i set a property in GenericEditor the Callback works - but if i save and load a preset from the Audioprocessor the Callback in GenericEditor is not called.
I know this has been asked several times, but i didn’t find a solution to this.
void setStateInformation (const void* data, int sizeInBytes) override
{
std::unique_ptr<juce::XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
if (xmlState.get() != nullptr)
if (xmlState->hasTagName(parameters.state.getType())) {
parameters.replaceState(juce::ValueTree::fromXml(*xmlState));
parameters.state = ValueTree::fromXml(*xmlState); // added this but no effect
}
DBG("LOAD " + parameters.state.toXmlString());
}
the custom Guitree Valuetree is there and properties are updated but Listener in Editor is not called.
Would be nice if someone here could help me with that. I read that it’s fine to add Valuetrees as child to the parameters.state that way, but how would i tell the Gui that a Preset was loaded and update things?