Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle AUv2 No UI case #260

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/detail/auv2/build-helper/build-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ int main(int argc, char **argv)
else
{
fillOSS << "\n if (strcmp(_plugin->_plugin->desc->id,\"" << u.clapid << "\") == 0) {\n";
fillOSS << " if (!_plugin->_ext._gui) return false;\n";
fillOSS << " return fillAUCV_" << on << "(viewInfo);\n";
fillOSS << " }\n";
}
Expand Down
5 changes: 4 additions & 1 deletion src/wrapasauv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ OSStatus WrapAsAUV2::GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope in
break;

case kAudioUnitProperty_CocoaUI:
if (!_plugin->_ext._gui) return kAudioUnitErr_InvalidProperty;
if (!_plugin->_ext._gui->is_api_supported(_plugin->_plugin, CLAP_WINDOW_API_COCOA, false))
return kAudioUnitErr_InvalidProperty;
outWritable = false;
outDataSize = sizeof(struct AudioUnitCocoaViewInfo);
return noErr;
Expand Down Expand Up @@ -676,7 +679,7 @@ OSStatus WrapAsAUV2::GetProperty(AudioUnitPropertyID inID, AudioUnitScope inScop
case kAudioUnitProperty_CocoaUI:
LOGINFO("[clap-wrapper] Property: kAudioUnitProperty_CocoaUI {}",
(_plugin) ? "plugin" : "no plugin");
if (_plugin &&
if (_plugin && _plugin->_ext._gui &&
(_plugin->_ext._gui->is_api_supported(_plugin->_plugin, CLAP_WINDOW_API_COCOA, false)))
{
fillAudioUnitCocoaView(((AudioUnitCocoaViewInfo*)outData), _plugin);
Expand Down
Loading