Audacity  2.2.2
LoadLV2.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  LoadLV2.h
6 
7  Audacity(R) is copyright (c) 1999-2008 Audacity Team.
8  License: GPL v2. See License.txt.
9 
10 *********************************************************************/
11 
12 #ifndef LV2EFFECTSMODULE_H
13 #define LV2EFFECTSMODULE_H
14 
15 #include <wx/hashmap.h>
16 #include <wx/string.h>
17 
18 #include <lilv/lilv.h>
19 
20 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
21 #include "lv2/lv2plug.in/ns/ext/data-access/data-access.h"
22 #include "lv2/lv2plug.in/ns/ext/instance-access/instance-access.h"
23 #include "lv2/lv2plug.in/ns/ext/port-groups/port-groups.h"
24 #include "lv2/lv2plug.in/ns/ext/port-props/port-props.h"
25 #include "lv2/lv2plug.in/ns/ext/presets/presets.h"
26 #include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h"
27 #include "lv2/lv2plug.in/ns/extensions/units/units.h"
28 
32 
33 #undef URI
34 #define URI(n, u)
35 
36 // Define the list of URIs that we will use
37 #undef URILIST
38 #define URILIST \
39  URI( gBool, LV2_ATOM__Bool ) \
40  URI( gDouble, LV2_ATOM__Double ) \
41  URI( gFloat, LV2_ATOM__Float ) \
42  URI( gInt, LV2_ATOM__Int ) \
43  URI( gLong, LV2_ATOM__Long ) \
44  URI( gAudio, LV2_CORE__AudioPort ) \
45  URI( gControl, LV2_CORE__ControlPort ) \
46  URI( gInput, LV2_CORE__InputPort ) \
47  URI( gInstrument, LV2_CORE__InstrumentPlugin ) \
48  URI( gOutput, LV2_CORE__OutputPort ) \
49  URI( gOptional, LV2_CORE__connectionOptional ) \
50  URI( gEnumeration, LV2_CORE__enumeration ) \
51  URI( gInteger, LV2_CORE__integer ) \
52  URI( gName, LV2_CORE__name ) \
53  URI( gLatency, LV2_CORE__reportsLatency ) \
54  URI( gSampleRate, LV2_CORE__sampleRate ) \
55  URI( gToggled, LV2_CORE__toggled ) \
56  URI( gGroup, LV2_PORT_GROUPS__group ) \
57  URI( gSubGroupOf, LV2_PORT_GROUPS__subGroupOf ) \
58  URI( gLogarithmic, LV2_PORT_PROPS__logarithmic ) \
59  URI( gTrigger, LV2_PORT_PROPS__trigger ) \
60  URI( gPreset, LV2_PRESETS__Preset ) \
61  URI( gUnit, LV2_UNITS__unit ) \
62  URI( gUnitSymbol, LV2_UNITS__symbol ) \
63  URI( gLabel, LILV_NS_RDFS "label" )
64 
66 //
67 // LV2EffectsModule
68 //
70 
71 class LV2EffectsModule final : public ModuleInterface
72 {
73 public:
74  LV2EffectsModule(ModuleManagerInterface *moduleManager, const wxString *path);
75  virtual ~LV2EffectsModule();
76 
77  // IdentInterface implementation
78 
79  wxString GetPath() override;
82  wxString GetVersion() override;
83  wxString GetDescription() override;
84 
85  // ModuleInterface implementation
86 
87  bool Initialize() override;
88  void Terminate() override;
89 
90  wxArrayString FileExtensions() override { return {}; }
91  wxString InstallPath() override { return {}; }
92 
93  bool AutoRegisterPlugins(PluginManagerInterface & pm) override;
94  wxArrayString FindPluginPaths(PluginManagerInterface & pm) override;
95  unsigned DiscoverPluginsAtPath(
96  const wxString & path, wxString &errMsg,
97  const RegistrationCallback &callback)
98  override;
99 
100  bool IsPluginValid(const wxString & path, bool bFast) override;
101 
102  IdentInterface *CreateInstance(const wxString & path) override;
103  void DeleteInstance(IdentInterface *instance) override;
104 
105  // LV2EffectModule implementation
106 
107 private:
108  const LilvPlugin *GetPlugin(const wxString & path);
109 
110 private:
112  wxString mPath;
113 };
114 
115 extern LilvWorld *gWorld;
116 
117 #endif
IdentInterfaceSymbol GetSymbol() override
wxArrayString FindPluginPaths(PluginManagerInterface &pm) override
wxString GetDescription() override
bool Initialize() override
LV2EffectsModule(ModuleManagerInterface *moduleManager, const wxString *path)
void Terminate() override
IdentInterfaceSymbol GetVendor() override
const LilvPlugin * GetPlugin(const wxString &path)
virtual ~LV2EffectsModule()
unsigned DiscoverPluginsAtPath(const wxString &path, wxString &errMsg, const RegistrationCallback &callback) override
wxString GetPath() override
wxString GetVersion() override
wxArrayString FileExtensions() override
Definition: LoadLV2.h:90
IdentInterface * CreateInstance(const wxString &path) override
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
ModuleManagerInterface * mModMan
Definition: LoadLV2.h:111
LilvWorld * gWorld
bool IsPluginValid(const wxString &path, bool bFast) override
std::function< const PluginID &(ModuleInterface *, IdentInterface *) > RegistrationCallback
wxString InstallPath() override
Definition: LoadLV2.h:91
void DeleteInstance(IdentInterface *instance) override
IdentInterface provides name / vendor / version functions to identify plugins. It is what makes a cla...
wxString mPath
Definition: LoadLV2.h:112
bool AutoRegisterPlugins(PluginManagerInterface &pm) override