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 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
62class PresetsBufferStream : public Steinberg::Vst::BufferStream
63{
64public:
65
66 static Steinberg::IPtr<PresetsBufferStream> fromString(const wxString& str);
67
68 wxString toString() const;
69};
static const AudacityProject::AttachedObjects::RegisteredFactory key
#define str(a)
static Steinberg::IPtr< PresetsBufferStream > fromString(const wxString &str)
Definition: VST3Utils.cpp:80
wxString toString() const
Definition: VST3Utils.cpp:94
Provides a set of useful functions, used across the Audacity VST3 module.
Definition: VST3Utils.h:37
static wxString MakePluginPathString(const wxString &modulePath, const std::string &effectUIDString)
Definition: VST3Utils.cpp:24
static wxString ToWxString(const Steinberg::Vst::TChar *str)
Definition: VST3Utils.cpp:48
static bool ParseAutomationParameterKey(const wxString &key, Steinberg::Vst::ParamID &paramId)
Definition: VST3Utils.cpp:66
static wxString MakeAutomationParameterKey(const Steinberg::Vst::ParameterInfo &info)
Definition: VST3Utils.cpp:54
static bool ParsePluginPath(const wxString &pluginPath, wxString *modulePath, std::string *effectUIDString)
Definition: VST3Utils.cpp:29