Tell a wrapped plugin which format it is in, and which host - #560
Merged
Merged
Conversation
A CLAP inside clap-wrapper had no way to learn that it was wrapped, or as what. host->name only half answered who the host was: it carries a " (CLAP-as-VST3)" style suffix, the Apple formats add a version, and an AUv3 gets the name of its own appex. clap-wrapper.host-information/0, in include/clapwrapper/wrapper_host.h, is a host extension every wrapper now provides. get_wrapper_flavor answers auv2, auv3, aax, vst3 or standalone. get_underlying_host_name answers the host's own name, "REAPER" rather than "REAPER (CLAP-as-VST3)", or null when it cannot be known. host->name stays as it was. REAPER as a native CLAP host also calls itself "REAPER", and a plugin special-casing that would start doing so inside the VST3. The AU formats take the name from the process they were loaded into, and give null when that process is an XPC service. AUHostingService, which runs an out of process AUv2, and the appex an AUv3 runs in are both XPC! bundles, and neither is the host. The standalone names itself per platform. The distortion example logs both. Assisted-by: Claude Opus 5 <noreply@anthropic.com>
Collaborator
Author
|
@defiantnerd as discussed. A way to tell if you are wrapped by a host query. |
defiantnerd
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A CLAP inside clap-wrapper can't currently tell that it is wrapped, or as what.
host->nameonly half answers who the host is: it carries a(CLAP-as-VST3)style suffix, the Apple formats add a version, and an AUv3 gets the name of its own appex.This adds a host extension,
clap-wrapper.host-information/0ininclude/clapwrapper/wrapper_host.h, which every wrapper now provides:A null extension means a real CLAP host.
get_wrapper_flavorOne of
CLAP_WRAPPER_HOST_FLAVOR_AUV2,_AUV3,_AAX,_VST3,_STANDALONE.Clap::IHost::wrapper_flavor()is pure virtual, so a new wrapper has to answer. The AAX scan-time microhost answersaaxtoo.get_underlying_host_nameThe host's own name without the wrapper suffix, or null when it can't be known.
IHostApplication::getNameAAX_IController::GetHostName; null in the scan-time microhostAUHostingServicefor an out of process AUv2, the appex for an AUv3)Wrapper Mac Standalone/Wrapper Windows Standalone/Wrapper Linux StandaloneEach wrapper stores the name before creating the plugin and never changes it, so the call is thread-safe.
host->nameis deliberately unchanged. REAPER as a native CLAP host also calls itselfREAPER, and a plugin special-casing that would start doing so inside the VST3. VST3 and AAX now buildhost->namefrom the stored name, so the two can't disagree.Example
The clap-first distortion example logs its flavor (comparing against a few of the constants) and the underlying host name.
Testing
Wrapped as a VST3/Underlying host is 'vstvalidator'.