diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 50753ee..7b2b977 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -145,6 +145,7 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() m_outchansparam = new AudioParameterInt("numoutchans0", "Num output channels", 2, 8, 2); // 27 addParameter(m_outchansparam); // 27 addParameter(new AudioParameterBool("pause_enabled0", "Pause", false)); // 28 + addParameter(new AudioParameterFloat("maxcapturelen_0", "Max capture length", 1.0f, 120.0f, 10.0f)); // 29 startTimer(1, 50); } @@ -576,6 +577,11 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id) if (id == 1) { bool capture = getParameter(cpi_capture_enabled); + if (capture == false && m_max_reclen != *getFloatParameter(cpi_max_capture_len)) + { + m_max_reclen = *getFloatParameter(cpi_max_capture_len); + //Logger::writeToLog("Changing max capture len to " + String(m_max_reclen)); + } if (capture == true && m_is_recording == false) { setRecordingEnabled(true); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 81a39de..b5bbedb 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -54,6 +54,7 @@ const int cpi_onsetdetection = 25; const int cpi_capture_enabled = 26; const int cpi_num_outchans = 27; const int cpi_pause_enabled = 28; +const int cpi_max_capture_len = 29; class PaulstretchpluginAudioProcessor : public AudioProcessor, public MultiTimer {