diff --git a/Source/PS_Source/PaulStretchControl.cpp b/Source/PS_Source/PaulStretchControl.cpp index a581ae3..d1528ba 100644 --- a/Source/PS_Source/PaulStretchControl.cpp +++ b/Source/PS_Source/PaulStretchControl.cpp @@ -134,8 +134,9 @@ void Control::set_input_file(File file, std::function cb) }; }; - std::thread th(task); - th.detach(); + //std::thread th(task); + //th.detach(); + task(); }; String Control::get_input_filename(){ @@ -285,13 +286,12 @@ void Control::startplay(bool /*bypass*/, bool /*realtime*/, Range playra } if (m_bufferingthread.isThreadRunning() == false) m_bufferingthread.startThread(); - m_buffering_source->prepareToPlay(1024, 44100.0); m_stretch_source->setNumOutChannels(numoutchans); m_stretch_source->setFFTSize(m_fft_size_to_use); update_process_parameters(); m_last_outpos_pos = 0.0; m_last_in_pos = playrange.getStart()*m_stretch_source->getInfileLengthSeconds(); - + m_buffering_source->prepareToPlay(1024, 44100.0); // sleep(100); diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 50cd872..e3c8603 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -37,6 +37,7 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() PaulstretchpluginAudioProcessor::~PaulstretchpluginAudioProcessor() { + m_control->stopplay(); } //============================================================================== diff --git a/paulstretchplugin.jucer b/paulstretchplugin.jucer index 58bece0..39a3023 100644 --- a/paulstretchplugin.jucer +++ b/paulstretchplugin.jucer @@ -84,7 +84,7 @@ headerPath="Source/PS_Source Source/WDL " vstBinaryLocation="C:\Program Files\VSTPlugins"/>