Browse Source

PluginHostType: Fix host reporting in bridged hosts on M1

Reports the correct host name for Apple hosts on M1 which host plugins
in a separate process.

Affected hosts are:
- Logic Pro
- GarageBand
- MainStage
- Final Cut Pro
tags/2021-05-28
reuk 4 years ago
parent
commit
1b4960b5bf
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
2 changed files with 25 additions and 2 deletions
  1. +13
    -0
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  2. +12
    -2
      modules/juce_audio_plugin_client/utility/juce_PluginHostType.h

+ 13
- 0
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -675,6 +675,19 @@ public:
return noErr;
}
#if defined (MAC_OS_X_VERSION_10_12)
case kAudioUnitProperty_AUHostIdentifier:
{
if (inDataSize < sizeof (AUHostVersionIdentifier))
return kAudioUnitErr_InvalidPropertyValue;
const auto* identifier = static_cast<const AUHostVersionIdentifier*> (inData);
PluginHostType::getHostIdReportedByWrapper() = String::fromCFString (identifier->hostName);
return noErr;
}
#endif
default: break;
}
}


+ 12
- 2
modules/juce_audio_plugin_client/utility/juce_PluginHostType.h View File

@@ -297,11 +297,16 @@ public:
//==============================================================================
#ifndef DOXYGEN
#ifndef DOXYGEN
// @internal
static AudioProcessor::WrapperType jucePlugInClientCurrentWrapperType;
static std::function<bool (AudioProcessor&)> jucePlugInIsRunningInAudioSuiteFn;
#endif
static String& getHostIdReportedByWrapper()
{
static String hostId;
return hostId;
}
#endif
private:
static HostType getHostType()
@@ -357,6 +362,11 @@ private:
if (hostFilename.containsIgnoreCase ("AudioPluginHost")) return JUCEPluginHost;
if (hostFilename.containsIgnoreCase ("Vienna Ensemble Pro")) return ViennaEnsemblePro;
#if defined (JucePlugin_Build_AU)
if (getHostIdReportedByWrapper() == "com.apple.logic.pro") return AppleLogic;
if (getHostIdReportedByWrapper() == "com.apple.garageband") return AppleGarageBand;
#endif
#elif JUCE_WINDOWS
if (hostFilename.containsIgnoreCase ("Live 6")) return AbletonLive6;
if (hostFilename.containsIgnoreCase ("Live 7")) return AbletonLive7;


Loading…
Cancel
Save