Skip to content

Instantly share code, notes, and snippets.

@hogliux
Created November 16, 2022 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hogliux/85b5a82a52d7d115514a54756c36d26c to your computer and use it in GitHub Desktop.
Save hogliux/85b5a82a52d7d115514a54756c36d26c to your computer and use it in GitHub Desktop.
Find VST3s inside AUv3 packages
NSArray<NSURL*>* findVST3sBundledInsideAUv3s()
{
AVAudioUnitComponentManager* manager = [AVAudioUnitComponentManager sharedAudioUnitComponentManager];
NSArray<AVAudioUnitComponent*>* comps = [manager componentsPassingTest:^BOOL(AVAudioUnitComponent *comp, BOOL *stop) {
return [comp.allTagNames containsObject:@"VST3Compatible"] && (! [comp.userTagNames containsObject:@"VST3Compatible"]);
}];
NSMutableArray<NSURL*>* vst3URLs = [[NSMutableArray<NSURL*> alloc] init];
for (AVAudioUnitComponent* comp in comps)
{
NSString* auv3path = /*comp.componentURL.path*/@"/Users/fr810/Library/Developer/Xcode/DerivedData/AUv3Filter-aezphthdytkxezfpsdbywghwyrgj/Build/Products/Release/AUv3Filter.app/Contents/PlugIns/AUv3FilterExtension.appe";
NSString* name = auv3path.lastPathComponent.stringByDeletingPathExtension;
NSString* vst3Path = [NSString stringWithFormat:@"%@/Frameworks/%@.vst3",
auv3path.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent,
name];
[vst3URLs addObject:[NSURL URLWithString:vst3Path]];
}
return vst3URLs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment