Fix main module audio/cv usage
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
59006c3797
commit
b15e5ede6c
6 changed files with 30 additions and 39 deletions
|
@ -40,4 +40,7 @@
|
|||
// #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:AnalyserPlugin"
|
||||
// #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer"
|
||||
|
||||
#define CARDINAL_NUM_AUDIO_INPUTS 8
|
||||
#define CARDINAL_NUM_AUDIO_OUTPUTS 8
|
||||
|
||||
#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED
|
||||
|
|
|
@ -40,4 +40,7 @@
|
|||
// #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:AnalyserPlugin"
|
||||
// #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer"
|
||||
|
||||
#define CARDINAL_NUM_AUDIO_INPUTS DISTRHO_PLUGIN_NUM_INPUTS
|
||||
#define CARDINAL_NUM_AUDIO_OUTPUTS DISTRHO_PLUGIN_NUM_OUTPUTS
|
||||
|
||||
#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED
|
||||
|
|
|
@ -942,20 +942,18 @@ protected:
|
|||
|
||||
if (fCurrentAudioDevice != nullptr)
|
||||
{
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
#if CARDINAL_NUM_AUDIO_INPUTS != 0
|
||||
for (uint32_t i=0, j=0; i<frames; ++i)
|
||||
{
|
||||
fAudioBufferIn[j++] = inputs[0][i];
|
||||
fAudioBufferIn[j++] = inputs[1][i];
|
||||
}
|
||||
fCurrentAudioDevice->processInput(fAudioBufferIn, 2, frames);
|
||||
for (uint32_t k=0; k<CARDINAL_NUM_AUDIO_INPUTS; ++k)
|
||||
fAudioBufferIn[j++] = inputs[k][i];
|
||||
fCurrentAudioDevice->processInput(fAudioBufferIn, CARDINAL_NUM_AUDIO_INPUTS, frames);
|
||||
#else
|
||||
std::memset(fAudioBufferIn, 0, sizeof(float)*frames);
|
||||
fCurrentAudioDevice->processInput(fAudioBufferIn, 1, frames);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if DISTRHO_PLUGIN_NUM_OUTPUTS != 2
|
||||
#if CARDINAL_NUM_AUDIO_OUTPUTS != 2
|
||||
context->dataFrame = 0;
|
||||
context->dataIns = inputs;
|
||||
context->dataOuts = outputs;
|
||||
|
@ -965,19 +963,17 @@ protected:
|
|||
|
||||
if (fCurrentAudioDevice != nullptr)
|
||||
{
|
||||
std::memset(fAudioBufferOut, 0, sizeof(float)*frames*2);
|
||||
fCurrentAudioDevice->processOutput(fAudioBufferOut, 2, frames);
|
||||
std::memset(fAudioBufferOut, 0, sizeof(float)*frames*CARDINAL_NUM_AUDIO_OUTPUTS);
|
||||
fCurrentAudioDevice->processOutput(fAudioBufferOut, CARDINAL_NUM_AUDIO_OUTPUTS, frames);
|
||||
|
||||
for (uint32_t i=0, j=0; i<frames; ++i)
|
||||
{
|
||||
outputs[0][i] = fAudioBufferOut[j++];
|
||||
outputs[1][i] = fAudioBufferOut[j++];
|
||||
}
|
||||
for (uint32_t k=0; k<CARDINAL_NUM_AUDIO_OUTPUTS; ++k)
|
||||
outputs[k][i] = fAudioBufferOut[j++];
|
||||
}
|
||||
else
|
||||
{
|
||||
std::memset(outputs[0], 0, sizeof(float)*frames);
|
||||
std::memset(outputs[1], 0, sizeof(float)*frames);
|
||||
for (uint32_t k=0; k<CARDINAL_NUM_AUDIO_OUTPUTS; ++k)
|
||||
std::memset(outputs[k], 0, sizeof(float)*frames);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,4 +39,7 @@
|
|||
#define DISTRHO_PLUGIN_WANT_STATE 1
|
||||
#define DISTRHO_PLUGIN_WANT_TIMEPOS 1
|
||||
|
||||
#define CARDINAL_NUM_AUDIO_INPUTS DISTRHO_PLUGIN_NUM_INPUTS
|
||||
#define CARDINAL_NUM_AUDIO_OUTPUTS DISTRHO_PLUGIN_NUM_OUTPUTS
|
||||
|
||||
#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED
|
||||
|
|
|
@ -37,20 +37,12 @@ struct CardinalAudioDevice : rack::audio::Device
|
|||
|
||||
int getNumInputs() override
|
||||
{
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS > 10
|
||||
return DISTRHO_PLUGIN_NUM_INPUTS - 10;
|
||||
#else
|
||||
return std::min(2, DISTRHO_PLUGIN_NUM_INPUTS);
|
||||
#endif
|
||||
return CARDINAL_NUM_AUDIO_INPUTS;
|
||||
}
|
||||
|
||||
int getNumOutputs() override
|
||||
{
|
||||
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 10
|
||||
return DISTRHO_PLUGIN_NUM_OUTPUTS - 10;
|
||||
#else
|
||||
return std::min(2, DISTRHO_PLUGIN_NUM_OUTPUTS);
|
||||
#endif
|
||||
return CARDINAL_NUM_AUDIO_OUTPUTS;
|
||||
}
|
||||
|
||||
int getBlockSize() override
|
||||
|
@ -117,20 +109,12 @@ struct CardinalAudioDriver : rack::audio::Driver
|
|||
|
||||
int getDeviceNumInputs(int) override
|
||||
{
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS > 10
|
||||
return DISTRHO_PLUGIN_NUM_INPUTS - 10;
|
||||
#else
|
||||
return std::min(2, DISTRHO_PLUGIN_NUM_INPUTS);
|
||||
#endif
|
||||
return CARDINAL_NUM_AUDIO_INPUTS;
|
||||
}
|
||||
|
||||
int getDeviceNumOutputs(int) override
|
||||
{
|
||||
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 10
|
||||
return DISTRHO_PLUGIN_NUM_OUTPUTS - 10;
|
||||
#else
|
||||
return std::min(2, DISTRHO_PLUGIN_NUM_OUTPUTS);
|
||||
#endif
|
||||
return CARDINAL_NUM_AUDIO_OUTPUTS;
|
||||
}
|
||||
|
||||
rack::audio::Device* subscribe(int, rack::audio::Port* const port) override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue