summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2019-01-29 21:14:01 +1000
committerFilipe Coelho <falktx@falktx.com>2019-01-29 12:14:01 +0100
commit3176b34ebedc15d74ca8fd5537e318aff8874697 (patch)
treee5deb229e0051069d3b65d4aeeb384f34ace4863
parent50ccb7e0f4447d66e61883bcd6b2f147de03f7a2 (diff)
Au fixes4 (#121)
* Update sample rate from AU * Fix resid, it is uint16 and not a string
-rw-r--r--distrho/src/DistrhoPluginAU.cpp9
-rw-r--r--distrho/src/DistrhoPluginAUexport.cpp7
2 files changed, 12 insertions, 4 deletions
diff --git a/distrho/src/DistrhoPluginAU.cpp b/distrho/src/DistrhoPluginAU.cpp
index 9fad0e75..d18e1eb4 100644
--- a/distrho/src/DistrhoPluginAU.cpp
+++ b/distrho/src/DistrhoPluginAU.cpp
@@ -221,6 +221,8 @@ protected:
destBuffer[i] = (float *)outBuffer.mBuffers[i].mData;
}
+ updateSampleRate();
+
updateParameterInputs();
fPlugin.run(srcBuffer, destBuffer, inFramesToProcess);
@@ -241,6 +243,8 @@ protected:
if ((err = AUEffectBase::Initialize()) != noErr)
return err;
+ updateSampleRate();
+
fPlugin.activate();
// FIXME this does not seem right
@@ -312,6 +316,11 @@ private:
}
}
+ void updateSampleRate()
+ {
+ d_lastSampleRate = GetSampleRate();
+ }
+
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginAU)
};
diff --git a/distrho/src/DistrhoPluginAUexport.cpp b/distrho/src/DistrhoPluginAUexport.cpp
index e60f1ba1..1b2d0cd0 100644
--- a/distrho/src/DistrhoPluginAUexport.cpp
+++ b/distrho/src/DistrhoPluginAUexport.cpp
@@ -80,13 +80,12 @@ int au_generate_r(const char* const basename)
d_stderr2("AU plugin Id cannot be negative");
return 1;
}
- if (uniqueId >= UINT32_MAX)
+ if (uniqueId >= UINT16_MAX)
{
- d_stderr2("AU plugin Id cannot be higher than uint32");
- return 1;
+ d_stderr2("AU plugin Id cannot be higher than uint16");
}
- rFile << "#define DISTRHO_PLUGIN_AU_RES_ID \"" + String(uniqueId) + "\"\n";
+ rFile << "#define DISTRHO_PLUGIN_AU_RES_ID " + String(uniqueId % UINT16_MAX) + "\n";
}
#ifndef DEBUG