MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / getStateInformation

Method getStateInformation

NeuralNote/PluginSources/PluginProcessor.cpp:54–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void NeuralNoteAudioProcessor::getStateInformation(MemoryBlock& destData)
55{
56 auto full_state_tree = ValueTree(NnId::FullStateId);
57
58 full_state_tree.setProperty(NnId::NeuralNoteVersionId, ProjectInfo::versionString, nullptr);
59
60 // PARAMETERS
61 auto apvts = mAPVTS.copyState();
62 jassert(apvts.getType() == NnId::ParametersId);
63
64 full_state_tree.appendChild(apvts, nullptr);
65
66 // NEURAL NOTE STATE
67 // Update value tree with current state
68 mPlayer->saveStateToValueTree();
69
70 full_state_tree.appendChild(mValueTree, nullptr);
71
72 std::unique_ptr<XmlElement> xml(full_state_tree.createXml());
73
74 if (xml != nullptr) {
75 copyXmlToBinary(*xml, destData);
76 }
77}
78
79void NeuralNoteAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
80{

Callers

nothing calls this directly

Calls 1

saveStateToValueTreeMethod · 0.45

Tested by

no test coverage detected