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;
|
return kResultFalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processSetup.symbolicSampleSize == Vst::kSample32) processAudio<float> (data, channelListFloat);
|
// If all of these are zero, the host is attempting to flush parameters without processing audio.
|
||||||
else if (processSetup.symbolicSampleSize == Vst::kSample64) processAudio<double> (data, channelListDouble);
|
if (data.numSamples != 0 || data.numInputs != 0 || data.numOutputs != 0)
|
||||||
else jassertfalse;
|
{
|
||||||
|
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 JucePlugin_ProducesMidiOutput
|
||||||
if (isMidiOutputBusEnabled && data.outputEvents != nullptr)
|
if (isMidiOutputBusEnabled && data.outputEvents != nullptr)
|
||||||
|
|
@ -3381,20 +3399,6 @@ private:
|
||||||
jassert (midiBuffer.getNumEvents() <= numMidiEventsComingIn);
|
jassert (midiBuffer.getNumEvents() <= numMidiEventsComingIn);
|
||||||
#endif
|
#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