diff options
author | falkTX <falktx@gmail.com> | 2019-01-31 11:52:24 +0000 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2019-01-31 11:52:24 +0000 |
commit | b2ad7a09ec2ad5c30c3edf6fe9e91fca72433e55 (patch) | |
tree | 6b72de025afa62d4c75ed3c90de2e71fdd3f0ed0 | |
parent | d8a29a68bf11cae588750e96384ed935dcb7e978 (diff) | |
parent | 3176b34ebedc15d74ca8fd5537e318aff8874697 (diff) |
Merge branch 'au' of github.com:DISTRHO/DPF into au
-rw-r--r-- | distrho/DistrhoPlugin.hpp | 2 | ||||
-rw-r--r-- | distrho/src/DistrhoPluginAU.cpp | 9 | ||||
-rw-r--r-- | distrho/src/DistrhoPluginAUexport.cpp | 23 |
3 files changed, 30 insertions, 4 deletions
diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp index 1da2bdb6..9eecce6c 100644 --- a/distrho/DistrhoPlugin.hpp +++ b/distrho/DistrhoPlugin.hpp @@ -771,7 +771,7 @@ protected: /** Get the plugin unique Id.@n - This value is used by LADSPA, DSSI and VST plugin formats. + This value is used by LADSPA, DSSI, VST and AU plugin formats. @see d_cconst() */ virtual int64_t getUniqueId() const = 0; diff --git a/distrho/src/DistrhoPluginAU.cpp b/distrho/src/DistrhoPluginAU.cpp index 572104e8..9986c3af 100644 --- a/distrho/src/DistrhoPluginAU.cpp +++ b/distrho/src/DistrhoPluginAU.cpp @@ -221,6 +221,8 @@ protected: for (uint32_t i = 0; i < DISTRHO_PLUGIN_NUM_OUTPUTS; ++i) 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(); return noErr; @@ -316,6 +320,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 2c1f749f..1b2d0cd0 100644 --- a/distrho/src/DistrhoPluginAUexport.cpp +++ b/distrho/src/DistrhoPluginAUexport.cpp @@ -21,7 +21,7 @@ // ----------------------------------------------------------------------- -void au_generate_r(const char* const basename) +int au_generate_r(const char* const basename) { USE_NAMESPACE_DISTRHO @@ -72,6 +72,22 @@ void au_generate_r(const char* const basename) rFile << "#define DISTRHO_PLUGIN_DESCRIPTION \"" + description + "\"\n"; } + // res id + if (const int64_t uniqueId = plugin.getUniqueId()) + { + if (uniqueId < 0) + { + d_stderr2("AU plugin Id cannot be negative"); + return 1; + } + if (uniqueId >= UINT16_MAX) + { + d_stderr2("AU plugin Id cannot be higher than uint16"); + } + + rFile << "#define DISTRHO_PLUGIN_AU_RES_ID " + String(uniqueId % UINT16_MAX) + "\n"; + } + #ifndef DEBUG // version { @@ -88,6 +104,8 @@ void au_generate_r(const char* const basename) rFile.close(); std::cout << " done!" << std::endl; + + return 0; } // ----------------------------------------------------------------------- @@ -100,8 +118,7 @@ int main(int argc, char* argv[]) return 1; } - au_generate_r(argv[1]); - return 0; + return au_generate_r(argv[1]); } // ----------------------------------------------------------------------- |