This commit is contained in:
michalcourson
2025-11-11 19:28:13 -05:00
parent 65f74cd725
commit 202a73141b
3 changed files with 55 additions and 3 deletions

View File

@ -95,10 +95,15 @@ void WebViewPluginAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer,
//==============================================================================
void WebViewPluginAudioProcessor::getStateInformation(juce::MemoryBlock& destData)
{
juce::ignoreUnused(destData);
auto out_state = state.copyState();
std::unique_ptr<juce::XmlElement> xml(out_state.createXml());
copyXmlToBinary(*xml, destData);
}
void WebViewPluginAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
{
juce::ignoreUnused(data, sizeInBytes);
std::unique_ptr<juce::XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));
if (xmlState.get() != nullptr && xmlState->hasTagName(state.state.getType()))
state.replaceState(juce::ValueTree::fromXml(*xmlState));
}