Audacity 3.2.0
VST3Utils.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file VSTUtils.h
6
7 @author Vitaly Sverchinsky
8
9 @brief Part of Audacity VST3 module
10
11**********************************************************************/
12
13#pragma once
14
15#include <pluginterfaces/vst/ivstaudioprocessor.h>
16#include <string>
17#include <public.sdk/source/vst/hosting/module.h>
18#include <public.sdk/source/vst/vstpresetfile.h>
19
20class wxString;
21class wxWindow;
22
23namespace Steinberg
24{
25 namespace Vst
26 {
27 class IEditController;
28 class IComponentHandler;
29 struct ParameterInfo;
30 }
31}
32
36class VST3_API VST3Utils final
37{
38public:
39
40 //Creates a plugin path string, which can be used to uniquely identify the effect.
41 //modulePath - path to the vst3 file/catalog
42 //effectUIDString - the effect's VST3::UID converted to a string
43 static wxString MakePluginPathString(const wxString& modulePath, const std::string& effectUIDString);
44
45 //Attempts to parse plugin path string, returns true if string is considered
46 //to be a valid plugin path. modulePath and effectUIDString are written if
47 //provided.
48 static bool ParsePluginPath(const wxString& pluginPath, wxString* modulePath, std::string* effectUIDString);
49
50 static wxString ToWxString(const Steinberg::Vst::TChar* str);
51
52 //Builds a string key suitable to use as an Audacity macro param
53 //key, which is guaranteed to be unique, and most likely be in
54 //a human-readable form.
55 static wxString MakeAutomationParameterKey(const Steinberg::Vst::ParameterInfo& info);
56
57 //Attempts to extract a unique VST3 parameter id from the key.
58 //Returns true on success.
59 static bool ParseAutomationParameterKey(const wxString& key, Steinberg::Vst::ParamID& paramId);
60
61 static wxString MakeFactoryPresetID(Steinberg::Vst::UnitID unitId, Steinberg::int32 programIndex);
62 static bool ParseFactoryPresetID(const wxString& presetId, Steinberg::Vst::UnitID& unitId, Steinberg::int32& programIndex);
63
64 static wxString GetFactoryPresetsPath(const VST3::Hosting::ClassInfo& effectClassInfo);
65};
66
67class PresetsBufferStream : public Steinberg::Vst::BufferStream
68{
69public:
70
71 static Steinberg::IPtr<PresetsBufferStream> fromString(const wxString& str);
72
73 wxString toString() const;
74};
#define str(a)
static const AudacityProject::AttachedObjects::RegisteredFactory key
static Steinberg::IPtr< PresetsBufferStream > fromString(const wxString &str)
Definition: VST3Utils.cpp:153
wxString toString() const
Definition: VST3Utils.cpp:167
Provides a set of useful functions, used across the Audacity VST3 module.
Definition: VST3Utils.h:37