mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
VST3 Wrapper: Avoid calling processBlock when there is no audio input/output
This commit is contained in:
parent
df206371ff
commit
bd52350c00
1 changed files with 21 additions and 17 deletions
|
|
@ -3155,9 +3155,27 @@ public:
|
|||
return kResultFalse;
|
||||
}
|
||||
|
||||
if (processSetup.symbolicSampleSize == Vst::kSample32) processAudio<float> (data, channelListFloat);
|
||||
else if (processSetup.symbolicSampleSize == Vst::kSample64) processAudio<double> (data, channelListDouble);
|
||||
else jassertfalse;
|
||||
// If all of these are zero, the host is attempting to flush parameters without processing audio.
|
||||
if (data.numSamples != 0 || data.numInputs != 0 || data.numOutputs != 0)
|
||||
{
|
||||
if (processSetup.symbolicSampleSize == Vst::kSample32) processAudio<float> (data, channelListFloat);
|
||||
else if (processSetup.symbolicSampleSize == Vst::kSample64) processAudio<double> (data, channelListDouble);
|
||||
else jassertfalse;
|
||||
}
|
||||
|
||||
if (auto* changes = data.outputParameterChanges)
|
||||
{
|
||||
comPluginInstance->forAllChangedParameters ([&] (Vst::ParamID paramID, float value)
|
||||
{
|
||||
Steinberg::int32 queueIndex = 0;
|
||||
|
||||
if (auto* queue = changes->addParameterData (paramID, queueIndex))
|
||||
{
|
||||
Steinberg::int32 pointIndex = 0;
|
||||
queue->addPoint (0, value, pointIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#if JucePlugin_ProducesMidiOutput
|
||||
if (isMidiOutputBusEnabled && data.outputEvents != nullptr)
|
||||
|
|
@ -3381,20 +3399,6 @@ private:
|
|||
jassert (midiBuffer.getNumEvents() <= numMidiEventsComingIn);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (auto* changes = data.outputParameterChanges)
|
||||
{
|
||||
comPluginInstance->forAllChangedParameters ([&] (Vst::ParamID paramID, float value)
|
||||
{
|
||||
Steinberg::int32 queueIndex = 0;
|
||||
|
||||
if (auto* queue = changes->addParameterData (paramID, queueIndex))
|
||||
{
|
||||
Steinberg::int32 pointIndex = 0;
|
||||
queue->addPoint (0, value, pointIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue