Added parameter for max capture length

This commit is contained in:
xenakios 2017-12-18 19:48:40 +02:00
parent f3d769504d
commit 8c9749a90c
2 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -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
{