Browse Source

AU: Tell host when we have an UI

au
falkTX 3 years ago
parent
commit
3a43204384
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      distrho/src/DistrhoPluginAU.cpp

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

@@ -162,6 +162,16 @@ protected:
UInt32& outDataSize,
Boolean& outWritable) override
{
#if DISTRHO_PLUGIN_HAS_UI
if (inID == kAudioUnitProperty_CocoaUI && inScope == kAudioUnitScope_Global)
{
d_stdout("GetPropertyInfo asked for CocoaUI");
outDataSize = sizeof(AudioUnitCocoaViewInfo);
outWritable = false;
return noErr;
}
#endif

return AUEffectBase::GetPropertyInfo(inID, inScope, inElement, outDataSize, outWritable);
}

@@ -170,6 +180,17 @@ protected:
AudioUnitElement inElement,
void* outData) override
{
#if DISTRHO_PLUGIN_HAS_UI
if (inID == kAudioUnitProperty_CocoaUI && inScope == kAudioUnitScope_Global && outData != nullptr)
{
d_stdout("GetProperty asked for CocoaUI");
AudioUnitCocoaViewInfo* const info = (AudioUnitCocoaViewInfo*)outData;
info->mCocoaAUViewBundleLocation = nullptr; // NSURL, CFURLRef
info->mCocoaAUViewClass[0] = nullptr; // NSString, CFStringRef
// return noErr;
}
#endif

return AUEffectBase::GetProperty (inID, inScope, inElement, outData);
}

@@ -241,7 +262,10 @@ protected:
if ((err = AUEffectBase::Initialize()) != noErr)
return err;

// make sure things are in sync
fPlugin.setBufferSize(GetMaxFramesPerSlice(), true);
fPlugin.setSampleRate(GetSampleRate(), true);

fPlugin.activate();

return noErr;


Loading…
Cancel
Save