Crashing was probably because of wrongly placed prepareToPlay call

This commit is contained in:
xenakios 2017-11-13 19:41:47 +02:00
parent d97975f27a
commit 793279a20a
3 changed files with 6 additions and 5 deletions

View File

@ -134,8 +134,9 @@ void Control::set_input_file(File file, std::function<void(String)> cb)
}; };
}; };
std::thread th(task); //std::thread th(task);
th.detach(); //th.detach();
task();
}; };
String Control::get_input_filename(){ String Control::get_input_filename(){
@ -285,13 +286,12 @@ void Control::startplay(bool /*bypass*/, bool /*realtime*/, Range<double> playra
} }
if (m_bufferingthread.isThreadRunning() == false) if (m_bufferingthread.isThreadRunning() == false)
m_bufferingthread.startThread(); m_bufferingthread.startThread();
m_buffering_source->prepareToPlay(1024, 44100.0);
m_stretch_source->setNumOutChannels(numoutchans); m_stretch_source->setNumOutChannels(numoutchans);
m_stretch_source->setFFTSize(m_fft_size_to_use); m_stretch_source->setFFTSize(m_fft_size_to_use);
update_process_parameters(); update_process_parameters();
m_last_outpos_pos = 0.0; m_last_outpos_pos = 0.0;
m_last_in_pos = playrange.getStart()*m_stretch_source->getInfileLengthSeconds(); m_last_in_pos = playrange.getStart()*m_stretch_source->getInfileLengthSeconds();
m_buffering_source->prepareToPlay(1024, 44100.0);
// sleep(100); // sleep(100);

View File

@ -37,6 +37,7 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
PaulstretchpluginAudioProcessor::~PaulstretchpluginAudioProcessor() PaulstretchpluginAudioProcessor::~PaulstretchpluginAudioProcessor()
{ {
m_control->stopplay();
} }
//============================================================================== //==============================================================================

View File

@ -84,7 +84,7 @@
headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\Program Files\VSTPlugins"/> headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\Program Files\VSTPlugins"/>
<CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="x64" <CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="x64"
debugInformationFormat="ProgramDatabase" enablePluginBinaryCopyStep="1" debugInformationFormat="ProgramDatabase" enablePluginBinaryCopyStep="1"
linkTimeOptimisation="1" isDebug="0" optimisation="3" targetName="paulstretchplugin" linkTimeOptimisation="0" isDebug="0" optimisation="3" targetName="paulstretchplugin"
headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\Program Files\VSTPlugins"/> headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\Program Files\VSTPlugins"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>