Clean up extra opcode stuff

This commit is contained in:
xenakios 2018-04-26 14:01:46 +03:00
parent 2d493d6d81
commit cf27d43705
2 changed files with 7 additions and 7 deletions

View File

@ -849,20 +849,21 @@ pointer_sized_int PaulstretchpluginAudioProcessor::handleVstPluginCanDo(int32 in
{ {
if (strcmp((char*)ptr, "xenakios") == 0) if (strcmp((char*)ptr, "xenakios") == 0)
{ {
if (index == 0) if (index == 0 && (void*)value!=nullptr)
{ {
double t0 = *getFloatParameter(cpi_soundstart); double t0 = *getFloatParameter(cpi_soundstart);
double t1 = *getFloatParameter(cpi_soundend); double t1 = *getFloatParameter(cpi_soundend);
m_outlen = (t1-t0)*m_stretch_source->getInfileLengthSeconds()*(*getFloatParameter(cpi_stretchamount)); double outlen = (t1-t0)*m_stretch_source->getInfileLengthSeconds()*(*getFloatParameter(cpi_stretchamount));
std::cout << "host requested output length, result " << m_outlen << "\n"; //std::cout << "host requested output length, result " << outlen << "\n";
return pointer_sized_int(&m_outlen); *((double*)value) = outlen;
} }
if (index == 1 && (void*)value!=nullptr) if (index == 1 && (void*)value!=nullptr)
{ {
String fn(CharPointer_UTF8((char*)value)); 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)); auto err = setAudioFile(File(fn));
std::cout << err << "\n"; if (err.isEmpty()==false)
std::cout << err << "\n";
} }
return 1; return 1;
} }

View File

@ -254,7 +254,6 @@ private:
float m_cur_playrangeoffset = 0.0; float m_cur_playrangeoffset = 0.0;
void updateStretchParametersFromPluginParameters(ProcessParameters& pars); void updateStretchParametersFromPluginParameters(ProcessParameters& pars);
std::array<AudioParameterBool*, 9> m_sm_enab_pars; std::array<AudioParameterBool*, 9> m_sm_enab_pars;
double m_outlen = 0.0;
//============================================================================== //==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)
}; };