Simplify capture saving logic a bit
This commit is contained in:
parent
7ed5987a72
commit
1e9ec7ffd3
@ -241,7 +241,6 @@ int PaulstretchpluginAudioProcessor::getPreBufferAmount()
|
||||
ValueTree PaulstretchpluginAudioProcessor::getStateTree(bool ignoreoptions, bool ignorefile)
|
||||
{
|
||||
ValueTree paramtree("paulstretch3pluginstate");
|
||||
paramtree.setProperty("captureuuid", m_capture_uuid, nullptr);
|
||||
storeToTreeProperties(paramtree, nullptr, getParameters());
|
||||
if (m_current_file != File() && ignorefile == false)
|
||||
{
|
||||
@ -313,15 +312,6 @@ void PaulstretchpluginAudioProcessor::setStateFromTree(ValueTree tree)
|
||||
{
|
||||
setAudioFile(File(fn));
|
||||
}
|
||||
else
|
||||
{
|
||||
String captureuuid = tree.getProperty("captureuuid");
|
||||
if (captureuuid.isEmpty() == false)
|
||||
{
|
||||
String capturefn = "C:\\Users\\Teemu\\AppData\\Roaming\\PaulXStretch\\audio_captures\\" + captureuuid + ".wav";
|
||||
setAudioFile(File(capturefn));
|
||||
}
|
||||
}
|
||||
}
|
||||
m_state_dirty = true;
|
||||
}
|
||||
@ -509,7 +499,7 @@ void PaulstretchpluginAudioProcessor::saveCaptureBuffer()
|
||||
jassert(sourcebuffer->getNumSamples() > 0);
|
||||
Logger::writeToLog("Saving capture to file " + outfn);
|
||||
writer->writeFromAudioSampleBuffer(*sourcebuffer, 0, sourcebuffer->getNumSamples());
|
||||
m_capture_uuid = uid.toString();
|
||||
m_current_file = outfile;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ private:
|
||||
bool m_lastrewind = false;
|
||||
AudioFilePreviewComponent* m_previewcomponent = nullptr;
|
||||
void saveCaptureBuffer();
|
||||
String m_capture_uuid;
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user