Browse Source

AU: initialize buffer size and rate with AU defaults

pull/116/head
falkTX 7 years ago
parent
commit
66f86f6d1d
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      distrho/src/DistrhoPluginAU.cpp

+ 15
- 0
distrho/src/DistrhoPluginAU.cpp View File

@@ -26,6 +26,19 @@ START_NAMESPACE_DISTRHO
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

@@ -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


Loading…
Cancel
Save