From 52ebb38415b8ddd7ef6773428f3652e919275474 Mon Sep 17 00:00:00 2001 From: xenakios Date: Sat, 24 Mar 2018 01:01:40 +0200 Subject: [PATCH] Attempt to provide extra data for a special host, not working like this --- Source/PluginEditor.cpp | 3 ++- Source/PluginProcessor.cpp | 14 ++++++++++++++ Source/PluginProcessor.h | 7 ++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index a0d99e3..bc8f230 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -328,7 +328,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) } infotext += m_last_err + " [FFT size " + String(processor.getStretchSource()->getFFTSize())+"]"; - double outlen = processor.getStretchSource()->getOutputDurationSecondsForRange(processor.getStretchSource()->getPlayRange(), processor.getStretchSource()->getFFTSize()); + double outlen = processor.getStretchSource()->getOutputDurationSecondsForRange(processor.getStretchSource()->getPlayRange(), + processor.getStretchSource()->getFFTSize()); infotext += " [Output length " + secondsToString2(outlen)+"]"; if (processor.m_abnormal_output_samples > 0) infotext += " " + String(processor.m_abnormal_output_samples) + " invalid sample values"; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 7c0f239..b3106a3 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -67,6 +67,7 @@ inline AudioParameterFloat* make_floatpar(String id, String name, float minv, fl PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() : m_bufferingthread("pspluginprebufferthread") { + getProperties().set("isgenerator", true); g_activeprocessors.insert(this); m_playposinfo.timeInSeconds = 0.0; @@ -579,6 +580,16 @@ void copyAudioBufferWrappingPosition(const AudioBuffer& src, AudioBuffer< } } +pointer_sized_int PaulstretchpluginAudioProcessor::handleVstManufacturerSpecific(int32 index, pointer_sized_int value, void * ptr, float opt) +{ + if (index == 10000) + { + *((double*)(ptr)) = 6.66; + return 1; + } + return pointer_sized_int(); +} + void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) { ScopedLock locker(m_cs); @@ -783,6 +794,9 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id) { if (id == 1) { + double outlen = m_stretch_source->getOutputDurationSecondsForRange(m_stretch_source->getPlayRange(), + m_stretch_source->getFFTSize()); + getProperties().set("outputlength", outlen); bool capture = getParameter(cpi_capture_enabled); if (capture == false && m_max_reclen != *getFloatParameter(cpi_max_capture_len)) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 4bc2e30..9476695 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -104,7 +104,7 @@ public: class PaulstretchpluginAudioProcessorEditor; class PaulstretchpluginAudioProcessor : public AudioProcessor, - public MultiTimer + public MultiTimer, public VSTCallbackHandler { public: using EditorType = PaulstretchpluginAudioProcessorEditor; @@ -119,6 +119,11 @@ public: bool isBusesLayoutSupported (const BusesLayout& layouts) const override; #endif + pointer_sized_int handleVstManufacturerSpecific(int32 index, + pointer_sized_int value, + void* ptr, + float opt) override; + void processBlock (AudioSampleBuffer&, MidiBuffer&) override; //==============================================================================