Audacity 3.2.0
VST3EffectBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file VST3EffectBase.h
6
7 @author Vitaly Sverchinsky
8
9 Paul Licameli split from VST3Effect.h
10
11 @brief Part of Audacity VST3 module
12
13**********************************************************************/
14#pragma once
15
16#include <public.sdk/source/vst/hosting/module.h>
17#include "PerTrackEffect.h"
18
22class VST3_API VST3EffectBase : public PerTrackEffect
23{
24 friend class VST3PluginValidator;
25
26protected:
27 // Keep strong reference to a module; this because it has to be destroyed in the destructor of this class,
28 // otherwise the destruction of mEditController and mEffectComponent would trigger a memory fault.
29 std::shared_ptr<VST3::Hosting::Module> mModule;
30 const VST3::Hosting::ClassInfo mEffectClassInfo;
31
32 // Mutable cache fields computed once on demand
33 mutable bool mRescanFactoryPresets { true };
35 mutable std::vector<wxString> mFactoryPresetIDs;
36
37public:
38 static EffectFamilySymbol GetFamilySymbol();
39
41 std::shared_ptr<VST3::Hosting::Module> module,
42 VST3::Hosting::ClassInfo effectClassInfo);
43
48
49 ~VST3EffectBase() override;
50
51 PluginPath GetPath() const override;
52 ComponentInterfaceSymbol GetSymbol() const override;
53 VendorSymbol GetVendor() const override;
54 wxString GetVersion() const override;
55 TranslatableString GetDescription() const override;
56
57 EffectType GetType() const override;
58 EffectFamilySymbol GetFamily() const override;
59 bool IsInteractive() const override;
60 bool IsDefault() const override;
61 RealtimeSince RealtimeSupport() const override;
62 bool SupportsAutomation() const override;
63 bool SaveSettings(
64 const EffectSettings &settings, CommandParameters & parms) const override;
65 bool LoadSettings(
66 const CommandParameters & parms, EffectSettings &settings) const override;
68 const RegistryPath & name, EffectSettings &settings) const override;
69 bool SaveUserPreset(
70 const RegistryPath & name, const EffectSettings &settings) const override;
71 RegistryPaths GetFactoryPresets() const override;
73 const override;
74
75 std::shared_ptr<EffectInstance> MakeInstance() const override;
76
77 bool CanExportPresets() const override;
78
79 bool HasOptions() const override;
80
81 EffectSettings MakeSettings() const override;
82 bool CopySettingsContents(const EffectSettings& src, EffectSettings& dst) const override;
83
84protected:
85 void LoadPreset(const wxString& id, EffectSettings& settings) const;
86};
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
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
virtual EffectType GetType() const =0
Type determines how it behaves.
RealtimeSince
In which versions of Audacity was an effect realtime capable?
bool SaveSettings(const EffectSettings &settings, CommandParameters &parms) const override
Store settings as keys and values.
Definition: Effect.cpp:115
RealtimeSince RealtimeSupport() const override
Since which version of Audacity has the effect supported realtime?
Definition: Effect.cpp:86
bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const override
Save settings in the configuration file as a user-named preset.
Definition: Effect.cpp:143
bool SupportsAutomation() const override
Whether the effect has any automatable controls.
Definition: Effect.cpp:91
bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const override
Restore settings from keys and values.
Definition: Effect.cpp:122
TranslatableString GetDescription() const override
Definition: Effect.cpp:64
OptionalMessage LoadFactoryPreset(int id, EffectSettings &settings) const override
Definition: Effect.cpp:160
bool HasOptions() const override
Definition: Effect.cpp:175
wxString GetVersion() const override
Definition: Effect.cpp:59
PluginPath GetPath() const override
Definition: Effect.cpp:44
VendorSymbol GetVendor() const override
Definition: Effect.cpp:54
OptionalMessage LoadUserPreset(const RegistryPath &name, EffectSettings &settings) const override
Definition: Effect.cpp:130
bool CanExportPresets() const override
Whether the effect supports export of presets to files, and importing too.
Definition: Effect.cpp:170
ComponentInterfaceSymbol GetSymbol() const override
Definition: Effect.cpp:49
EffectFamilySymbol GetFamily() const override
Report identifier and user-visible name of the effect protocol.
Definition: Effect.cpp:69
bool IsDefault() const override
Whether the effect sorts "above the line" in the menus.
Definition: Effect.cpp:81
RegistryPaths GetFactoryPresets() const override
Report names of factory presets.
Definition: Effect.cpp:155
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
Definition: Effect.cpp:76
virtual std::shared_ptr< EffectInstance > MakeInstance() const =0
Make an object maintaining short-term state of an Effect.
virtual bool CopySettingsContents(const EffectSettings &src, EffectSettings &dst) const
Update one settings object from another.
virtual EffectSettings MakeSettings() const
Base class for many of the effects in Audacity.
Holds a msgid for the translation catalog; may also bind format arguments.
Objects of this class connect Audacity with VST3 effects.
VST3EffectBase & operator=(VST3EffectBase &)=delete
const VST3::Hosting::ClassInfo mEffectClassInfo
std::shared_ptr< VST3::Hosting::Module > mModule
VST3EffectBase(const VST3EffectBase &)=delete
VST3EffectBase & operator=(const VST3EffectBase &)=delete
~VST3EffectBase() override
std::vector< wxString > mFactoryPresetIDs
VST3EffectBase(VST3EffectBase &&)=delete
RegistryPaths mFactoryPresetNames
Externalized state of a plug-in.