Audacity 3.2.0
Static Public Member Functions | List of all members
VST3Utils Class Referencefinal

Provides a set of useful functions, used across the Audacity VST3 module. More...

#include <VST3Utils.h>

Static Public Member Functions

static wxString MakePluginPathString (const wxString &modulePath, const std::string &effectUIDString)
 
static bool ParsePluginPath (const wxString &pluginPath, wxString *modulePath, std::string *effectUIDString)
 
static wxString ToWxString (const Steinberg::Vst::TChar *str)
 
static wxString MakeAutomationParameterKey (const Steinberg::Vst::ParameterInfo &info)
 
static bool ParseAutomationParameterKey (const wxString &key, Steinberg::Vst::ParamID &paramId)
 
static wxString MakeFactoryPresetID (Steinberg::Vst::UnitID unitId, Steinberg::int32 programIndex)
 
static bool ParseFactoryPresetID (const wxString &presetId, Steinberg::Vst::UnitID &unitId, Steinberg::int32 &programIndex)
 
static wxString GetFactoryPresetsPath (const VST3::Hosting::ClassInfo &effectClassInfo)
 

Detailed Description

Provides a set of useful functions, used across the Audacity VST3 module.

Definition at line 36 of file VST3Utils.h.

Member Function Documentation

◆ GetFactoryPresetsPath()

wxString VST3Utils::GetFactoryPresetsPath ( const VST3::Hosting::ClassInfo &  effectClassInfo)
static

Definition at line 145 of file VST3Utils.cpp.

146{
147 return GetPresetsPath(
149 effectClassInfo
150 );
151}
wxString GetPresetsPath(const wxString &basePath, const VST3::Hosting::ClassInfo &effectClassInfo)
Definition: VST3Utils.cpp:49

References anonymous_namespace{VST3Utils.cpp}::GetFactoryPresetsBasePath(), and anonymous_namespace{VST3Utils.cpp}::GetPresetsPath().

Referenced by VST3Wrapper::FindFactoryPresets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeAutomationParameterKey()

wxString VST3Utils::MakeAutomationParameterKey ( const Steinberg::Vst::ParameterInfo &  info)
static

Definition at line 99 of file VST3Utils.cpp.

100{
101 auto suffix = ToWxString(parameterInfo.shortTitle);
102 if(suffix.empty())
103 suffix = ToWxString(parameterInfo.title);
104
105 if(!suffix.empty())
106 return wxString::Format("%lu_", static_cast<unsigned long>(parameterInfo.id)) + suffix;
107
108 return wxString::Format("%lu", static_cast<unsigned long>(parameterInfo.id));
109}
static wxString ToWxString(const Steinberg::Vst::TChar *str)
Definition: VST3Utils.cpp:93

References ToWxString().

Here is the call graph for this function:

◆ MakeFactoryPresetID()

wxString VST3Utils::MakeFactoryPresetID ( Steinberg::Vst::UnitID  unitId,
Steinberg::int32  programIndex 
)
static

Definition at line 124 of file VST3Utils.cpp.

125{
126 return wxString::Format("%d:%d",
127 static_cast<int>(unitId),
128 static_cast<int>(programIndex));
129}

Referenced by VST3Wrapper::FindFactoryPresets().

Here is the caller graph for this function:

◆ MakePluginPathString()

wxString VST3Utils::MakePluginPathString ( const wxString &  modulePath,
const std::string &  effectUIDString 
)
static

Definition at line 69 of file VST3Utils.cpp.

70{
71 return wxString::Format("%s;%s", modulePath, effectUIDString);
72}

Referenced by VST3EffectBase::GetPath().

Here is the caller graph for this function:

◆ ParseAutomationParameterKey()

bool VST3Utils::ParseAutomationParameterKey ( const wxString &  key,
Steinberg::Vst::ParamID &  paramId 
)
static

Definition at line 111 of file VST3Utils.cpp.

112{
113 const auto pos = key.Find('_');
114 const auto idStr = pos == wxNOT_FOUND ? key : key.Left(pos);
115 unsigned long value { };
116 if(idStr.ToULong(&value))
117 {
118 paramId = static_cast<Steinberg::Vst::ParamID>(value);
119 return true;
120 }
121 return false;
122}
static const AudacityProject::AttachedObjects::RegisteredFactory key

References key.

◆ ParseFactoryPresetID()

bool VST3Utils::ParseFactoryPresetID ( const wxString &  presetId,
Steinberg::Vst::UnitID &  unitId,
Steinberg::int32 &  programIndex 
)
static

Definition at line 131 of file VST3Utils.cpp.

132{
133 auto parts = wxSplit(presetId, ':');
134 long nums[2]{};
135 if(parts.size() == 2 && parts[0].ToLong(&nums[0]) && parts[1].ToLong(&nums[1]))
136 {
137 unitId = static_cast<Steinberg::Vst::UnitID>(nums[0]);
138 programIndex = static_cast<Steinberg::int32>(nums[1]);
139 return true;
140 }
141 return false;
142}

Referenced by VST3Wrapper::LoadPreset().

Here is the caller graph for this function:

◆ ParsePluginPath()

bool VST3Utils::ParsePluginPath ( const wxString &  pluginPath,
wxString *  modulePath,
std::string *  effectUIDString 
)
static

Definition at line 74 of file VST3Utils.cpp.

76{
77 const auto sep = pluginPath.Find(';', true);
78 if(sep != wxNOT_FOUND &&
79 //modulePath not empty
80 sep > 0 &&
81 //effectUIDString not empty
82 static_cast<size_t>(sep) < pluginPath.Length() - 1)
83 {
84 if(modulePath != nullptr)
85 *modulePath = pluginPath.Left(sep);
86 if(effectUIDString != nullptr)
87 *effectUIDString = pluginPath.Mid(static_cast<size_t>(sep) + 1);
88 return true;
89 }
90 return false;
91}

Referenced by VST3EffectsModule::CheckPluginExist(), and VST3EffectsModule::LoadPlugin().

Here is the caller graph for this function:

◆ ToWxString()

wxString VST3Utils::ToWxString ( const Steinberg::Vst::TChar *  str)
static

Definition at line 93 of file VST3Utils.cpp.

94{
95 static const wxCSConv csConv { wxFONTENCODING_UTF16 };
96 return { reinterpret_cast<const char*>(str), csConv };
97}
#define str(a)

References str.

Referenced by VST3Wrapper::FindFactoryPresets(), MakeAutomationParameterKey(), anonymous_namespace{VST3ParametersWindow.cpp}::VST3ValueText::SetNormalizedValue(), anonymous_namespace{VST3ParametersWindow.cpp}::VST3ContinuousParameter::UpdateAccessible(), anonymous_namespace{VST3ParametersWindow.cpp}::VST3DiscreteParameter::UpdateAccessible(), and VST3ParametersWindow::VST3ParametersWindow().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: