Fix CardinalSynth after latest changes, give empty buffer to input
This commit is contained in:
parent
694ac13bd6
commit
87675ff4e3
1 changed files with 7 additions and 10 deletions
|
@ -299,9 +299,7 @@ class CardinalPlugin : public CardinalBasePlugin
|
|||
{
|
||||
SharedResourcePointer<Initializer> fInitializer;
|
||||
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
float* fAudioBufferIn;
|
||||
#endif
|
||||
float* fAudioBufferOut;
|
||||
std::string fAutosavePath;
|
||||
String fWindowSize;
|
||||
|
@ -321,9 +319,7 @@ public:
|
|||
CardinalPlugin()
|
||||
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount, 0, 2),
|
||||
fInitializer(this),
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
fAudioBufferIn(nullptr),
|
||||
#endif
|
||||
fAudioBufferOut(nullptr),
|
||||
fIsActive(false),
|
||||
fCurrentAudioDevice(nullptr),
|
||||
|
@ -786,10 +782,10 @@ protected:
|
|||
{
|
||||
const uint32_t bufferSize = getBufferSize();
|
||||
fAudioBufferOut = new float[bufferSize * DISTRHO_PLUGIN_NUM_OUTPUTS];
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
fAudioBufferIn = new float[bufferSize * DISTRHO_PLUGIN_NUM_INPUTS];
|
||||
std::memset(fAudioBufferIn, 0, sizeof(float)*bufferSize * DISTRHO_PLUGIN_NUM_INPUTS);
|
||||
#endif
|
||||
|
||||
const uint32_t numInputs = std::max(1, DISTRHO_PLUGIN_NUM_INPUTS);
|
||||
fAudioBufferIn = new float[bufferSize * numInputs];
|
||||
std::memset(fAudioBufferIn, 0, sizeof(float)*bufferSize * numInputs);
|
||||
|
||||
fPreviousFrame = 0;
|
||||
|
||||
|
@ -818,10 +814,8 @@ protected:
|
|||
|
||||
delete[] fAudioBufferOut;
|
||||
fAudioBufferOut = nullptr;
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
delete[] fAudioBufferIn;
|
||||
fAudioBufferIn = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
void run(const float** const inputs, float** const outputs, const uint32_t frames,
|
||||
|
@ -872,6 +866,9 @@ protected:
|
|||
fAudioBufferIn[j++] = inputs[1][i];
|
||||
}
|
||||
fCurrentAudioDevice->processInput(fAudioBufferIn, 2, frames);
|
||||
#else
|
||||
std::memset(fAudioBufferIn, 0, sizeof(float)*frames);
|
||||
fCurrentAudioDevice->processInput(fAudioBufferIn, 1, frames);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue