diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index ce0fcbe..67a4299 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -849,20 +849,21 @@ pointer_sized_int PaulstretchpluginAudioProcessor::handleVstPluginCanDo(int32 in { if (strcmp((char*)ptr, "xenakios") == 0) { - if (index == 0) + if (index == 0 && (void*)value!=nullptr) { double t0 = *getFloatParameter(cpi_soundstart); double t1 = *getFloatParameter(cpi_soundend); - m_outlen = (t1-t0)*m_stretch_source->getInfileLengthSeconds()*(*getFloatParameter(cpi_stretchamount)); - std::cout << "host requested output length, result " << m_outlen << "\n"; - return pointer_sized_int(&m_outlen); + double outlen = (t1-t0)*m_stretch_source->getInfileLengthSeconds()*(*getFloatParameter(cpi_stretchamount)); + //std::cout << "host requested output length, result " << outlen << "\n"; + *((double*)value) = outlen; } if (index == 1 && (void*)value!=nullptr) { String fn(CharPointer_UTF8((char*)value)); - std::cout << "host requested to set audio file " << fn << "\n"; + //std::cout << "host requested to set audio file " << fn << "\n"; auto err = setAudioFile(File(fn)); - std::cout << err << "\n"; + if (err.isEmpty()==false) + std::cout << err << "\n"; } return 1; } diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index bf73124..be48bc3 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -254,7 +254,6 @@ private: float m_cur_playrangeoffset = 0.0; void updateStretchParametersFromPluginParameters(ProcessParameters& pars); std::array m_sm_enab_pars; - double m_outlen = 0.0; //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) };