Audacity 3.2.0
AudioUnitEffectBase.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file AudioUnitEffectBase.h
6
7 Dominic Mazzoni
8 Leland Lucius
9
10 Paul Licameli split from AudioUnitEffect.h
11
12**********************************************************************/
13#ifndef AUDACITY_AUDIOUNIT_EFFECT_BASE_H
14#define AUDACITY_AUDIOUNIT_EFFECT_BASE_H
15
16#if USE_AUDIO_UNITS
17
18#include "AudioUnitWrapper.h"
19#include "PerTrackEffect.h"
20
21constexpr auto OptionsKey = L"Options";
22constexpr auto UseLatencyKey = L"UseLatency";
23
24#define AUDIOUNITEFFECTS_VERSION wxT("1.0.0.0")
25/* i18n-hint: the name of an Apple audio software protocol */
26#define AUDIOUNITEFFECTS_FAMILY EffectFamilySymbol{ wxT("AudioUnit"), XO("Audio Unit") }
27
29 : public PerTrackEffect
30 , public AudioUnitWrapper
31{
32public:
34
36 const wxString & name, AudioComponent component,
37 Parameters *pParameters = nullptr,
38 AudioUnitEffectBase *master = nullptr);
40
41 // ComponentInterface implementation
42
43 PluginPath GetPath() const override;
44 ComponentInterfaceSymbol GetSymbol() const override;
45 VendorSymbol GetVendor() const override;
46 wxString GetVersion() const override;
47 TranslatableString GetDescription() const override;
48
49 // EffectDefinitionInterface implementation
50
51 EffectType GetType() const override;
52 EffectFamilySymbol GetFamily() const override;
53 bool IsInteractive() const override;
54 bool IsDefault() const override;
55 RealtimeSince RealtimeSupport() const override;
56 bool SupportsAutomation() const override;
57
58 EffectSettings MakeSettings() const override;
60 const EffectSettings &src, EffectSettings &dst) const override;
61
62 bool SaveSettings(
63 const EffectSettings &settings, CommandParameters & parms) const override;
65 bool LoadSettings(
66 const CommandParameters & parms, EffectSettings &settings) const override;
67
69 const RegistryPath & name, EffectSettings &settings) const override;
70 bool SaveUserPreset(
71 const RegistryPath & name, const EffectSettings &settings) const override;
72
73 RegistryPaths GetFactoryPresets() const override;
75 const override;
76
77 bool InitializePlugin();
78
79 std::shared_ptr<EffectInstance> MakeInstance() const override;
80
81 bool CanExportPresets() const override;
82
83 bool HasOptions() const override;
84
85 // AudioUnitEffect implementation
86
88 static RegistryPath FindPresetKey(const CommandParameters & parms);
89
91 const AudioUnitEffectSettings &settings, const wxString & path) const;
93 AudioUnitEffectSettings &settings, const wxString & path) const;
99 const wxString &path, const void *blob, size_t len,
100 bool allowEmpty = true) const;
101
102 void GetChannelCounts();
103
105 const RegistryPath & group, EffectSettings &settings) const;
107 LoadPreset(const RegistryPath & group, EffectSettings &settings) const;
108 bool SavePreset(const RegistryPath & group,
109 const AudioUnitEffectSettings &settings) const;
110
111#if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
112 bool CreatePlain(wxWindow *parent);
113#endif
114
115protected:
117 const wxString mName;
118 const wxString mVendor;
119
120 bool mInteractive{ false };
121};
122
123#endif
124
125#endif
constexpr auto OptionsKey
constexpr auto UseLatencyKey
EffectType
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
wxString RegistryPath
Definition: Identifier.h:218
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
wxString name
Definition: TagsEditor.cpp:166
static Settings & settings()
Definition: TrackInfo.cpp:51
An Effect class that handles a wide range of effects. ??Mac only??
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
bool IsDefault() const override
Whether the effect sorts "above the line" in the menus.
static RegistryPath FindPresetKey(const CommandParameters &parms)
TranslatableString SaveBlobToConfig(const RegistryPath &group, const wxString &path, const void *blob, size_t len, bool allowEmpty=true) const
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
bool SupportsAutomation() const override
Whether the effect has any automatable controls.
TranslatableString GetDescription() const override
EffectFamilySymbol GetFamily() const override
Report identifier and user-visible name of the effect protocol.
bool SaveSettings(const EffectSettings &settings, CommandParameters &parms) const override
Store settings as keys and values.
TranslatableString Export(const AudioUnitEffectSettings &settings, const wxString &path) const
OptionalMessage LoadFactoryPreset(int id, EffectSettings &settings) const override
PluginPath GetPath() const override
EffectSettings MakeSettings() const override
TranslatableString Import(AudioUnitEffectSettings &settings, const wxString &path) const
bool SavePreset(const RegistryPath &group, const AudioUnitEffectSettings &settings) const
bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const override
May allocate memory, so should be called only in the main thread.
ComponentInterfaceSymbol GetSymbol() const override
RealtimeSince RealtimeSupport() const override
Since which version of Audacity has the effect supported realtime?
bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const override
Save settings in the configuration file as a user-named preset.
AudioUnitEffectBase(const PluginPath &path, const wxString &name, AudioComponent component, Parameters *pParameters=nullptr, AudioUnitEffectBase *master=nullptr)
EffectType GetType() const override
Type determines how it behaves.
wxString GetVersion() const override
OptionalMessage LoadPreset(const RegistryPath &group, EffectSettings &settings) const
VendorSymbol GetVendor() const override
static RegistryPath ChoosePresetKey(const EffectSettings &settings)
bool MigrateOldConfigFile(const RegistryPath &group, EffectSettings &settings) const
const PluginPath mPath
OptionalMessage LoadUserPreset(const RegistryPath &name, EffectSettings &settings) const override
bool HasOptions() const override
bool CopySettingsContents(const EffectSettings &src, EffectSettings &dst) const override
Update one settings object from another.
bool CanExportPresets() const override
Whether the effect supports export of presets to files, and importing too.
RegistryPaths GetFactoryPresets() const override
Report names of factory presets.
~AudioUnitEffectBase() override
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
RealtimeSince
In which versions of Audacity was an effect realtime capable?
Base class for many of the effects in Audacity.
Holds a msgid for the translation catalog; may also bind format arguments.
Represents a cached copy of the state stored in an AudioUnit, but can outlive the original AudioUnit.
Manages and interacts with an AudioUnit, providing operations on audio effects.
Externalized state of a plug-in.