Add support for some custom VST opcodes

This commit is contained in:
xenakios
2018-04-25 15:25:29 +03:00
parent 2f3a526291
commit 2d493d6d81
2 changed files with 42 additions and 1 deletions

View File

@ -845,6 +845,36 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id)
}
}
pointer_sized_int PaulstretchpluginAudioProcessor::handleVstPluginCanDo(int32 index, pointer_sized_int value, void * ptr, float opt)
{
if (strcmp((char*)ptr, "xenakios") == 0)
{
if (index == 0)
{
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);
}
if (index == 1 && (void*)value!=nullptr)
{
String fn(CharPointer_UTF8((char*)value));
std::cout << "host requested to set audio file " << fn << "\n";
auto err = setAudioFile(File(fn));
std::cout << err << "\n";
}
return 1;
}
return pointer_sized_int();
}
pointer_sized_int PaulstretchpluginAudioProcessor::handleVstManufacturerSpecific(int32 index, pointer_sized_int value, void * ptr, float opt)
{
return pointer_sized_int();
}
void PaulstretchpluginAudioProcessor::finishRecording(int lenrecording)
{
m_is_recording = false;