Audacity 3.2.0
VST3EffectsModule.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file VST3EffectsModule.h
6
7 @author Vitaly Sverchinsky
8
9 @brief Part of Audacity VST3 module
10
11**********************************************************************/
12
13#pragma once
14
15#include <unordered_map>
16#include <memory>
17
18#include "Callable.h"
19#include "GlobalVariable.h"
20#include "PluginProvider.h"
21#include "VST3EffectBase.h"
22
23namespace VST3
24{
25 namespace Hosting
26 {
27 class Module;
28 }
29}
30
35{
36 //Holds weak pointers to the unique modules which were accessed
37 //through VST3EffectsModule::GetModule() during the lifetime.
38 std::unordered_map<wxString, std::weak_ptr<VST3::Hosting::Module>> mModules;
39
40 //Attempts to look up for a module, or load it from the hard drive if
41 //none was found (or not valid pointers)
42 std::shared_ptr<VST3::Hosting::Module> GetModule(const wxString& path);
43
44public:
45 struct VST3_API Factory : DefaultedGlobalHook<Factory,
46 Callable::UniquePtrFactory<VST3EffectBase,
47 std::shared_ptr<VST3::Hosting::Module>, VST3::Hosting::ClassInfo
48 >::Function
49 >{};
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 bool Initialize() override;
58 void Terminate() override;
60 const FileExtensions& GetFileExtensions() override;
61 FilePath InstallPath() override;
62 void AutoRegisterPlugins(PluginManagerInterface& pluginManager) override;
63 bool SupportsCustomModulePaths() const override;
64 PluginPaths FindModulePaths(PluginManagerInterface& pluginManager) override;
65 unsigned DiscoverPluginsAtPath(const PluginPath& path, TranslatableString& errMsg,
66 const RegistrationCallback& callback) override;
67 bool CheckPluginExist(const PluginPath& path) const override;
68 std::unique_ptr<ComponentInterface>
69 LoadPlugin(const PluginPath& path) override;
70 std::unique_ptr<Validator> MakeValidator() const override;
71};
Functions and classes that generate callable objects.
std::vector< PluginPath > PluginPaths
Definition: Identifier.h:215
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
Generalized interface for discovery of plug-ins for one protocol.
wxString FilePath
Definition: Project.h:21
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
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.
VST3Effect factory.
void AutoRegisterPlugins(PluginManagerInterface &pluginManager) override
Called so that a provider of a static set of plug-ins can register them.
const FileExtensions & GetFileExtensions() override
File types associated with this protocol.
PluginPaths FindModulePaths(PluginManagerInterface &pluginManager) override
std::unique_ptr< ComponentInterface > LoadPlugin(const PluginPath &path) override
Load the plug-in at a path reported by DiscoverPluginsAtPath.
void Terminate() override
Called just prior to deletion to allow releasing any resources.
std::unique_ptr< Validator > MakeValidator() const override
TranslatableString GetDescription() const override
bool CheckPluginExist(const PluginPath &path) const override
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid lo...
FilePath InstallPath() override
Where plug-in files should be copied to install them.
EffectFamilySymbol GetOptionalFamilySymbol() override
A symbol identifying the family of plug-ins provided by this.
bool Initialize() override
Called immediately after creation. Let provider initialize.
VendorSymbol GetVendor() const override
std::unordered_map< wxString, std::weak_ptr< VST3::Hosting::Module > > mModules
wxString GetVersion() const override
PluginPath GetPath() const override
ComponentInterfaceSymbol GetSymbol() const override
std::shared_ptr< VST3::Hosting::Module > GetModule(const wxString &path)
bool SupportsCustomModulePaths() const override
unsigned DiscoverPluginsAtPath(const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback) override
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.