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.");
150 wxString vstpath = wxString::FromUTF8(getenv(
"VST_PATH"));
151 if (!vstpath.empty())
153 wxStringTokenizer tok(vstpath, wxPATH_SEP);
154 while (tok.HasMoreTokens())
156 pathList.push_back(tok.GetNextToken());
163 std::copy(customPaths.begin(), customPaths.end(), std::back_inserter(pathList));
166#if defined(__WXMAC__)
167#define VSTPATH wxT("/Library/Audio/Plug-Ins/VST")
170 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH +
VSTPATH);
173 AddCustomPaths(pm, *
this, pathList);
180 for (
size_t i = 0; i < files.size(); i++)
182 files[i] = wxPathOnly(wxPathOnly(files[i]));
183 if (!files[i].EndsWith(
wxT(
".vst")))
185 files.erase( files.begin() + i-- );
189#elif defined(__WXMSW__)
191 TCHAR dpath[MAX_PATH];
192 TCHAR tpath[MAX_PATH];
196 len = WXSIZEOF(tpath);
197 if (SHRegGetUSValue(
wxT(
"Software\\VST"),
198 wxT(
"VSTPluginsPath"),
208 ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath));
209 pathList.push_back(dpath);
213 len = WXSIZEOF(tpath);
214 if (SHRegGetUSValue(
wxT(
"Software\\VST"),
215 wxT(
"VSTPluginsPath"),
225 ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath));
226 pathList.push_back(dpath);
231 ExpandEnvironmentStrings(
wxT(
"%ProgramFiles%\\Steinberg\\VSTPlugins"),
234 pathList.push_back(dpath);
237 ExpandEnvironmentStrings(
wxT(
"%COMMONPROGRAMFILES%\\VST2"),
240 pathList.push_back(dpath);
242 AddCustomPaths(pm, *
this, pathList);
253 pathList.push_back(
wxT(LIBDIR)
wxT(
"/vst"));
256 pathList.push_back(
wxT(
"/usr/lib/vst"));
257 pathList.push_back(
wxT(
"/usr/local/lib/vst"));
258 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH +
wxT(
".vst"));
261 AddCustomPaths(pm, *
this, pathList);
268 return { files.begin(), files.end() };
280 if(effectIDs.empty())
282 effectIDs.push_back(0);
284 for(
auto id : effectIDs)
289 VSTEffectBase subeffect(wxString::Format(
"%s;%d", path,
id));
292 callback(
this, &subeffect);
294 return effectIDs.size();
296 errMsg =
XO(
"Could not load the library");
300std::unique_ptr<ComponentInterface>
306 if (!result->InitializePlugin())
313 const auto modulePath = path.BeforeFirst(
wxT(
';'));
314 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 PluginPaths ReadCustomPaths(const PluginProvider &provider)=0
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.
bool SupportsCustomModulePaths() const override
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.
void copy(const T *src, T *dst, int32_t n)