Browse Source

Merge branch 'au' of github.com:DISTRHO/DPF into au

pull/125/head
falkTX 7 years ago
parent
commit
b2ad7a09ec
3 changed files with 30 additions and 4 deletions
  1. +1
    -1
      distrho/DistrhoPlugin.hpp
  2. +9
    -0
      distrho/src/DistrhoPluginAU.cpp
  3. +20
    -3
      distrho/src/DistrhoPluginAUexport.cpp

+ 1
- 1
distrho/DistrhoPlugin.hpp View File

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


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

@@ -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)
};



+ 20
- 3
distrho/src/DistrhoPluginAUexport.cpp View File

@@ -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]);
}

// -----------------------------------------------------------------------


Loading…
Cancel
Save