|
@@ -192,13 +192,13 @@ void PaulstretchpluginAudioProcessor::setPreBufferAmount(int x) |
|
|
m_prebuffer_amount = temp; |
|
|
m_prebuffer_amount = temp; |
|
|
m_recreate_buffering_source = true; |
|
|
m_recreate_buffering_source = true; |
|
|
ScopedLock locker(m_cs); |
|
|
ScopedLock locker(m_cs); |
|
|
m_ready_to_play = false; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = false; |
|
|
m_cur_num_out_chans = *m_outchansparam; |
|
|
m_cur_num_out_chans = *m_outchansparam; |
|
|
//Logger::writeToLog("Switching to use " + String(m_cur_num_out_chans) + " out channels"); |
|
|
//Logger::writeToLog("Switching to use " + String(m_cur_num_out_chans) + " out channels"); |
|
|
String err; |
|
|
String err; |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
m_cur_num_out_chans, m_curmaxblocksize, err); |
|
|
m_cur_num_out_chans, m_curmaxblocksize, err); |
|
|
m_ready_to_play = true; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -321,7 +321,7 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl |
|
|
m_input_buffer.setSize(2, samplesPerBlock); |
|
|
m_input_buffer.setSize(2, samplesPerBlock); |
|
|
int numoutchans = *m_outchansparam; |
|
|
int numoutchans = *m_outchansparam; |
|
|
if (numoutchans != m_cur_num_out_chans) |
|
|
if (numoutchans != m_cur_num_out_chans) |
|
|
m_ready_to_play = false; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = false; |
|
|
if (m_using_memory_buffer == true) |
|
|
if (m_using_memory_buffer == true) |
|
|
{ |
|
|
{ |
|
|
int len = jlimit(100,m_recbuffer.getNumSamples(), |
|
|
int len = jlimit(100,m_recbuffer.getNumSamples(), |
|
@@ -331,7 +331,7 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl |
|
|
len); |
|
|
len); |
|
|
callGUI(this,[this,len](auto ed) { ed->setAudioBuffer(&m_recbuffer, getSampleRateChecked(), len); },false); |
|
|
callGUI(this,[this,len](auto ed) { ed->setAudioBuffer(&m_recbuffer, getSampleRateChecked(), len); },false); |
|
|
} |
|
|
} |
|
|
if (m_ready_to_play == false) |
|
|
|
|
|
|
|
|
if (m_prebuffering_inited == false) |
|
|
{ |
|
|
{ |
|
|
setFFTSize(*getFloatParameter(cpi_fftsize)); |
|
|
setFFTSize(*getFloatParameter(cpi_fftsize)); |
|
|
m_stretch_source->setProcessParameters(&m_ppar); |
|
|
m_stretch_source->setProcessParameters(&m_ppar); |
|
@@ -340,9 +340,12 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
numoutchans, samplesPerBlock, err); |
|
|
numoutchans, samplesPerBlock, err); |
|
|
m_cur_num_out_chans = numoutchans; |
|
|
m_cur_num_out_chans = numoutchans; |
|
|
m_ready_to_play = true; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = true; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
m_buffering_source->prepareToPlay(samplesPerBlock, getSampleRateChecked()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void PaulstretchpluginAudioProcessor::releaseResources() |
|
|
void PaulstretchpluginAudioProcessor::releaseResources() |
|
@@ -412,7 +415,7 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M |
|
|
m_input_buffer.copyFrom(i, 0, buffer, i, 0, buffer.getNumSamples()); |
|
|
m_input_buffer.copyFrom(i, 0, buffer, i, 0, buffer.getNumSamples()); |
|
|
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i) |
|
|
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i) |
|
|
buffer.clear (i, 0, buffer.getNumSamples()); |
|
|
buffer.clear (i, 0, buffer.getNumSamples()); |
|
|
if (m_ready_to_play == false) |
|
|
|
|
|
|
|
|
if (m_prebuffering_inited == false) |
|
|
return; |
|
|
return; |
|
|
if (m_is_recording == true) |
|
|
if (m_is_recording == true) |
|
|
{ |
|
|
{ |
|
@@ -698,13 +701,13 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id) |
|
|
{ |
|
|
{ |
|
|
jassert(m_curmaxblocksize > 0); |
|
|
jassert(m_curmaxblocksize > 0); |
|
|
ScopedLock locker(m_cs); |
|
|
ScopedLock locker(m_cs); |
|
|
m_ready_to_play = false; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = false; |
|
|
m_cur_num_out_chans = *m_outchansparam; |
|
|
m_cur_num_out_chans = *m_outchansparam; |
|
|
//Logger::writeToLog("Switching to use " + String(m_cur_num_out_chans) + " out channels"); |
|
|
//Logger::writeToLog("Switching to use " + String(m_cur_num_out_chans) + " out channels"); |
|
|
String err; |
|
|
String err; |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, |
|
|
m_cur_num_out_chans, m_curmaxblocksize, err); |
|
|
m_cur_num_out_chans, m_curmaxblocksize, err); |
|
|
m_ready_to_play = true; |
|
|
|
|
|
|
|
|
m_prebuffering_inited = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|