diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 2b5d292..1c972eb 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -186,7 +186,9 @@ void PaulstretchpluginAudioProcessorEditor::addAudioBlock(AudioBuffer& bu void PaulstretchpluginAudioProcessorEditor::chooseFile() { - File initialloc = File::getSpecialLocation(File::userHomeDirectory); + String initiallocfn = processor.m_propsfile->m_props_file->getValue("importfilefolder", + File::getSpecialLocation(File::userHomeDirectory).getFullPathName()); + File initialloc(initiallocfn); String filterstring = processor.m_afm->getWildcardForAllFormats(); FileChooser myChooser("Please select audio file...", initialloc, @@ -200,6 +202,7 @@ void PaulstretchpluginAudioProcessorEditor::chooseFile() pathname = pathname.substring(10); resu = File(pathname); } + processor.m_propsfile->m_props_file->setValue("importfilefolder", resu.getParentDirectory().getFullPathName()); m_last_err = processor.setAudioFile(resu); if (processor.getAudioFile() != File()) { diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index a3f872b..b3f9066 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -82,7 +82,8 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() ) #endif { - g_activeprocessors.insert(this); + + g_activeprocessors.insert(this); m_recbuffer.setSize(2, 44100); m_recbuffer.clear(); if (m_afm->getNumKnownFormats()==0) diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 3ae0550..74c9a5f 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -56,6 +56,29 @@ const int cpi_num_outchans = 27; const int cpi_pause_enabled = 28; const int cpi_max_capture_len = 29; +class MyPropertiesFile +{ +public: + MyPropertiesFile() + { + + PropertiesFile::Options poptions; + poptions.applicationName = "PaulXStretch3"; + poptions.folderName = "PaulXStretch3"; + poptions.commonToAllUsers = false; + poptions.doNotSave = false; + poptions.storageFormat = PropertiesFile::storeAsXML; + poptions.millisecondsBeforeSaving = 1000; + poptions.ignoreCaseOfKeyNames = false; + poptions.processLock = nullptr; + poptions.filenameSuffix = ".xml"; + poptions.osxLibrarySubFolder = "Application Support"; + m_props_file = std::make_unique(poptions); + + } + std::unique_ptr m_props_file; +}; + class PaulstretchpluginAudioProcessor : public AudioProcessor, public MultiTimer { public: @@ -106,6 +129,7 @@ public: File getAudioFile() { return m_current_file; } Range getTimeSelection(); SharedResourcePointer m_afm; + SharedResourcePointer m_propsfile; StretchAudioSource* getStretchSource() { return m_stretch_source.get(); } double getPreBufferingPercent(); void timerCallback(int id) override;