20#include <wx/tokenzr.h>
23#include <wx/osx/core/private.h>
33 {
'appl',
'augn',
'afpl' },
34 {
'appl',
'augn',
'sspl' },
35 {
'appl',
'augn',
'ttsp' },
36 {
'appl',
'augn',
'nrcv' },
37 {
'appl',
'aumx',
'3dmx' },
38 {
'appl',
'aumx',
'mspl' },
39 {
'appl',
'aumx',
'mcmx' },
40 {
'appl',
'aumx',
'mxmx' },
41 {
'appl',
'aumx',
'smxr' },
42 {
'Ignt',
'aufx',
'PTQX' },
58 return std::make_unique<AudioUnitEffectsModule>();
78 OSType rev = (type & 0xff000000) >> 24 |
79 (type & 0x00ff0000) >> 8 |
80 (type & 0x0000ff00) << 8 |
81 (type & 0x000000ff) << 24;
83 return wxString::FromUTF8(
reinterpret_cast<char *
>(&rev), 4);
88 wxCharBuffer buf = type.ToUTF8();
90 OSType rev = ((
unsigned char)buf.data()[0]) << 24 |
91 ((
unsigned char)buf.data()[1]) << 16 |
92 ((
unsigned char)buf.data()[2]) << 8 |
93 ((
unsigned char)buf.data()[3]);
101 wxStringTokenizer tokens(path,
wxT(
"/"));
103 AudioComponentDescription
desc;
105 desc.componentManufacturer =
ToOSType(tokens.GetNextToken());
107 desc.componentSubType =
ToOSType(tokens.GetNextToken());
108 desc.componentFlags = 0;
109 desc.componentFlagsMask = 0;
111 name = tokens.GetNextToken();
112 return AudioComponentFindNext(NULL, &
desc);
137 return XO(
"Audio Unit Effects");
142 return XO(
"The Audacity Team");
153 return XO(
"Provides Audio Unit Effects support to Audacity");
211 if (component == NULL)
213 errMsg =
XO(
"Could not find component");
222 errMsg =
XO(
"Could not initialize component");
228 callback(
this, &effect);
234std::unique_ptr<ComponentInterface>
240 result->InitializePlugin();
259 AudioComponentDescription
desc;
260 AudioComponent component;
262 desc.componentType = inAUType;
263 desc.componentSubType = 0;
264 desc.componentManufacturer = 0;
265 desc.componentFlags = 0;
266 desc.componentFlagsMask = 0;
268 component = AudioComponentFindNext(NULL, &
desc);
269 while (component != NULL)
272 AudioComponentDescription found;
274 result = AudioComponentGetDescription(component, &found);
277 CFStringRef cfName{};
278 result = AudioComponentCopyName(component, &cfName);
279 CF_ptr<CFStringRef> uName{ cfName };
280 if (result == noErr) {
283 path.Printf(
wxT(
"%-4.4s/%-4.4s/%-4.4s/%s"),
287 wxCFStringRef::AsString(cfName));
289 for (
int i = 0; i < WXSIZEOF(
BlackList); ++i) {
291 BlackList[i].componentSubType == found.componentSubType &&
293 found.componentManufacturer) {
294 wxLogDebug(
wxT(
"Blacklisted AU skipped: %s"), path);
300 effects.push_back(path);
303 component = AudioComponentFindNext(component, &
desc);
#define AUDIOUNITEFFECTS_VERSION
#define AUDIOUNITEFFECTS_FAMILY
DECLARE_PROVIDER_ENTRY(AudacityModule)
static const struct @102 BlackList[]
OSType componentManufacturer
DECLARE_BUILTIN_PROVIDER(AudioUnitEffectsBuiltin)
std::vector< PluginPath > PluginPaths
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
An Effect class that handles a wide range of effects. ??Mac only??
const FileExtensions & GetFileExtensions() override
File types associated with this protocol.
void Terminate() override
Called just prior to deletion to allow releasing any resources.
bool CheckPluginExist(const PluginPath &path) const override
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid lo...
EffectFamilySymbol GetOptionalFamilySymbol() override
A symbol identifying the family of plug-ins provided by this.
wxString GetVersion() const override
PluginPaths FindModulePaths(PluginManagerInterface &pm) override
void LoadAudioUnitsOfType(OSType inAUType, PluginPaths &effects)
bool Initialize() override
Called immediately after creation. Let provider initialize.
virtual ~AudioUnitEffectsModule()
ComponentInterfaceSymbol GetSymbol() const override
void AutoRegisterPlugins(PluginManagerInterface &pm) override
Called so that a provider of a static set of plug-ins can register them.
PluginPath GetPath() const override
VendorSymbol GetVendor() const override
unsigned DiscoverPluginsAtPath(const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback) override
std::unique_ptr< ComponentInterface > LoadPlugin(const PluginPath &path) override
Load the plug-in at a path reported by DiscoverPluginsAtPath.
TranslatableString GetDescription() const override
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
static result_type Call(Arguments &&...arguments)
Null check of the installed function is done for you.
std::function< const PluginID &(PluginProvider *, ComponentInterface *) > RegistrationCallback
Further expand a path reported by FindModulePaths.
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
OSType ToOSType(const wxString &type)
wxString FromOSType(OSType type)
AudioComponent FindAudioUnit(const PluginPath &path, wxString &name)
const TranslatableString desc