diff options
author | falkTX <falktx@gmail.com> | 2019-01-24 14:56:48 +0000 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2019-01-24 14:56:48 +0000 |
commit | 66f86f6d1d4178a60bdf12fa8b7a10fa45d7a670 (patch) | |
tree | 45b5738ac9b5efcee4e58b56671c5c372623a03d | |
parent | c80050fe016b19b14af612a3844b85bfa71c8d67 (diff) |
AU: initialize buffer size and rate with AU defaults
-rw-r--r-- | distrho/src/DistrhoPluginAU.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/distrho/src/DistrhoPluginAU.cpp b/distrho/src/DistrhoPluginAU.cpp index 933d0a92..6199f5bb 100644 --- a/distrho/src/DistrhoPluginAU.cpp +++ b/distrho/src/DistrhoPluginAU.cpp @@ -27,6 +27,19 @@ static const writeMidiFunc writeMidiCallback = nullptr; // #endif // ----------------------------------------------------------------------- + +struct LastValuesInit { + LastValuesInit() + { + if (d_lastBufferSize == 0) + d_lastBufferSize = kAUDefaultMaxFramesPerSlice; + + if (d_isZero(d_lastSampleRate)) + d_lastSampleRate = kAUDefaultSampleRate; + }; +}; + +// ----------------------------------------------------------------------- // AU Plugin class PluginAU : public AUEffectBase @@ -34,6 +47,7 @@ class PluginAU : public AUEffectBase public: PluginAU(AudioUnit component) : AUEffectBase(component), + fLastValuesInit(), fPlugin(this, writeMidiCallback) { CreateElements(); @@ -172,6 +186,7 @@ public: // ------------------------------------------------------------------- private: + LastValuesInit fLastValuesInit; PluginExporter fPlugin; // most of the real work happens here |