Try adding parameter to open the import file dialog, but now working right at the moment

This commit is contained in:
xenakios
2018-03-03 22:19:02 +02:00
parent 9a17b7b6c6
commit 47bf763408
4 changed files with 19 additions and 1 deletions

View File

@ -157,6 +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
auto& pars = getParameters();
for (const auto& p : pars)
m_reset_pars.push_back(p->getValue());
@ -794,6 +795,18 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id)
{
if (id == 1)
{
if (*getBoolParameter(cpi_import_file)==true)
{
*getBoolParameter(cpi_import_file) = false;
if (m_import_dlg_open == 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))
{