1 /**********************************************************************
2 
3   Audacity: A Digital Audio Editor
4 
5   LoadVamp.h
6 
7   Chris Cannam
8 
9 **********************************************************************/
10 
11 
12 
13 #if defined(USE_VAMP)
14 
15 #include <memory>
16 
17 #include "ModuleInterface.h"
18 #include "EffectInterface.h"
19 #include "PluginInterface.h"
20 
21 #include <vamp-hostsdk/PluginLoader.h>
22 
23 ///////////////////////////////////////////////////////////////////////////////
24 //
25 // VampEffectsModule
26 //
27 ///////////////////////////////////////////////////////////////////////////////
28 
29 class VampEffectsModule final : public ModuleInterface
30 {
31 public:
32    VampEffectsModule();
33    virtual ~VampEffectsModule();
34 
35    // ComponentInterface implementation
36 
37    PluginPath GetPath() override;
38    ComponentInterfaceSymbol GetSymbol() override;
39    VendorSymbol GetVendor() override;
40    wxString GetVersion() override;
41    TranslatableString GetDescription() override;
42 
43    // ModuleInterface implementation
44 
45    bool Initialize() override;
46    void Terminate() override;
47    EffectFamilySymbol GetOptionalFamilySymbol() override;
48 
49    const FileExtensions &GetFileExtensions() override;
InstallPath()50    FilePath InstallPath() override { return {}; }
51 
52    bool AutoRegisterPlugins(PluginManagerInterface & pm) override;
53    PluginPaths FindPluginPaths(PluginManagerInterface & pm) override;
54    unsigned DiscoverPluginsAtPath(
55       const PluginPath & path, TranslatableString &errMsg,
56       const RegistrationCallback &callback)
57          override;
58 
59    bool IsPluginValid(const PluginPath & path, bool bFast) override;
60 
61    std::unique_ptr<ComponentInterface>
62       CreateInstance(const PluginPath & path) override;
63 
64 private:
65    // VampEffectModule implementation
66 
67    std::unique_ptr<Vamp::Plugin> FindPlugin(const PluginPath & wpath,
68                             int & output,
69                             bool & hasParameters);
70 };
71 
72 #endif
73