Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/LookAheadCompressor/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ AudioProcessorEditor* LookAheadCompressorAudioProcessor::createEditor()
//==============================================================================
void LookAheadCompressorAudioProcessor::getStateInformation (MemoryBlock& destData)
{
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.
const auto str = parameters.copyState().toXmlString().toStdString();
destData.setSize(str.size());
destData.copyFrom(str.data(), 0, str.size());
}

void LookAheadCompressorAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
// You should use this method to restore your parameters from this memory block,
// whose contents will have been created by the getStateInformation() call.
String str{reinterpret_cast<const char *>(data), (size_t)sizeInBytes};
parameters.replaceState(ValueTree::fromXml(str));
}

//==============================================================================
Expand Down