I wanted to invoke something along the lines of the following, e.g. in prepareToPlay:
void PluginProcessor::prepareToPlay (double sampleRate, int estimatedMaxSizeOfBuffer)
{
if (wrapperType == WrapperType::wrapperType_AudioUnit)
{
OSStatus status;
os_workgroup_t os_workgroup { nullptr };
uint32_t os_workgroup_index_size;
AudioUnit ioUnit { nullptr };
if (status = AudioUnitGetProperty (ioUnit,
kAudioOutputUnitProperty_OSWorkgroup,
kAudioUnitScope_Global,
0,
&os_workgroup,
&os_workgroup_index_size);
status != noErr)
{
DBG ("AudioUnitSetProperty kAudioOutputUnitProperty_OSWorkgroup - Failed with OSStatus: " +
std::to_string (status));
}
}
(...)
}
For the above to work, I need to fetch the “AudioUnit ioUnit” that the AudioProcessor is part of. Is there a way to do that?
While e.g. for VST3 there’s methods like:
virtual VST3ClientExtensions* getVST3ClientExtensions();
I can’t seem to find anything with which I could fetch such AU-specific information from inside the plugin.
Mind you I’m not very experienced as an Apple-dev so please forgive my naivety.
This follows from my earlier question thread - I figured a dedicated topic is best since this is a much more specific question than the above broader topic.
Thanks!
