Allow host to not supply CV ports

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-05-17 19:48:58 +01:00
parent 946056b1fd
commit fa1e6a1343
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 20 additions and 2 deletions

View file

@ -87,6 +87,9 @@ struct HostCV : TerminalModule {
}
else if (const float* const* const dataIns = pcontext->dataIns)
{
if (dataIns[CARDINAL_AUDIO_IO_OFFSET] == nullptr)
return;
float outputOffset;
outputOffset = params[BIPOLAR_OUTPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;
@ -116,6 +119,9 @@ struct HostCV : TerminalModule {
float** const dataOuts = pcontext->dataOuts;
if (dataOuts[CARDINAL_AUDIO_IO_OFFSET] == nullptr)
return;
float inputOffset;
inputOffset = params[BIPOLAR_INPUTS_1_5].getValue() > 0.1f ? 5.0f : 0.0f;

View file

@ -1148,7 +1148,13 @@ protected:
{
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
for (int i=0; i<DISTRHO_PLUGIN_NUM_INPUTS; ++i)
{
#if CARDINAL_VARIANT_MAIN
// can be null on main variant
if (inputs[i] != nullptr)
#endif
std::memcpy(fAudioBufferCopy[i], inputs[i], sizeof(float)*frames);
}
context->dataIns = fAudioBufferCopy;
#else
context->dataIns = nullptr;
@ -1157,7 +1163,13 @@ protected:
}
for (int i=0; i<DISTRHO_PLUGIN_NUM_OUTPUTS; ++i)
{
#if CARDINAL_VARIANT_MAIN
// can be null on main variant
if (outputs[i] != nullptr)
#endif
std::memset(outputs[i], 0, sizeof(float)*frames);
}
if (bypassed)
{