23#include <wx/tokenzr.h>
41 return std::make_unique<VSTEffectsModule>();
81 return XO(
"VST Effects");
86 return XO(
"The Audacity Team");
92 return AUDACITY_VERSION_STRING;
97 return XO(
"Adds the ability to use VST effects in Audacity.");
145 wxString vstpath = wxString::FromUTF8(getenv(
"VST_PATH"));
146 if (!vstpath.empty())
148 wxStringTokenizer tok(vstpath, wxPATH_SEP);
149 while (tok.HasMoreTokens())
151 pathList.push_back(tok.GetNextToken());
155#if defined(__WXMAC__)
156#define VSTPATH wxT("/Library/Audio/Plug-Ins/VST")
159 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH +
VSTPATH);
167 for (
size_t i = 0; i < files.size(); i++)
169 files[i] = wxPathOnly(wxPathOnly(files[i]));
170 if (!files[i].EndsWith(
wxT(
".vst")))
172 files.erase( files.begin() + i-- );
176#elif defined(__WXMSW__)
178 TCHAR dpath[MAX_PATH];
179 TCHAR tpath[MAX_PATH];
183 len = WXSIZEOF(tpath);
184 if (SHRegGetUSValue(
wxT(
"Software\\VST"),
185 wxT(
"VSTPluginsPath"),
195 ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath));
196 pathList.push_back(dpath);
200 len = WXSIZEOF(tpath);
201 if (SHRegGetUSValue(
wxT(
"Software\\VST"),
202 wxT(
"VSTPluginsPath"),
212 ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath));
213 pathList.push_back(dpath);
218 ExpandEnvironmentStrings(
wxT(
"%ProgramFiles%\\Steinberg\\VSTPlugins"),
221 pathList.push_back(dpath);
224 ExpandEnvironmentStrings(
wxT(
"%COMMONPROGRAMFILES%\\VST2"),
227 pathList.push_back(dpath);
238 pathList.push_back(
wxT(LIBDIR)
wxT(
"/vst"));
241 pathList.push_back(
wxT(
"/usr/lib/vst"));
242 pathList.push_back(
wxT(
"/usr/local/lib/vst"));
243 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH +
wxT(
".vst"));
251 return { files.begin(), files.end() };
263 if(effectIDs.empty())
265 effectIDs.push_back(0);
267 for(
auto id : effectIDs)
272 VSTEffectBase subeffect(wxString::Format(
"%s;%d", path,
id));
275 callback(
this, &subeffect);
277 return effectIDs.size();
279 errMsg =
XO(
"Could not load the library");
283std::unique_ptr<ComponentInterface>
289 if (!result->InitializePlugin())
296 const auto modulePath = path.BeforeFirst(
wxT(
';'));
297 return wxFileName::FileExists(modulePath) || wxFileName::DirExists(modulePath);
std::vector< PluginPath > PluginPaths
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
DECLARE_PROVIDER_ENTRY(AudacityModule)
DECLARE_BUILTIN_PROVIDER(VSTBuiltin)
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
static result_type Call(Arguments &&...arguments)
Null check of the installed function is done for you.
virtual void FindFilesInPathList(const wxString &pattern, const FilePaths &pathList, FilePaths &files, bool directories=false)=0
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.
std::vector< int > GetEffectIDs()
const FileExtensions & GetFileExtensions() override
File types associated with this protocol.
bool Initialize() override
Called immediately after creation. Let provider initialize.
EffectFamilySymbol GetOptionalFamilySymbol() override
A symbol identifying the family of plug-ins provided by this.
FilePath InstallPath() override
Where plug-in files should be copied to install them.
PluginPaths FindModulePaths(PluginManagerInterface &pm) override
TranslatableString GetDescription() const override
void AutoRegisterPlugins(PluginManagerInterface &pm) override
Called so that a provider of a static set of plug-ins can register them.
virtual ~VSTEffectsModule()
bool CheckPluginExist(const PluginPath &path) const override
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid lo...
VendorSymbol GetVendor() const override
PluginPath GetPath() const override
wxString GetVersion() const override
std::unique_ptr< ComponentInterface > LoadPlugin(const PluginPath &path) override
Load the plug-in at a path reported by DiscoverPluginsAtPath.
unsigned DiscoverPluginsAtPath(const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback) override
ComponentInterfaceSymbol GetSymbol() const override
void Terminate() override
Called just prior to deletion to allow releasing any resources.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.