diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 12cb419..8372616 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -354,6 +354,7 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) } if (id == 3) { + m_spec_order_ed.setModuleSelected(*processor.getIntParameter(cpi_select_spec_module)); processor.m_free_filter_envelope->updateMinMaxValues(); m_free_filter_component.repaint(); } @@ -383,7 +384,6 @@ void PaulstretchpluginAudioProcessorEditor::filesDropped(const StringArray & fil void PaulstretchpluginAudioProcessorEditor::chooseFile() { - toFront(true); String initiallocfn = processor.m_propsfile->m_props_file->getValue("importfilefolder", File::getSpecialLocation(File::userHomeDirectory).getFullPathName()); File initialloc(initiallocfn); @@ -403,7 +403,7 @@ void PaulstretchpluginAudioProcessorEditor::chooseFile() processor.m_propsfile->m_props_file->setValue("importfilefolder", resu.getParentDirectory().getFullPathName()); m_last_err = processor.setAudioFile(resu); } - processor.m_import_dlg_open = false; + } void PaulstretchpluginAudioProcessorEditor::showSettingsMenu() @@ -971,6 +971,15 @@ void SpectralChainEditor::mouseUp(const MouseEvent & ev) repaint(); } +void SpectralChainEditor::setModuleSelected(int id) +{ + if (id != m_cur_index) + { + m_cur_index = id; + repaint(); + } +} + void SpectralChainEditor::drawBox(Graphics & g, int index, int x, int y, int w, int h) { String txt; diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index fb9fe37..5df5959 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -196,6 +196,7 @@ public: std::function ModuleSelectedCallback; std::function ModuleOrderOrEnabledChangedCallback; const std::vector & getOrder() const { return m_order; } + void setModuleSelected(int id); private: StretchAudioSource * m_src = nullptr; bool m_did_drag = false; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 93fcdc1..0bad542 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -157,7 +157,7 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() addParameter(new AudioParameterInt("freefilter_randomybands0", "Random bands", 2, 128, 16)); // 38 addParameter(new AudioParameterInt("freefilter_randomyrate0", "Random rate", 1, 32, 2)); // 39 addParameter(new AudioParameterFloat("freefilter_randomyamount0", "Random amount", 0.0, 1.0, 0.0)); // 40 - addParameter(new AudioParameterBool("importfiletrigger0", "Import file", false)); // 41 + addParameter(new AudioParameterInt("select_specmodule0", "Select module", 0, 8, 1)); // 41 auto& pars = getParameters(); for (const auto& p : pars) m_reset_pars.push_back(p->getValue()); @@ -795,18 +795,6 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id) { if (id == 1) { - if (*getBoolParameter(cpi_import_file)==true && m_import_dlg_open == false) - { - m_import_dlg_open = true; - *getBoolParameter(cpi_import_file) = false; - { - callGUI(this, [](PaulstretchpluginAudioProcessorEditor* ed) - { - ed->chooseFile(); - }, true); - return; - } - } bool capture = getParameter(cpi_capture_enabled); if (capture == false && m_max_reclen != *getFloatParameter(cpi_max_capture_len)) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 558dad2..8a818f4 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -67,7 +67,7 @@ const int cpi_freefilter_tilty = 37; const int cpi_freefilter_randomy_numbands = 38; const int cpi_freefilter_randomy_rate = 39; const int cpi_freefilter_randomy_amount = 40; -const int cpi_import_file = 41; +const int cpi_select_spec_module = 41; class MyPropertiesFile {