Audacity  2.2.0
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 
29 #include "audacity/ModuleInterface.h"
30 #include "audacity/EffectInterface.h"
31 #include "audacity/PluginInterface.h"
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 implementatino
78 
79  wxString GetPath() override;
80  wxString GetSymbol() override;
81  wxString GetName() override;
82  wxString GetVendor() override;
83  wxString GetVersion() override;
84  wxString GetDescription() override;
85 
86  // ModuleInterface implementation
87 
88  bool Initialize() override;
89  void Terminate() override;
90 
91  bool AutoRegisterPlugins(PluginManagerInterface & pm) override;
92  wxArrayString FindPlugins(PluginManagerInterface & pm) override;
93  bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
94 
95  bool IsPluginValid(const wxString & path, bool bFast) override;
96 
97  IdentInterface *CreateInstance(const wxString & path) override;
98  void DeleteInstance(IdentInterface *instance) override;
99 
100  // LV2EffectModule implementation
101 
102 private:
103  const LilvPlugin *GetPlugin(const wxString & path);
104 
105 private:
106  ModuleManagerInterface *mModMan;
107  wxString mPath;
108 };
109 
110 extern LilvWorld *gWorld;
111 
112 #endif
wxString GetVendor() override
wxString GetSymbol() override
wxString GetDescription() override
bool Initialize() override
LV2EffectsModule(ModuleManagerInterface *moduleManager, const wxString *path)
void Terminate() override
const LilvPlugin * GetPlugin(const wxString &path)
virtual ~LV2EffectsModule()
wxString GetPath() override
wxString GetVersion() override
wxString GetName() override
IdentInterface * CreateInstance(const wxString &path) override
ModuleManagerInterface * mModMan
Definition: LoadLV2.h:106
LilvWorld * gWorld
wxArrayString FindPlugins(PluginManagerInterface &pm) override
bool IsPluginValid(const wxString &path, bool bFast) override
Definition: LoadLV2.h:71
void DeleteInstance(IdentInterface *instance) override
bool RegisterPlugin(PluginManagerInterface &pm, const wxString &path) override
wxString mPath
Definition: LoadLV2.h:107
bool AutoRegisterPlugins(PluginManagerInterface &pm) override