Audacity 3.2.0
Functions
anonymous_namespace{VST3Utils.cpp} Namespace Reference

Functions

wxString GetFactoryPresetsBasePath ()
 
wxString GetPresetsPath (const wxString &basePath, const VST3::Hosting::ClassInfo &effectClassInfo)
 

Function Documentation

◆ GetFactoryPresetsBasePath()

wxString anonymous_namespace{VST3Utils.cpp}::GetFactoryPresetsBasePath ( )

Definition at line 34 of file VST3Utils.cpp.

35{
36#ifdef __WXMSW__
37 PWSTR commonFolderPath { nullptr };
38 auto cleanup = finally([&](){ CoTaskMemFree(commonFolderPath); });
39 if(SHGetKnownFolderPath(FOLDERID_ProgramData, KF_FLAG_DEFAULT , NULL, &commonFolderPath) == S_OK)
40 return wxString(commonFolderPath) + "\\VST3 Presets\\";
41 return {};
42#elif __WXMAC__
43 return wxString("/Library/Audio/Presets/");
44#elif __WXGTK__
45 return wxString("/usr/local/share/vst3/presets/");
46#endif
47}

Referenced by VST3Utils::GetFactoryPresetsPath().

Here is the caller graph for this function:

◆ GetPresetsPath()

wxString anonymous_namespace{VST3Utils.cpp}::GetPresetsPath ( const wxString &  basePath,
const VST3::Hosting::ClassInfo &  effectClassInfo 
)

Definition at line 49 of file VST3Utils.cpp.

50{
51 wxRegEx fixName(R"([\\*?/:<>|])");
52 wxString companyName = wxString (effectClassInfo.vendor()).Trim();
53 wxString pluginName = wxString (effectClassInfo.name()).Trim();
54
55 fixName.ReplaceAll( &companyName, { "_" });
56 fixName.ReplaceAll( &pluginName, { "_" });
57
58 wxFileName result;
59 result.SetPath(basePath);
60 result.AppendDir(companyName);
61 result.AppendDir(pluginName);
62 auto path = result.GetPath();
63
64 return path;
65}

Referenced by VST3Utils::GetFactoryPresetsPath().

Here is the caller graph for this function: