From 3a16caa712fef152aeea7997a4f791f6b5da5a7e Mon Sep 17 00:00:00 2001 From: xenakios Date: Fri, 15 Dec 2017 18:26:09 +0200 Subject: [PATCH] Save and restore spectral processing order --- Source/PluginProcessor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 9f2b76e..7028af9 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -424,6 +424,12 @@ void PaulstretchpluginAudioProcessor::getStateInformation (MemoryBlock& destData { paramtree.setProperty("importedfile", m_current_file.getFullPathName(), nullptr); } + auto specorder = m_stretch_source->getSpectrumProcessOrder(); + paramtree.setProperty("numspectralstages", (int)specorder.size(), nullptr); + for (int i = 0; i < specorder.size(); ++i) + { + paramtree.setProperty("specorder" + String(i), specorder[i], nullptr); + } MemoryOutputStream stream(destData,true); paramtree.writeToStream(stream); } @@ -435,6 +441,16 @@ void PaulstretchpluginAudioProcessor::setStateInformation (const void* data, int { { ScopedLock locker(m_cs); + if (tree.hasProperty("numspectralstages")) + { + std::vector order; + int ordersize = tree.getProperty("numspectralstages"); + for (int i = 0; i < ordersize; ++i) + { + order.push_back((int)tree.getProperty("specorder" + String(i))); + } + m_stretch_source->setSpectrumProcessOrder(order); + } for (int i = 0; i < getNumParameters(); ++i) { auto par = getFloatParameter(i);