Audacity 3.2.0
LoadLV2.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file LoadLV2.h
6 @brief Defines the module to handle the LV2 effect protocol
7
8 Audacity(R) is copyright (c) 1999-2008 Audacity Team.
9 License: GPL v2 or later. See License.txt.
10
11*********************************************************************/
12#ifndef LV2EFFECTSMODULE_H
13#define LV2EFFECTSMODULE_H
14
15#include <memory>
16
17#include "lilv/lilv.h"
18
19#include "Callable.h"
20#include "GlobalVariable.h"
21#include "LV2EffectBase.h"
22#include "PluginProvider.h"
23
25//
26// LV2EffectsModule
27//
29
30class LV2_API LV2EffectsModule final : public PluginProvider
31{
32public:
33 struct LV2_API Factory : DefaultedGlobalHook<Factory,
34 Callable::UniquePtrFactory<LV2EffectBase, const LilvPlugin &>::Function
35 >{};
36
38 virtual ~LV2EffectsModule();
39
40 // ComponentInterface implementation
41
42 PluginPath GetPath() const override;
43 ComponentInterfaceSymbol GetSymbol() const override;
44 VendorSymbol GetVendor() const override;
45 wxString GetVersion() const override;
46 TranslatableString GetDescription() const override;
47
48 // PluginProvider implementation
49
50 bool Initialize() override;
51 void Terminate() override;
52 bool SupportsCustomModulePaths() const override;
54
55 const FileExtensions &GetFileExtensions() override;
56 FilePath InstallPath() override { return {}; }
57
60 unsigned DiscoverPluginsAtPath(
61 const PluginPath & path, TranslatableString &errMsg,
62 const RegistrationCallback &callback)
63 override;
64
65 bool CheckPluginExist(const PluginPath& path) const override;
66
67 std::unique_ptr<ComponentInterface>
68 LoadPlugin(const PluginPath & path) override;
69
70 // LV2EffectModule implementation
71
72 std::unique_ptr<Validator> MakeValidator() const override;
73
74private:
75
76 static const LilvPlugin *GetPlugin(const PluginPath & path);
77
78 //During initialization LV2 module will update LV2_PATH
79 //environment variable, we need to preserve the its contents
80 //on startup to avoid appended duplications
82};
83
84#endif
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
virtual wxString GetVersion() const =0
virtual PluginPath GetPath() const =0
virtual VendorSymbol GetVendor() const =0
virtual ComponentInterfaceSymbol GetSymbol() const =0
virtual TranslatableString GetDescription() const =0
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
FilePath InstallPath() override
Where plug-in files should be copied to install them.
Definition: LoadLV2.h:56
wxString mStartupPathVar
Definition: LoadLV2.h:81
virtual EffectFamilySymbol GetOptionalFamilySymbol()=0
A symbol identifying the family of plug-ins provided by this.
virtual unsigned DiscoverPluginsAtPath(const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback)=0
virtual void Terminate()=0
Called just prior to deletion to allow releasing any resources.
virtual bool SupportsCustomModulePaths() const
virtual PluginPaths FindModulePaths(PluginManagerInterface &pluginManager)=0
virtual std::unique_ptr< Validator > MakeValidator() const
virtual std::unique_ptr< ComponentInterface > LoadPlugin(const PluginPath &path)=0
Load the plug-in at a path reported by DiscoverPluginsAtPath.
virtual void AutoRegisterPlugins(PluginManagerInterface &pluginManager)=0
Called so that a provider of a static set of plug-ins can register them.
virtual const FileExtensions & GetFileExtensions()=0
File types associated with this protocol.
virtual bool Initialize()=0
Called immediately after creation. Let provider initialize.
virtual bool CheckPluginExist(const PluginPath &path) const =0
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid lo...
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
const PluginDescriptor * GetPlugin(const PluginID &ID)