📈
juce-cookbook
  • Introduction
  • Getting Started
    • Why JUCE?
    • Other Libraries
    • Resources
  • C++
    • IDE
    • Tools
    • Resources
  • Setup
    • macOS
    • Windows
    • Linux
    • Projucer vs. CMake
    • Create Project
    • Debugging
    • Documentation
  • Coding
    • User Interface
      • Component
      • Button
      • Look&Feel
    • Plug-in
      • Basics
      • Parameter
    • DSP
      • Basics
      • Create your own
    • Modules
    • Misc
    • Examples
    • Snippets
  • Testing
    • Unit tests
    • pluginval
    • Sanitizers
    • Profile
    • Benchmark
  • Continuous Integration
    • Travis CI
    • AppVeyor
    • Publish
  • Wish List
  • What's next
  • License
Powered by GitBook
On this page

Was this helpful?

  1. Coding

Snippets

Plug-in recall

Variable parameters_ is of type juce::AudioProcessorValueTreeState:

void YourPluginProcessor::getStateInformation(juce::MemoryBlock& destData)
{
    juce::MemoryOutputStream stream(destData, false);
    parameters_.state.writeToStream(stream);
}

void YourPluginProcessor::setStateInformation(const void* data, int sizeInBytes)
{
    juce::ValueTree tree = juce::ValueTree::readFromData(data, static_cast<size_t>(sizeInBytes));
    jassert(tree.isValid());
    if (tree.isValid())
    {
        parameters_.state = tree;
    }
}
PreviousExamplesNextTesting

Last updated 5 years ago

Was this helpful?