Browse Source

Allow host to not supply CV ports

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 3 years ago
parent
commit
fa1e6a1343
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 20 additions and 2 deletions
  1. +6
    -0
      plugins/Cardinal/src/HostCV.cpp
  2. +14
    -2
      src/CardinalPlugin.cpp

+ 6
- 0
plugins/Cardinal/src/HostCV.cpp 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;



+ 14
- 2
src/CardinalPlugin.cpp View File

@@ -1148,7 +1148,13 @@ protected:
{
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
for (int i=0; i<DISTRHO_PLUGIN_NUM_INPUTS; ++i)
std::memcpy(fAudioBufferCopy[i], inputs[i], sizeof(float)*frames);
{
#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)
std::memset(outputs[i], 0, sizeof(float)*frames);
{
#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)
{


Loading…
Cancel
Save