| @@ -299,9 +299,7 @@ class CardinalPlugin : public CardinalBasePlugin | |||||
| { | { | ||||
| SharedResourcePointer<Initializer> fInitializer; | SharedResourcePointer<Initializer> fInitializer; | ||||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||||
| float* fAudioBufferIn; | float* fAudioBufferIn; | ||||
| #endif | |||||
| float* fAudioBufferOut; | float* fAudioBufferOut; | ||||
| std::string fAutosavePath; | std::string fAutosavePath; | ||||
| String fWindowSize; | String fWindowSize; | ||||
| @@ -321,9 +319,7 @@ public: | |||||
| CardinalPlugin() | CardinalPlugin() | ||||
| : CardinalBasePlugin(kModuleParameters + kWindowParameterCount, 0, 2), | : CardinalBasePlugin(kModuleParameters + kWindowParameterCount, 0, 2), | ||||
| fInitializer(this), | fInitializer(this), | ||||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||||
| fAudioBufferIn(nullptr), | fAudioBufferIn(nullptr), | ||||
| #endif | |||||
| fAudioBufferOut(nullptr), | fAudioBufferOut(nullptr), | ||||
| fIsActive(false), | fIsActive(false), | ||||
| fCurrentAudioDevice(nullptr), | fCurrentAudioDevice(nullptr), | ||||
| @@ -786,10 +782,10 @@ protected: | |||||
| { | { | ||||
| const uint32_t bufferSize = getBufferSize(); | const uint32_t bufferSize = getBufferSize(); | ||||
| fAudioBufferOut = new float[bufferSize * DISTRHO_PLUGIN_NUM_OUTPUTS]; | 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; | fPreviousFrame = 0; | ||||
| @@ -818,10 +814,8 @@ protected: | |||||
| delete[] fAudioBufferOut; | delete[] fAudioBufferOut; | ||||
| fAudioBufferOut = nullptr; | fAudioBufferOut = nullptr; | ||||
| #if DISTRHO_PLUGIN_NUM_INPUTS != 0 | |||||
| delete[] fAudioBufferIn; | delete[] fAudioBufferIn; | ||||
| fAudioBufferIn = nullptr; | fAudioBufferIn = nullptr; | ||||
| #endif | |||||
| } | } | ||||
| void run(const float** const inputs, float** const outputs, const uint32_t frames, | void run(const float** const inputs, float** const outputs, const uint32_t frames, | ||||
| @@ -872,6 +866,9 @@ protected: | |||||
| fAudioBufferIn[j++] = inputs[1][i]; | fAudioBufferIn[j++] = inputs[1][i]; | ||||
| } | } | ||||
| fCurrentAudioDevice->processInput(fAudioBufferIn, 2, frames); | fCurrentAudioDevice->processInput(fAudioBufferIn, 2, frames); | ||||
| #else | |||||
| std::memset(fAudioBufferIn, 0, sizeof(float)*frames); | |||||
| fCurrentAudioDevice->processInput(fAudioBufferIn, 1, frames); | |||||
| #endif | #endif | ||||
| } | } | ||||