-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpslvst2extensions.h
140 lines (107 loc) · 6.39 KB
/
pslvst2extensions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//************************************************************************************************
//
// PreSonus Plug-In Extensions
// Written and placed in the PUBLIC DOMAIN by PreSonus Software Ltd.
//
// Filename : pslvst2extensions.h
// Created by : PreSonus Software Ltd., 05/2012, last updated 04/2019
// Description : PreSonus-specific VST2 API Extensions
//
//************************************************************************************************
/*
DISCLAIMER:
PreSonus Plug-In Extensions are host-specific extensions of existing proprietary technologies,
provided to the community on an AS IS basis. They are not part of any official 3rd party SDK and
PreSonus is not affiliated with the owner of the underlying technology in any way.
*/
//************************************************************************************************
#ifndef _pslvst2extensions_h
#define _pslvst2extensions_h
namespace Presonus {
/** @defgroup vst2Extensions VST 2 Extensions
Vendor-specific opcodes a VST2 plug-in can implement to add non-standard features like
embedding its views as subview into the host, resizing from the host, high-DPI scaling, etc.
- Embedding corresponds to the Presonus::IPlugInViewEmbedding VST3 extended interface.
- Resizing works like VST3's checkSizeConstraint() and onSize() methods, VST3's canResize()
is defined via canDoViewResize.
- For "DPI-aware" host applications on the Windows platform a similar mimic to the
Presonus::IPlugInViewScaling VST3 extended interface is defined here.
- Gain reduction reporting corresponds to the Presonus::IGainReductionInfo VST3 interface.
- Slave effect handling corresponds to the Presonus::ISlaveControllerHandler VST3 interface.
*/
//////////////////////////////////////////////////////////////////////////////////////////////////
// CanDo Strings
//////////////////////////////////////////////////////////////////////////////////////////////////
/** Identifiers to be passed to VST2's canDo() method. @ingroup vst2Extensions */
namespace PlugCanDos
{
/** Check if view can be resized by the host. */
static const char* canDoViewResize = "supportsViewResize";
/** Check if view can be embedded by the host. */
static const char* canDoViewEmbedding = "supportsViewEmbedding";
/** Check if view scaling for high-DPI is supported by the plug-in. */
static const char* canDoViewDpiScaling = "supportsViewDpiScaling";
/** Check if system DPI scaling should be turned on for the plug-in. */
static const char* canDoViewSystemDpiScaling = "supportsViewSystemDpiScaling";
/** Check if gain reduction reporting is supported by the plug-in. */
static const char* canDoGainReductionInfo = "supportsGainReductionInfo";
/** Check if slave effects are supported by plug-in. */
static const char* canDoSlaveEffects = "supportsSlaveEffects";
/** Check if plug-in can export MIDI key switch information. */
static const char* canDoMidiKeySwitchInfo = "supportsMidiKeySwitchInfo";
/** Check if plug-in supports MPE notifications. */
static const char* canDoMPENotifications = "supportsMPENotifications";
}
//////////////////////////////////////////////////////////////////////////////////////////////////
// Opcodes
//////////////////////////////////////////////////////////////////////////////////////////////////
/** Opcodes @ingroup vst2Extensions */
enum Opcodes
{
/** PreSonus vendor ID - distinguishes our calls from other VST2 extensions.
Pass this vendor ID as "index" (aka "lArg1") parameter for vendor specific calls. */
kVendorID = 'PreS',
/** The host can suggest a new editor size, and the plug-in can modify the suggested
size to a suitable value if it cannot resize to the given values.
The ptrArg is a ERect* to the input/output rect. This differs from the ERect**
used by effEditGetRect, because here the rect is owned by the host, not the plug-in.
The result is 0 on failure, 1 on success. */
kEffEditCheckSizeConstraints = 'AeCc',
/** The host can set a new size after negotiating the size via the above
kEffEditCheckSizeConstraints, triggering the actual resizing.
The ptrArg is a ERect* to the input/output rect. This differs from the ERect**
used by effEditGetRect, because here the rect is owned by the host, not the plug-in.
The result is 0 on failure, 1 on success. */
kEffEditSetRect = 'AeSr',
/** When the view is embedded, it may need to adjust its UI, e.g. by suppressing
its built-in resizing facility because this is then controlled by the host.
The ptrArg is a VstInt32*, pointing to 0 to disable or to 1 to enable embedding.
Per default, embedding is disabled until the host calls this to indicate otherwise. */
kEffEditSetEmbedded = 'AeEm',
/** Inform the view about the current content scaling factor. The factor is passed in the opt argument.
For more details, please check the documentation of Presonus::IPlugInViewScaling. */
kEffEditSetContentScaleFactor = 'AeCs',
/** Get current gain reduction for display. The ptrArg is a float* to be set to the dB value.
For more details, please check the documentation of Presonus::IGainReductionInfo. */
kEffGetGainReductionValueInDb = 'GRdB',
/** Add slave effect. The ptrArg is a pointer to the slave AEffect, the 'opt' float transmits the mode (see enum SlaveMode).
For more details, please check the documentation of Presonus::ISlaveControllerHandler. */
kEffAddSlave = 'AdSl',
/** Remove slave effect. The ptrArg is a pointer to the slave AEffect.
For more details, please check the documentation of Presonus::ISlaveControllerHandler. */
kEffRemoveSlave = 'RmSl',
/** Get MIDI key assignment. The ptrArg is a pointer to a MidiKeyName structure as defined in the VST2 SDK.
The opt argument is the MIDI channel. */
kEffGetMidiKeyAssignment = 'MKAs',
// flags used with MidiKeyName structure
kMidiKeyAssignmentIsKeySwitch = 1<<0, ///< key is used as key switch
kMidiKeyAssignmentIsActiveKeySwitch = 1<<1, ///< key switch is currently active
kMidiKeyAssignmentIsAssigned = 1<<2, ///< key is assigned (no sound otherwise)
/** Called by host to check if plug-in has MPE mode currently enabled (return value is 1). */
kEffGetMPEEnabled = 'gMPE',
/** Notify host that plug-in has enabled or disabled MPE mode. Passed as 'value' argument to audioMasterVendorSpecific.
Host in turn queries new mode via kEffGetMPEEnabled and returns 1 on success or 0 if not called from main thread. */
kHostMPEEnabledChangeNotification = 'cMPE'
};
} // namespace Presonus
#endif // _pslvst2extensions_h