1 /**
2 * Copyright: Steinberg.
3 * License:   To use this file you MUST agree with the Steinberg VST license included in the VST SDK.
4 * Authors:   D translation by Guillaume Piolat.
5 */
6 module dplug.vst.aeffectx;
7 
8 import dplug.vst.aeffect;
9 
10 align(8):
11 
12 /// String length limits (in characters excl. 0 byte).
13 alias int Vst2StringConstants;
14 enum : Vst2StringConstants
15 {
16     kVstMaxNameLen       = 64,  /// used for #MidiProgramName, #MidiProgramCategory, #MidiKeyName, #VstSpeakerProperties, #VstPinProperties
17     kVstMaxLabelLen      = 64,  /// used for #VstParameterProperties->label, #VstPinProperties->label
18     kVstMaxShortLabelLen = 8,   /// used for #VstParameterProperties->shortLabel, #VstPinProperties->shortLabel
19     kVstMaxCategLabelLen = 24,  /// used for #VstParameterProperties->label
20     kVstMaxFileNameLen   = 100  /// used for #VstAudioFile->name
21 }
22 
23 /// A generic timestamped event.
24 struct VstEvent
25 {
26     VstInt32 type;          ///< @see VstEventTypes
27     VstInt32 byteSize;      ///< size of this event, excl. type and byteSize
28     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
29     VstInt32 flags;         ///< generic flags, none defined yet
30 
31     char[16] data;          ///< data size may vary, depending on event type
32 }
33 
34 /// VstEvent Types used by #VstEvent.
35 alias int VstEventTypes;
36 enum : VstEventTypes
37 {
38     kVstMidiType = 1,       ///< MIDI event  @see VstMidiEvent
39     DEPRECATED_kVstAudioType,       ///< \deprecated unused event type
40     DEPRECATED_kVstVideoType,       ///< \deprecated unused event type
41     DEPRECATED_kVstParameterType,   ///< \deprecated unused event type
42     DEPRECATED_kVstTriggerType, ///< \deprecated unused event type
43     kVstSysExType           ///< MIDI system exclusive  @see VstMidiSysexEvent
44 }
45 
46 /// A block of events for the current processed audio block.
47 struct VstEvents
48 {
49     VstInt32 numEvents;     ///< number of Events in array
50     VstIntPtr reserved;     ///< zero (Reserved for future use)
51     VstEvent*[2] events;    ///< event pointer array, variable size
52 }
53 
54 /// MIDI Event (to be casted from VstEvent).
55 struct VstMidiEvent
56 {
57     VstInt32 type;          ///< #kVstMidiType
58     VstInt32 byteSize;      ///< sizeof (VstMidiEvent)
59     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
60     VstInt32 flags;         ///< @see VstMidiEventFlags
61     VstInt32 noteLength;    ///< (in sample frames) of entire note, if available, else 0
62     VstInt32 noteOffset;    ///< offset (in sample frames) into note from note start if available, else 0
63     char[4] midiData;       ///< 1 to 3 MIDI bytes; midiData[3] is reserved (zero)
64     char detune;            ///< -64 to +63 cents; for scales other than 'well-tempered' ('microtuning')
65     char noteOffVelocity;   ///< Note Off Velocity [0, 127]
66     char reserved1;         ///< zero (Reserved for future use)
67     char reserved2;         ///< zero (Reserved for future use)
68 }
69 
70 /// Flags used in #VstMidiEvent.
71 alias int VstMidiEventFlags;
72 enum : VstMidiEventFlags
73 {
74     kVstMidiEventIsRealtime = 1 << 0    ///< means that this event is played life (not in playback from a sequencer track).\n This allows the Plug-In to handle these flagged events with higher priority, especially when the Plug-In has a big latency (AEffect::initialDelay)
75 }
76 
77 /// MIDI Sysex Event (to be casted from #VstEvent).
78 struct VstMidiSysexEvent
79 {
80     VstInt32 type;          ///< #kVstSysexType
81     VstInt32 byteSize;      ///< sizeof (VstMidiSysexEvent)
82     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
83     VstInt32 flags;         ///< none defined yet (should be zero)
84     VstInt32 dumpBytes;     ///< byte size of sysexDump
85     VstIntPtr resvd1;       ///< zero (Reserved for future use)
86     char* sysexDump;        ///< sysex dump
87     VstIntPtr resvd2;       ///< zero (Reserved for future use)
88 }
89 
90 //-------------------------------------------------------------------------------------------------------
91 // VstTimeInfo
92 //-------------------------------------------------------------------------------------------------------
93 //-------------------------------------------------------------------------------------------------------
94 /** VstTimeInfo requested via #audioMasterGetTime.  @see AudioEffectX::getTimeInfo
95 
96 \note VstTimeInfo::samplePos :Current Position. It must always be valid, and should not cost a lot to ask for. The sample position is ahead of the time displayed to the user. In sequencer stop mode, its value does not change. A 32 bit integer is too small for sample positions, and it's a double to make it easier to convert between ppq and samples.
97 \note VstTimeInfo::ppqPos : At tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000 samples at 48kHz sample rate.
98 .25 ppq is one sixteenth note then. if you need something like 480ppq, you simply multiply ppq by that scaler.
99 \note VstTimeInfo::barStartPos : Say we're at bars/beats readout 3.3.3. That's 2 bars + 2 q + 2 sixteenth, makes 2 * 4 + 2 + .25 = 10.25 ppq. at tempo 120, that's 10.25 * .5 = 5.125 seconds, times 48000 = 246000 samples (if my calculator servers me well :-).
100 \note VstTimeInfo::samplesToNextClock : MIDI Clock Resolution (24 per Quarter Note), can be negative the distance to the next midi clock (24 ppq, pulses per quarter) in samples. unless samplePos falls precicely on a midi clock, this will either be negative such that the previous MIDI clock is addressed, or positive when referencing the following (future) MIDI clock.
101 */
102 //-------------------------------------------------------------------------------------------------------
103 struct VstTimeInfo
104 {
105     double samplePos;               ///< current Position in audio samples (always valid)
106     double sampleRate;              ///< current Sample Rate in Herz (always valid)
107     double nanoSeconds;             ///< System Time in nanoseconds (10^-9 second)
108     double ppqPos;                  ///< Musical Position, in Quarter Note (1.0 equals 1 Quarter Note)
109     double tempo;                   ///< current Tempo in BPM (Beats Per Minute)
110     double barStartPos;             ///< last Bar Start Position, in Quarter Note
111     double cycleStartPos;           ///< Cycle Start (left locator), in Quarter Note
112     double cycleEndPos;             ///< Cycle End (right locator), in Quarter Note
113     VstInt32 timeSigNumerator;      ///< Time Signature Numerator (e.g. 3 for 3/4)
114     VstInt32 timeSigDenominator;    ///< Time Signature Denominator (e.g. 4 for 3/4)
115     VstInt32 smpteOffset;           ///< SMPTE offset (in SMPTE subframes (bits; 1/80 of a frame)). The current SMPTE position can be calculated using #samplePos, #sampleRate, and #smpteFrameRate.
116     VstInt32 smpteFrameRate;        ///< @see VstSmpteFrameRate
117     VstInt32 samplesToNextClock;    ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest clock)
118     VstInt32 flags;                 ///< @see VstTimeInfoFlags
119 }
120 
121 /// Flags used in #VstTimeInfo.
122 alias int VstTimeInfoFlags;
123 enum : VstTimeInfoFlags
124 {
125     kVstTransportChanged     = 1,       ///< indicates that play, cycle or record state has changed
126     kVstTransportPlaying     = 1 << 1,  ///< set if Host sequencer is currently playing
127     kVstTransportCycleActive = 1 << 2,  ///< set if Host sequencer is in cycle mode
128     kVstTransportRecording   = 1 << 3,  ///< set if Host sequencer is in record mode
129     kVstAutomationWriting    = 1 << 6,  ///< set if automation write mode active (record parameter changes)
130     kVstAutomationReading    = 1 << 7,  ///< set if automation read mode active (play parameter changes)
131     kVstNanosValid           = 1 << 8,  ///< VstTimeInfo::nanoSeconds valid
132     kVstPpqPosValid          = 1 << 9,  ///< VstTimeInfo::ppqPos valid
133     kVstTempoValid           = 1 << 10, ///< VstTimeInfo::tempo valid
134     kVstBarsValid            = 1 << 11, ///< VstTimeInfo::barStartPos valid
135     kVstCyclePosValid        = 1 << 12, ///< VstTimeInfo::cycleStartPos and VstTimeInfo::cycleEndPos valid
136     kVstTimeSigValid         = 1 << 13, ///< VstTimeInfo::timeSigNumerator and VstTimeInfo::timeSigDenominator valid
137     kVstSmpteValid           = 1 << 14, ///< VstTimeInfo::smpteOffset and VstTimeInfo::smpteFrameRate valid
138     kVstClockValid           = 1 << 15  ///< VstTimeInfo::samplesToNextClock valid
139 }
140 
141 //-------------------------------------------------------------------------------------------------------
142 /** SMPTE Frame Rates. */
143 //-------------------------------------------------------------------------------------------------------
144 alias int VstSmpteFrameRate;
145 enum : VstSmpteFrameRate
146 {
147 //-------------------------------------------------------------------------------------------------------
148     kVstSmpte24fps    = 0,      ///< 24 fps
149     kVstSmpte25fps    = 1,      ///< 25 fps
150     kVstSmpte2997fps  = 2,      ///< 29.97 fps
151     kVstSmpte30fps    = 3,      ///< 30 fps
152     kVstSmpte2997dfps = 4,      ///< 29.97 drop
153     kVstSmpte30dfps   = 5,      ///< 30 drop
154 
155     kVstSmpteFilm16mm = 6,      ///< Film 16mm
156     kVstSmpteFilm35mm = 7,      ///< Film 35mm
157     kVstSmpte239fps   = 10,     ///< HDTV: 23.976 fps
158     kVstSmpte249fps   = 11,     ///< HDTV: 24.976 fps
159     kVstSmpte599fps   = 12,     ///< HDTV: 59.94 fps
160     kVstSmpte60fps    = 13      ///< HDTV: 60 fps
161 //-------------------------------------------------------------------------------------------------------
162 };
163 
164 //-------------------------------------------------------------------------------------------------------
165 /** Variable IO for Offline Processing. */
166 //-------------------------------------------------------------------------------------------------------
167 struct VstVariableIo
168 {
169 //-------------------------------------------------------------------------------------------------------
170     float** inputs;                             ///< input audio buffers
171     float** outputs;                            ///< output audio buffers
172     VstInt32 numSamplesInput;                   ///< number of incoming samples
173     VstInt32 numSamplesOutput;                  ///< number of outgoing samples
174     VstInt32* numSamplesInputProcessed;         ///< number of samples actually processed of input
175     VstInt32* numSamplesOutputProcessed;        ///< number of samples actually processed of output
176 //-------------------------------------------------------------------------------------------------------
177 };
178 
179 //-------------------------------------------------------------------------------------------------------
180 /** Language code returned by audioMasterGetLanguage. */
181 //-------------------------------------------------------------------------------------------------------
182 alias int VstHostLanguage;
183 enum : VstHostLanguage
184 {
185 //-------------------------------------------------------------------------------------------------------
186     kVstLangEnglish = 1,    ///< English
187     kVstLangGerman,         ///< German
188     kVstLangFrench,         ///< French
189     kVstLangItalian,        ///< Italian
190     kVstLangSpanish,        ///< Spanish
191     kVstLangJapanese        ///< Japanese
192 //-------------------------------------------------------------------------------------------------------
193 };
194 
195 //-------------------------------------------------------------------------------------------------------
196 /** VST 2.x dispatcher Opcodes (Plug-in to Host). Extension of #AudioMasterOpcodes */
197 //-------------------------------------------------------------------------------------------------------
198 
199 alias int AudioMasterOpcodesX;
200 enum : AudioMasterOpcodesX
201 {
202 //-------------------------------------------------------------------------------------------------------
203     DEPRECATED_audioMasterWantMidi = DEPRECATED_audioMasterPinConnected + 2,    ///< \deprecated deprecated in VST 2.4
204 
205     audioMasterGetTime,             ///< [return value]: #VstTimeInfo* or null if not supported [value]: request mask  @see VstTimeInfoFlags @see AudioEffectX::getTimeInfo
206     audioMasterProcessEvents,       ///< [ptr]: pointer to #VstEvents  @see VstEvents @see AudioEffectX::sendVstEventsToHost
207 
208     DEPRECATED_audioMasterSetTime,    ///< \deprecated deprecated in VST 2.4
209     DEPRECATED_audioMasterTempoAt,    ///< \deprecated deprecated in VST 2.4
210     DEPRECATED_audioMasterGetNumAutomatableParameters,    ///< \deprecated deprecated in VST 2.4
211     DEPRECATED_audioMasterGetParameterQuantization,       ///< \deprecated deprecated in VST 2.4
212 
213     audioMasterIOChanged,           ///< [return value]: 1 if supported  @see AudioEffectX::ioChanged
214 
215     DEPRECATED_audioMasterNeedIdle,   ///< \deprecated deprecated in VST 2.4
216 
217     audioMasterSizeWindow,          ///< [index]: width [value]: height [return value]: 1 if supported  @see AudioEffectX::sizeWindow
218     audioMasterGetSampleRate,       ///< [return value]: current sample rate  @see AudioEffectX::updateSampleRate
219     audioMasterGetBlockSize,        ///< [return value]: current block size  @see AudioEffectX::updateBlockSize
220     audioMasterGetInputLatency,     ///< [return value]: input latency in audio samples  @see AudioEffectX::getInputLatency
221     audioMasterGetOutputLatency,    ///< [return value]: output latency in audio samples  @see AudioEffectX::getOutputLatency
222 
223     DEPRECATED_audioMasterGetPreviousPlug,            ///< \deprecated deprecated in VST 2.4
224     DEPRECATED_audioMasterGetNextPlug,                ///< \deprecated deprecated in VST 2.4
225     DEPRECATED_audioMasterWillReplaceOrAccumulate,    ///< \deprecated deprecated in VST 2.4
226 
227     audioMasterGetCurrentProcessLevel,  ///< [return value]: current process level  @see VstProcessLevels
228     audioMasterGetAutomationState,      ///< [return value]: current automation state  @see VstAutomationStates
229 
230     audioMasterOfflineStart,            ///< [index]: numNewAudioFiles [value]: numAudioFiles [ptr]: #VstAudioFile*  @see AudioEffectX::offlineStart
231     audioMasterOfflineRead,             ///< [index]: bool readSource [value]: #VstOfflineOption* @see VstOfflineOption [ptr]: #VstOfflineTask*  @see VstOfflineTask @see AudioEffectX::offlineRead
232     audioMasterOfflineWrite,            ///< @see audioMasterOfflineRead @see AudioEffectX::offlineRead
233     audioMasterOfflineGetCurrentPass,   ///< @see AudioEffectX::offlineGetCurrentPass
234     audioMasterOfflineGetCurrentMetaPass,   ///< @see AudioEffectX::offlineGetCurrentMetaPass
235 
236     DEPRECATED_audioMasterSetOutputSampleRate,            ///< \deprecated deprecated in VST 2.4
237     DEPRECATED_audioMasterGetOutputSpeakerArrangement,    ///< \deprecated deprecated in VST 2.4
238 
239     audioMasterGetVendorString,         ///< [ptr]: char buffer for vendor string, limited to #kVstMaxVendorStrLen  @see AudioEffectX::getHostVendorString
240     audioMasterGetProductString,        ///< [ptr]: char buffer for vendor string, limited to #kVstMaxProductStrLen  @see AudioEffectX::getHostProductString
241     audioMasterGetVendorVersion,        ///< [return value]: vendor-specific version  @see AudioEffectX::getHostVendorVersion
242     audioMasterVendorSpecific,          ///< no definition, vendor specific handling  @see AudioEffectX::hostVendorSpecific
243 
244     DEPRECATED_audioMasterSetIcon,        ///< \deprecated deprecated in VST 2.4
245 
246     audioMasterCanDo,                   ///< [ptr]: "can do" string [return value]: 1 for supported
247     audioMasterGetLanguage,             ///< [return value]: language code  @see VstHostLanguage
248 
249     DEPRECATED_audioMasterOpenWindow,     ///< \deprecated deprecated in VST 2.4
250     DEPRECATED_audioMasterCloseWindow,    ///< \deprecated deprecated in VST 2.4
251 
252     audioMasterGetDirectory,            ///< [return value]: FSSpec on MAC, else char*  @see AudioEffectX::getDirectory
253     audioMasterUpdateDisplay,           ///< no arguments
254     audioMasterBeginEdit,               ///< [index]: parameter index  @see AudioEffectX::beginEdit
255     audioMasterEndEdit,                 ///< [index]: parameter index  @see AudioEffectX::endEdit
256     audioMasterOpenFileSelector,        ///< [ptr]: VstFileSelect* [return value]: 1 if supported  @see AudioEffectX::openFileSelector
257     audioMasterCloseFileSelector,       ///< [ptr]: VstFileSelect*  @see AudioEffectX::closeFileSelector
258 
259     DEPRECATED_audioMasterEditFile,       ///< \deprecated deprecated in VST 2.4
260 
261     DEPRECATED_audioMasterGetChunkFile,   ///< \deprecated deprecated in VST 2.4 [ptr]: char[2048] or sizeof (FSSpec) [return value]: 1 if supported  @see AudioEffectX::getChunkFile
262 
263     DEPRECATED_audioMasterGetInputSpeakerArrangement  ///< \deprecated deprecated in VST 2.4
264 }
265 
266 //-------------------------------------------------------------------------------------------------------
267 /** VST 2.x dispatcher Opcodes (Host to Plug-in). Extension of #AEffectOpcodes */
268 //-------------------------------------------------------------------------------------------------------
269 alias int AEffectXOpcodes;
270 enum : AEffectXOpcodes
271 {
272 //-------------------------------------------------------------------------------------------------------
273     effProcessEvents = effSetChunk + 1      ///< [ptr]: #VstEvents*  @see AudioEffectX::processEvents
274 
275     , effCanBeAutomated                     ///< [index]: parameter index [return value]: 1=true, 0=false  @see AudioEffectX::canParameterBeAutomated
276     , effString2Parameter                   ///< [index]: parameter index [ptr]: parameter string [return value]: true for success  @see AudioEffectX::string2parameter
277 
278     , DEPRECATED_effGetNumProgramCategories   ///< \deprecated deprecated in VST 2.4
279 
280     , effGetProgramNameIndexed              ///< [index]: program index [ptr]: buffer for program name, limited to #kVstMaxProgNameLen [return value]: true for success  @see AudioEffectX::getProgramNameIndexed
281 
282     , DEPRECATED_effCopyProgram   ///< \deprecated deprecated in VST 2.4
283     , DEPRECATED_effConnectInput  ///< \deprecated deprecated in VST 2.4
284     , DEPRECATED_effConnectOutput ///< \deprecated deprecated in VST 2.4
285 
286     , effGetInputProperties                 ///< [index]: input index [ptr]: #VstPinProperties* [return value]: 1 if supported  @see AudioEffectX::getInputProperties
287     , effGetOutputProperties                ///< [index]: output index [ptr]: #VstPinProperties* [return value]: 1 if supported  @see AudioEffectX::getOutputProperties
288     , effGetPlugCategory                    ///< [return value]: category  @see VstPlugCategory @see AudioEffectX::getPlugCategory
289 
290     , DEPRECATED_effGetCurrentPosition    ///< \deprecated deprecated in VST 2.4
291     , DEPRECATED_effGetDestinationBuffer  ///< \deprecated deprecated in VST 2.4
292 
293     , effOfflineNotify                      ///< [ptr]: #VstAudioFile array [value]: count [index]: start flag  @see AudioEffectX::offlineNotify
294     , effOfflinePrepare                     ///< [ptr]: #VstOfflineTask array [value]: count  @see AudioEffectX::offlinePrepare
295     , effOfflineRun                         ///< [ptr]: #VstOfflineTask array [value]: count  @see AudioEffectX::offlineRun
296 
297     , effProcessVarIo                       ///< [ptr]: #VstVariableIo*  @see AudioEffectX::processVariableIo
298     , effSetSpeakerArrangement              ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement*  @see AudioEffectX::setSpeakerArrangement
299 
300     , DEPRECATED_effSetBlockSizeAndSampleRate ///< \deprecated deprecated in VST 2.4
301 
302     , effSetBypass                          ///< [value]: 1 = bypass, 0 = no bypass  @see AudioEffectX::setBypass
303     , effGetEffectName                      ///< [ptr]: buffer for effect name, limited to #kVstMaxEffectNameLen  @see AudioEffectX::getEffectName
304 
305     , DEPRECATED_effGetErrorText  ///< \deprecated deprecated in VST 2.4
306 
307     , effGetVendorString                    ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxVendorStrLen  @see AudioEffectX::getVendorString
308     , effGetProductString                   ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxProductStrLen  @see AudioEffectX::getProductString
309     , effGetVendorVersion                   ///< [return value]: vendor-specific version  @see AudioEffectX::getVendorVersion
310     , effVendorSpecific                     ///< no definition, vendor specific handling  @see AudioEffectX::vendorSpecific
311     , effCanDo                              ///< [ptr]: "can do" string [return value]: 0: "don't know" -1: "no" 1: "yes"  @see AudioEffectX::canDo
312     , effGetTailSize                        ///< [return value]: tail size (for example the reverb time of a reverb plug-in); 0 is default (return 1 for 'no tail')
313 
314     , DEPRECATED_effIdle              ///< \deprecated deprecated in VST 2.4
315     , DEPRECATED_effGetIcon           ///< \deprecated deprecated in VST 2.4
316     , DEPRECATED_effSetViewPosition   ///< \deprecated deprecated in VST 2.4
317 
318     , effGetParameterProperties             ///< [index]: parameter index [ptr]: #VstParameterProperties* [return value]: 1 if supported  @see AudioEffectX::getParameterProperties
319 
320     , DEPRECATED_effKeysRequired  ///< \deprecated deprecated in VST 2.4
321 
322     , effGetVstVersion                      ///< [return value]: VST version  @see AudioEffectX::getVstVersion
323 
324     // VST 2.1
325     , effEditKeyDown                        ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used  @see AEffEditor::onKeyDown
326     , effEditKeyUp                          ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used  @see AEffEditor::onKeyUp
327     , effSetEditKnobMode                    ///< [value]: knob mode 0: circular, 1: circular relativ, 2: linear (CKnobMode in VSTGUI)  @see AEffEditor::setKnobMode
328 
329     , effGetMidiProgramName                 ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: number of used programs, 0 if unsupported  @see AudioEffectX::getMidiProgramName
330     , effGetCurrentMidiProgram              ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: index of current program  @see AudioEffectX::getCurrentMidiProgram
331     , effGetMidiProgramCategory             ///< [index]: MIDI channel [ptr]: #MidiProgramCategory* [return value]: number of used categories, 0 if unsupported  @see AudioEffectX::getMidiProgramCategory
332     , effHasMidiProgramsChanged             ///< [index]: MIDI channel [return value]: 1 if the #MidiProgramName(s) or #MidiKeyName(s) have changed  @see AudioEffectX::hasMidiProgramsChanged
333     , effGetMidiKeyName                     ///< [index]: MIDI channel [ptr]: #MidiKeyName* [return value]: true if supported, false otherwise  @see AudioEffectX::getMidiKeyName
334 
335     , effBeginSetProgram                    ///< no arguments  @see AudioEffectX::beginSetProgram
336     , effEndSetProgram                      ///< no arguments  @see AudioEffectX::endSetProgram
337 
338     // VST 2.3
339     , effGetSpeakerArrangement              ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement*  @see AudioEffectX::getSpeakerArrangement
340     , effShellGetNextPlugin                 ///< [ptr]: buffer for plug-in name, limited to #kVstMaxProductStrLen [return value]: next plugin's uniqueID  @see AudioEffectX::getNextShellPlugin
341 
342     , effStartProcess                       ///< no arguments  @see AudioEffectX::startProcess
343     , effStopProcess                        ///< no arguments  @see AudioEffectX::stopProcess
344     , effSetTotalSampleToProcess            ///< [value]: number of samples to process, offline only!  @see AudioEffectX::setTotalSampleToProcess
345     , effSetPanLaw                          ///< [value]: pan law [opt]: gain  @see VstPanLawType @see AudioEffectX::setPanLaw
346 
347     , effBeginLoadBank                      ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: bank can't be loaded, 1: bank can be loaded, 0: unsupported  @see AudioEffectX::beginLoadBank
348     , effBeginLoadProgram                   ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: prog can't be loaded, 1: prog can be loaded, 0: unsupported  @see AudioEffectX::beginLoadProgram
349 
350     // VST 2.4
351     , effSetProcessPrecision                ///< [value]: @see VstProcessPrecision  @see AudioEffectX::setProcessPrecision
352     , effGetNumMidiInputChannels            ///< [return value]: number of used MIDI input channels (1-15)  @see AudioEffectX::getNumMidiInputChannels
353     , effGetNumMidiOutputChannels           ///< [return value]: number of used MIDI output channels (1-15)  @see AudioEffectX::getNumMidiOutputChannels
354 }
355 
356 //-------------------------------------------------------------------------------------------------------
357 /** Symbolic precision constants used for effSetProcessPrecision. */
358 //-------------------------------------------------------------------------------------------------------
359 alias int VstProcessPrecision;
360 enum : VstProcessPrecision
361 {
362     kVstProcessPrecision32 = 0,     ///< single precision float (32bits)
363     kVstProcessPrecision64          ///< double precision (64bits)
364 }
365 
366 //-------------------------------------------------------------------------------------------------------
367 /** Parameter Properties used in #effGetParameterProperties. */
368 //-------------------------------------------------------------------------------------------------------
369 struct VstParameterProperties
370 {
371 //-------------------------------------------------------------------------------------------------------
372     float stepFloat;            ///< float step
373     float smallStepFloat;       ///< small float step
374     float largeStepFloat;       ///< large float step
375     char[kVstMaxLabelLen] label;///< parameter label
376     VstInt32 flags;             ///< @see VstParameterFlags
377     VstInt32 minInteger;        ///< integer minimum
378     VstInt32 maxInteger;        ///< integer maximum
379     VstInt32 stepInteger;       ///< integer step
380     VstInt32 largeStepInteger;  ///< large integer step
381     char[kVstMaxShortLabelLen] shortLabel;  ///< short label, recommended: 6 + delimiter
382 
383     // The following are for remote controller display purposes.
384     // Note that the kVstParameterSupportsDisplayIndex flag must be set.
385     // Host can scan all parameters, and find out in what order
386     // to display them:
387 
388     VstInt16 displayIndex;      ///< index where this parameter should be displayed (starting with 0)
389 
390     // Host can also possibly display the parameter group (category), such as...
391     // ---------------------------
392     // Osc 1
393     // Wave  Detune  Octave  Mod
394     // ---------------------------
395     // ...if the plug-in supports it (flag #kVstParameterSupportsDisplayCategory)
396 
397     VstInt16 category;          ///< 0: no category, else group index + 1
398     VstInt16 numParametersInCategory;           ///< number of parameters in category
399     VstInt16 reserved;          ///< zero
400     char[kVstMaxCategLabelLen] categoryLabel;   ///< category label, e.g. "Osc 1"
401 
402     char[16] future;            ///< reserved for future use
403 //-------------------------------------------------------------------------------------------------------
404 }
405 
406 //-------------------------------------------------------------------------------------------------------
407 /** Flags used in #VstParameterProperties. */
408 //-------------------------------------------------------------------------------------------------------
409 alias int VstParameterFlags;
410 enum : VstParameterFlags
411 {
412 //-------------------------------------------------------------------------------------------------------
413     kVstParameterIsSwitch                = 1 << 0,  ///< parameter is a switch (on/off)
414     kVstParameterUsesIntegerMinMax       = 1 << 1,  ///< minInteger, maxInteger valid
415     kVstParameterUsesFloatStep           = 1 << 2,  ///< stepFloat, smallStepFloat, largeStepFloat valid
416     kVstParameterUsesIntStep             = 1 << 3,  ///< stepInteger, largeStepInteger valid
417     kVstParameterSupportsDisplayIndex    = 1 << 4,  ///< displayIndex valid
418     kVstParameterSupportsDisplayCategory = 1 << 5,  ///< category, etc. valid
419     kVstParameterCanRamp                 = 1 << 6   ///< set if parameter value can ramp up/down
420 //-------------------------------------------------------------------------------------------------------
421 }
422 
423 //-------------------------------------------------------------------------------------------------------
424 /** Pin Properties used in #effGetInputProperties and #effGetOutputProperties. */
425 //-------------------------------------------------------------------------------------------------------
426 struct VstPinProperties
427 {
428 //-------------------------------------------------------------------------------------------------------
429     char[kVstMaxLabelLen] label;    ///< pin name
430     VstInt32 flags;                 ///< @see VstPinPropertiesFlags
431     VstInt32 arrangementType;       ///< @see VstSpeakerArrangementType
432     char[kVstMaxShortLabelLen] shortLabel;  ///< short name (recommended: 6 + delimiter)
433 
434     char[48] future;                ///< reserved for future use
435 //-------------------------------------------------------------------------------------------------------
436 }
437 
438 //-------------------------------------------------------------------------------------------------------
439 /** Flags used in #VstPinProperties. */
440 //-------------------------------------------------------------------------------------------------------
441 alias int VstPinPropertiesFlags;
442 enum : VstPinPropertiesFlags
443 {
444 //-------------------------------------------------------------------------------------------------------
445     kVstPinIsActive   = 1 << 0,     ///< pin is active, ignored by Host
446     kVstPinIsStereo   = 1 << 1,     ///< pin is first of a stereo pair
447     kVstPinUseSpeaker = 1 << 2      ///< #VstPinProperties::arrangementType is valid and can be used to get the wanted arrangement
448 //-------------------------------------------------------------------------------------------------------
449 }
450 
451 //-------------------------------------------------------------------------------------------------------
452 /** Plug-in Categories. */
453 //-------------------------------------------------------------------------------------------------------
454 alias int VstPlugCategory;
455 enum : VstPlugCategory
456 {
457 //-------------------------------------------------------------------------------------------------------
458     kPlugCategUnknown = 0,      ///< Unknown, category not implemented
459     kPlugCategEffect,           ///< Simple Effect
460     kPlugCategSynth,            ///< VST Instrument (Synths, samplers,...)
461     kPlugCategAnalysis,         ///< Scope, Tuner, ...
462     kPlugCategMastering,        ///< Dynamics, ...
463     kPlugCategSpacializer,      ///< Panners, ...
464     kPlugCategRoomFx,           ///< Delays and Reverbs
465     kPlugSurroundFx,            ///< Dedicated surround processor
466     kPlugCategRestoration,      ///< Denoiser, ...
467     kPlugCategOfflineProcess,   ///< Offline Process
468     kPlugCategShell,            ///< Plug-in is container of other plug-ins  @see effShellGetNextPlugin
469     kPlugCategGenerator,        ///< ToneGenerator, ...
470 
471     kPlugCategMaxCount          ///< Marker to count the categories
472 //-------------------------------------------------------------------------------------------------------
473 }
474 
475 //-------------------------------------------------------------------------------------------------------
476 // MIDI Programs
477 //-------------------------------------------------------------------------------------------------------
478 //-------------------------------------------------------------------------------------------------------
479 /** MIDI Program Description. */
480 //-------------------------------------------------------------------------------------------------------
481 struct MidiProgramName
482 {
483 //-------------------------------------------------------------------------------------------------------
484     VstInt32 thisProgramIndex;      ///< 0 or greater: fill struct for this program index
485     char[kVstMaxNameLen] name;      ///< program name
486     char midiProgram;               ///< -1:off, 0-127
487     char midiBankMsb;               ///< -1:off, 0-127
488     char midiBankLsb;               ///< -1:off, 0-127
489     char reserved;                  ///< zero
490     VstInt32 parentCategoryIndex;   ///< -1:no parent category
491     VstInt32 flags;                 ///< omni etc. @see VstMidiProgramNameFlags
492 //-------------------------------------------------------------------------------------------------------
493 }
494 
495 //-------------------------------------------------------------------------------------------------------
496 /** Flags used in MidiProgramName. */
497 //-------------------------------------------------------------------------------------------------------
498 alias int VstMidiProgramNameFlags;
499 enum : VstMidiProgramNameFlags
500 {
501 //-------------------------------------------------------------------------------------------------------
502     kMidiIsOmni = 1 ///< default is multi. for omni mode, channel 0 is used for inquiries and program changes
503 //-------------------------------------------------------------------------------------------------------
504 }
505 
506 //-------------------------------------------------------------------------------------------------------
507 /** MIDI Program Category. */
508 //-------------------------------------------------------------------------------------------------------
509 struct MidiProgramCategory
510 {
511 //-------------------------------------------------------------------------------------------------------
512     VstInt32 thisCategoryIndex;     ///< 0 or greater:  fill struct for this category index.
513     char[kVstMaxNameLen] name;      ///< name
514     VstInt32 parentCategoryIndex;   ///< -1:no parent category
515     VstInt32 flags;                 ///< reserved, none defined yet, zero.
516 //-------------------------------------------------------------------------------------------------------
517 }
518 
519 //-------------------------------------------------------------------------------------------------------
520 /** MIDI Key Description. */
521 //-------------------------------------------------------------------------------------------------------
522 struct MidiKeyName
523 {
524 //-------------------------------------------------------------------------------------------------------
525     VstInt32 thisProgramIndex;      ///< 0 or greater:  fill struct for this program index.
526     VstInt32 thisKeyNumber;         ///< 0 - 127. fill struct for this key number.
527     char[kVstMaxNameLen] keyName;   ///< key name, empty means regular key names
528     VstInt32 reserved;              ///< zero
529     VstInt32 flags;                 ///< reserved, none defined yet, zero.
530 //-------------------------------------------------------------------------------------------------------
531 }
532 
533 //-------------------------------------------------------------------------------------------------------
534 // Surround Setup
535 //-------------------------------------------------------------------------------------------------------
536 //-------------------------------------------------------------------------------------------------------
537 /** Speaker Properties.
538     The origin for azimuth is right (as by math conventions dealing with radians).
539     The elevation origin is also right, visualizing a rotation of a circle across the
540     -pi/pi axis of the horizontal circle. Thus, an elevation of -pi/2 corresponds
541     to bottom, and a speaker standing on the left, and 'beaming' upwards would have
542     an azimuth of -pi, and an elevation of pi/2.
543     For user interface representation, grads are more likely to be used, and the
544     origins will obviously 'shift' accordingly. */
545 //-------------------------------------------------------------------------------------------------------
546 struct VstSpeakerProperties
547 {
548 //-------------------------------------------------------------------------------------------------------
549     float azimuth;      ///< unit: rad, range: -PI...PI, exception: 10.f for LFE channel
550     float elevation;    ///< unit: rad, range: -PI/2...PI/2, exception: 10.f for LFE channel
551     float radius;       ///< unit: meter, exception: 0.f for LFE channel
552     float reserved;     ///< zero (reserved for future use)
553     char[kVstMaxNameLen] name;  ///< for other setups, other names should be given (L/R/C... won't do)
554     VstInt32 type;      ///< @see VstSpeakerType
555 
556     char[28] future;    ///< reserved for future use
557 //-------------------------------------------------------------------------------------------------------
558 }
559 
560 //-------------------------------------------------------------------------------------------------------
561 /** Speaker Arrangement. */
562 //-------------------------------------------------------------------------------------------------------
563 struct VstSpeakerArrangement
564 {
565 //-------------------------------------------------------------------------------------------------------
566     VstInt32 type;                      ///< e.g. #kSpeakerArr51 for 5.1  @see VstSpeakerArrangementType
567     VstInt32 numChannels;               ///< number of channels in this speaker arrangement
568     VstSpeakerProperties[8] speakers;   ///< variable sized speaker array
569 //-------------------------------------------------------------------------------------------------------
570 }
571 
572 //-------------------------------------------------------------------------------------------------------
573 /** Speaker Types. */
574 //-------------------------------------------------------------------------------------------------------
575 alias int VstSpeakerType;
576 enum : VstSpeakerType
577 {
578 //-------------------------------------------------------------------------------------------------------
579     kSpeakerUndefined = 0x7fffffff, ///< Undefined
580     kSpeakerM = 0,                  ///< Mono (M)
581     kSpeakerL,                      ///< Left (L)
582     kSpeakerR,                      ///< Right (R)
583     kSpeakerC,                      ///< Center (C)
584     kSpeakerLfe,                    ///< Subbass (Lfe)
585     kSpeakerLs,                     ///< Left Surround (Ls)
586     kSpeakerRs,                     ///< Right Surround (Rs)
587     kSpeakerLc,                     ///< Left of Center (Lc)
588     kSpeakerRc,                     ///< Right of Center (Rc)
589     kSpeakerS,                      ///< Surround (S)
590     kSpeakerCs = kSpeakerS,         ///< Center of Surround (Cs) = Surround (S)
591     kSpeakerSl,                     ///< Side Left (Sl)
592     kSpeakerSr,                     ///< Side Right (Sr)
593     kSpeakerTm,                     ///< Top Middle (Tm)
594     kSpeakerTfl,                    ///< Top Front Left (Tfl)
595     kSpeakerTfc,                    ///< Top Front Center (Tfc)
596     kSpeakerTfr,                    ///< Top Front Right (Tfr)
597     kSpeakerTrl,                    ///< Top Rear Left (Trl)
598     kSpeakerTrc,                    ///< Top Rear Center (Trc)
599     kSpeakerTrr,                    ///< Top Rear Right (Trr)
600     kSpeakerLfe2                    ///< Subbass 2 (Lfe2)
601 //-------------------------------------------------------------------------------------------------------
602 }
603 
604 //-------------------------------------------------------------------------------------------------------
605 /** User-defined speaker types, to be extended in the negative range.
606     Will be handled as their corresponding speaker types with abs values:
607     e.g abs(#kSpeakerU1) == #kSpeakerL, abs(#kSpeakerU2) == #kSpeakerR) */
608 //-------------------------------------------------------------------------------------------------------
609 alias int VstUserSpeakerType;
610 enum : VstUserSpeakerType
611 {
612 //-------------------------------------------------------------------------------------------------------
613     kSpeakerU32 = -32,
614     kSpeakerU31,
615     kSpeakerU30,
616     kSpeakerU29,
617     kSpeakerU28,
618     kSpeakerU27,
619     kSpeakerU26,
620     kSpeakerU25,
621     kSpeakerU24,
622     kSpeakerU23,
623     kSpeakerU22,
624     kSpeakerU21,
625     kSpeakerU20,            ///< == #kSpeakerLfe2
626     kSpeakerU19,            ///< == #kSpeakerTrr
627     kSpeakerU18,            ///< == #kSpeakerTrc
628     kSpeakerU17,            ///< == #kSpeakerTrl
629     kSpeakerU16,            ///< == #kSpeakerTfr
630     kSpeakerU15,            ///< == #kSpeakerTfc
631     kSpeakerU14,            ///< == #kSpeakerTfl
632     kSpeakerU13,            ///< == #kSpeakerTm
633     kSpeakerU12,            ///< == #kSpeakerSr
634     kSpeakerU11,            ///< == #kSpeakerSl
635     kSpeakerU10,            ///< == #kSpeakerCs
636     kSpeakerU9,             ///< == #kSpeakerS
637     kSpeakerU8,             ///< == #kSpeakerRc
638     kSpeakerU7,             ///< == #kSpeakerLc
639     kSpeakerU6,             ///< == #kSpeakerRs
640     kSpeakerU5,             ///< == #kSpeakerLs
641     kSpeakerU4,             ///< == #kSpeakerLfe
642     kSpeakerU3,             ///< == #kSpeakerC
643     kSpeakerU2,             ///< == #kSpeakerR
644     kSpeakerU1              ///< == #kSpeakerL
645 //-------------------------------------------------------------------------------------------------------
646 }
647 
648 //-------------------------------------------------------------------------------------------------------
649 /** Speaker Arrangement Types*/
650 //-------------------------------------------------------------------------------------------------------
651 alias int VstSpeakerArrangementType;
652 enum : VstSpeakerArrangementType
653 {
654 //-------------------------------------------------------------------------------------------------------
655     kSpeakerArrUserDefined = -2,///< user defined
656     kSpeakerArrEmpty = -1,      ///< empty arrangement
657     kSpeakerArrMono  =  0,      ///< M
658     kSpeakerArrStereo,          ///< L R
659     kSpeakerArrStereoSurround,  ///< Ls Rs
660     kSpeakerArrStereoCenter,    ///< Lc Rc
661     kSpeakerArrStereoSide,      ///< Sl Sr
662     kSpeakerArrStereoCLfe,      ///< C Lfe
663     kSpeakerArr30Cine,          ///< L R C
664     kSpeakerArr30Music,         ///< L R S
665     kSpeakerArr31Cine,          ///< L R C Lfe
666     kSpeakerArr31Music,         ///< L R Lfe S
667     kSpeakerArr40Cine,          ///< L R C   S (LCRS)
668     kSpeakerArr40Music,         ///< L R Ls  Rs (Quadro)
669     kSpeakerArr41Cine,          ///< L R C   Lfe S (LCRS+Lfe)
670     kSpeakerArr41Music,         ///< L R Lfe Ls Rs (Quadro+Lfe)
671     kSpeakerArr50,              ///< L R C Ls  Rs
672     kSpeakerArr51,              ///< L R C Lfe Ls Rs
673     kSpeakerArr60Cine,          ///< L R C   Ls  Rs Cs
674     kSpeakerArr60Music,         ///< L R Ls  Rs  Sl Sr
675     kSpeakerArr61Cine,          ///< L R C   Lfe Ls Rs Cs
676     kSpeakerArr61Music,         ///< L R Lfe Ls  Rs Sl Sr
677     kSpeakerArr70Cine,          ///< L R C Ls  Rs Lc Rc
678     kSpeakerArr70Music,         ///< L R C Ls  Rs Sl Sr
679     kSpeakerArr71Cine,          ///< L R C Lfe Ls Rs Lc Rc
680     kSpeakerArr71Music,         ///< L R C Lfe Ls Rs Sl Sr
681     kSpeakerArr80Cine,          ///< L R C Ls  Rs Lc Rc Cs
682     kSpeakerArr80Music,         ///< L R C Ls  Rs Cs Sl Sr
683     kSpeakerArr81Cine,          ///< L R C Lfe Ls Rs Lc Rc Cs
684     kSpeakerArr81Music,         ///< L R C Lfe Ls Rs Cs Sl Sr
685     kSpeakerArr102,             ///< L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2
686     kNumSpeakerArr
687 //-------------------------------------------------------------------------------------------------------
688 }
689 
690 //-------------------------------------------------------------------------------------------------------
691 // Offline Processing
692 //-------------------------------------------------------------------------------------------------------
693 //-------------------------------------------------------------------------------------------------------
694 /** Offline Task Description. */
695 //-------------------------------------------------------------------------------------------------------
696 struct VstOfflineTask
697 {
698 //-------------------------------------------------------------------------------------------------------
699     char[96] processName;           ///< set by plug-in
700 
701     // audio access
702     double readPosition;            ///< set by plug-in/Host
703     double writePosition;           ///< set by plug-in/Host
704     VstInt32 readCount;             ///< set by plug-in/Host
705     VstInt32 writeCount;            ///< set by plug-in
706     VstInt32 sizeInputBuffer;       ///< set by Host
707     VstInt32 sizeOutputBuffer;      ///< set by Host
708     void* inputBuffer;              ///< set by Host
709     void* outputBuffer;             ///< set by Host
710     double positionToProcessFrom;   ///< set by Host
711     double numFramesToProcess;      ///< set by Host
712     double maxFramesToWrite;        ///< set by plug-in
713 
714     // other data access
715     void* extraBuffer;              ///< set by plug-in
716     VstInt32 value;                 ///< set by Host or plug-in
717     VstInt32 index;                 ///< set by Host or plug-in
718 
719     // file attributes
720     double numFramesInSourceFile;   ///< set by Host
721     double sourceSampleRate;        ///< set by Host or plug-in
722     double destinationSampleRate;   ///< set by Host or plug-in
723     VstInt32 numSourceChannels;     ///< set by Host or plug-in
724     VstInt32 numDestinationChannels;///< set by Host or plug-in
725     VstInt32 sourceFormat;          ///< set by Host
726     VstInt32 destinationFormat;     ///< set by plug-in
727     char[512] outputText;           ///< set by plug-in or Host
728 
729     // progress notification
730     double progress;                ///< set by plug-in
731     VstInt32 progressMode;          ///< Reserved for future use
732     char[100] progressText;         ///< set by plug-in
733 
734     VstInt32 flags;                 ///< set by Host and plug-in; see enum #VstOfflineTaskFlags
735     VstInt32 returnValue;           ///< Reserved for future use
736     void* hostOwned;                ///< set by Host
737     void* plugOwned;                ///< set by plug-in
738 
739     char[1024] future;              ///< Reserved for future use
740 //-------------------------------------------------------------------------------------------------------
741 }
742 
743 //-------------------------------------------------------------------------------------------------------
744 /** Flags used in #VstOfflineTask. */
745 //-------------------------------------------------------------------------------------------------------
746 alias int VstOfflineTaskFlags;
747 enum : VstOfflineTaskFlags
748 {
749 //-------------------------------------------------------------------------------------------------------
750     kVstOfflineUnvalidParameter = 1 << 0,   ///< set by Host
751     kVstOfflineNewFile          = 1 << 1,   ///< set by Host
752 
753     kVstOfflinePlugError        = 1 << 10,  ///< set by plug-in
754     kVstOfflineInterleavedAudio = 1 << 11,  ///< set by plug-in
755     kVstOfflineTempOutputFile   = 1 << 12,  ///< set by plug-in
756     kVstOfflineFloatOutputFile  = 1 << 13,  ///< set by plug-in
757     kVstOfflineRandomWrite      = 1 << 14,  ///< set by plug-in
758     kVstOfflineStretch          = 1 << 15,  ///< set by plug-in
759     kVstOfflineNoThread         = 1 << 16   ///< set by plug-in
760 //-------------------------------------------------------------------------------------------------------
761 }
762 
763 //-------------------------------------------------------------------------------------------------------
764 /** Option passed to #offlineRead/#offlineWrite. */
765 //-------------------------------------------------------------------------------------------------------
766 alias int VstOfflineOption;
767 enum : VstOfflineOption
768 {
769 //-------------------------------------------------------------------------------------------------------
770    kVstOfflineAudio,        ///< reading/writing audio samples
771    kVstOfflinePeaks,        ///< reading graphic representation
772    kVstOfflineParameter,    ///< reading/writing parameters
773    kVstOfflineMarker,       ///< reading/writing marker
774    kVstOfflineCursor,       ///< reading/moving edit cursor
775    kVstOfflineSelection,    ///< reading/changing selection
776    kVstOfflineQueryFiles    ///< to request the Host to call asynchronously #offlineNotify
777 //-------------------------------------------------------------------------------------------------------
778 }
779 
780 //-------------------------------------------------------------------------------------------------------
781 /** Structure passed to #offlineNotify and #offlineStart */
782 //-------------------------------------------------------------------------------------------------------
783 struct VstAudioFile
784 {
785 //-------------------------------------------------------------------------------------------------------
786     VstInt32 flags;                 ///< see enum #VstAudioFileFlags
787     void* hostOwned;                ///< any data private to Host
788     void* plugOwned;                ///< any data private to plug-in
789     char[kVstMaxFileNameLen] name;  ///< file title
790     VstInt32 uniqueId;              ///< uniquely identify a file during a session
791     double sampleRate;              ///< file sample rate
792     VstInt32 numChannels;           ///< number of channels (1 for mono, 2 for stereo...)
793     double numFrames;               ///< number of frames in the audio file
794     VstInt32 format;                ///< Reserved for future use
795     double editCursorPosition;      ///< -1 if no such cursor
796     double selectionStart;          ///< frame index of first selected frame, or -1
797     double selectionSize;           ///< number of frames in selection, or 0
798     VstInt32 selectedChannelsMask;  ///< 1 bit per channel
799     VstInt32 numMarkers;            ///< number of markers in the file
800     VstInt32 timeRulerUnit;         ///< see doc for possible values
801     double timeRulerOffset;         ///< offset in time ruler (positive or negative)
802     double tempo;                   ///< as BPM (Beats Per Minute)
803     VstInt32 timeSigNumerator;      ///< time signature numerator
804     VstInt32 timeSigDenominator;    ///< time signature denominator
805     VstInt32 ticksPerBlackNote;     ///< resolution
806     VstInt32 smpteFrameRate;        ///< SMPTE rate (set as in #VstTimeInfo)
807 
808     char[64] future;                ///< Reserved for future use
809 //-------------------------------------------------------------------------------------------------------
810 }
811 
812 //-------------------------------------------------------------------------------------------------------
813 /** Flags used in #VstAudioFile. */
814 //-------------------------------------------------------------------------------------------------------
815 alias int VstAudioFileFlags;
816 enum : VstAudioFileFlags
817 {
818 //-------------------------------------------------------------------------------------------------------
819     kVstOfflineReadOnly             = 1 << 0,   ///< set by Host (in call #offlineNotify)
820     kVstOfflineNoRateConversion     = 1 << 1,   ///< set by Host (in call #offlineNotify)
821     kVstOfflineNoChannelChange      = 1 << 2,   ///< set by Host (in call #offlineNotify)
822 
823     kVstOfflineCanProcessSelection  = 1 << 10,  ///< set by plug-in (in call #offlineStart)
824     kVstOfflineNoCrossfade          = 1 << 11,  ///< set by plug-in (in call #offlineStart)
825     kVstOfflineWantRead             = 1 << 12,  ///< set by plug-in (in call #offlineStart)
826     kVstOfflineWantWrite            = 1 << 13,  ///< set by plug-in (in call #offlineStart)
827     kVstOfflineWantWriteMarker      = 1 << 14,  ///< set by plug-in (in call #offlineStart)
828     kVstOfflineWantMoveCursor       = 1 << 15,  ///< set by plug-in (in call #offlineStart)
829     kVstOfflineWantSelect           = 1 << 16   ///< set by plug-in (in call #offlineStart)
830 //-------------------------------------------------------------------------------------------------------
831 }
832 
833 //-------------------------------------------------------------------------------------------------------
834 /** Audio file marker. */
835 //-------------------------------------------------------------------------------------------------------
836 struct VstAudioFileMarker
837 {
838 //-------------------------------------------------------------------------------------------------------
839     double position;        ///< marker position
840     char[32] name;          ///< marker name
841     VstInt32 type;          ///< marker type
842     VstInt32 id;            ///< marker identifier
843     VstInt32 reserved;      ///< reserved for future use
844 //-------------------------------------------------------------------------------------------------------
845 }
846 
847 //-------------------------------------------------------------------------------------------------------
848 // Others
849 //-------------------------------------------------------------------------------------------------------
850 
851 //-------------------------------------------------------------------------------------------------------
852 /** \deprecated Structure used for #openWindow and #closeWindow (deprecated in VST 2.4). */
853 //-------------------------------------------------------------------------------------------------------
854 struct DEPRECATED_VstWindow
855 {
856 //-------------------------------------------------------------------------------------------------------
857     char[128] title;
858     VstInt16 xPos;
859     VstInt16 yPos;
860     VstInt16 width;
861     VstInt16 height;
862     VstInt32 style;
863     void* parent;
864     void* userHandle;
865     void* winHandle;
866 
867     char[104] future;
868 //-------------------------------------------------------------------------------------------------------
869 }
870 
871 //-------------------------------------------------------------------------------------------------------
872 /** Structure used for keyUp/keyDown. */
873 //-------------------------------------------------------------------------------------------------------
874 struct VstKeyCode
875 {
876 //-------------------------------------------------------------------------------------------------------
877     VstInt32 character;     ///< ASCII character
878     ubyte virt;     ///< @see VstVirtualKey
879     ubyte modifier; ///< @see VstModifierKey
880 //-------------------------------------------------------------------------------------------------------
881 }
882 
883 //-------------------------------------------------------------------------------------------------------
884 /** Platform-independent definition of Virtual Keys (used in #VstKeyCode). */
885 //-------------------------------------------------------------------------------------------------------
886 alias int VstVirtualKey;
887 enum : VstVirtualKey
888 {
889 //-------------------------------------------------------------------------------------------------------
890     VKEY_BACK = 1,
891     VKEY_TAB,
892     VKEY_CLEAR,
893     VKEY_RETURN,
894     VKEY_PAUSE,
895     VKEY_ESCAPE,
896     VKEY_SPACE,
897     VKEY_NEXT,
898     VKEY_END,
899     VKEY_HOME,
900     VKEY_LEFT,
901     VKEY_UP,
902     VKEY_RIGHT,
903     VKEY_DOWN,
904     VKEY_PAGEUP,
905     VKEY_PAGEDOWN,
906     VKEY_SELECT,
907     VKEY_PRINT,
908     VKEY_ENTER,
909     VKEY_SNAPSHOT,
910     VKEY_INSERT,
911     VKEY_DELETE,
912     VKEY_HELP,
913     VKEY_NUMPAD0,
914     VKEY_NUMPAD1,
915     VKEY_NUMPAD2,
916     VKEY_NUMPAD3,
917     VKEY_NUMPAD4,
918     VKEY_NUMPAD5,
919     VKEY_NUMPAD6,
920     VKEY_NUMPAD7,
921     VKEY_NUMPAD8,
922     VKEY_NUMPAD9,
923     VKEY_MULTIPLY,
924     VKEY_ADD,
925     VKEY_SEPARATOR,
926     VKEY_SUBTRACT,
927     VKEY_DECIMAL,
928     VKEY_DIVIDE,
929     VKEY_F1,
930     VKEY_F2,
931     VKEY_F3,
932     VKEY_F4,
933     VKEY_F5,
934     VKEY_F6,
935     VKEY_F7,
936     VKEY_F8,
937     VKEY_F9,
938     VKEY_F10,
939     VKEY_F11,
940     VKEY_F12,
941     VKEY_NUMLOCK,
942     VKEY_SCROLL,
943     VKEY_SHIFT,
944     VKEY_CONTROL,
945     VKEY_ALT,
946     VKEY_EQUALS
947 //-------------------------------------------------------------------------------------------------------
948 }
949 
950 //-------------------------------------------------------------------------------------------------------
951 /** Modifier flags used in #VstKeyCode. */
952 //-------------------------------------------------------------------------------------------------------
953 alias int VstModifierKey;
954 enum : VstModifierKey
955 {
956 //-------------------------------------------------------------------------------------------------------
957     MODIFIER_SHIFT     = 1<<0, ///< Shift
958     MODIFIER_ALTERNATE = 1<<1, ///< Alt
959     MODIFIER_COMMAND   = 1<<2, ///< Control on Mac
960     MODIFIER_CONTROL   = 1<<3  ///< Ctrl on PC, Apple on Mac
961 //-------------------------------------------------------------------------------------------------------
962 }
963 
964 //-------------------------------------------------------------------------------------------------------
965 /** File filter used in #VstFileSelect. */
966 //-------------------------------------------------------------------------------------------------------
967 struct VstFileType
968 {
969 //-------------------------------------------------------------------------------------------------------
970     char[128] name;             ///< display name
971     char[8] macType;            ///< MacOS type
972     char[8] dosType;            ///< Windows file extension
973     char[8] unixType;           ///< Unix file extension
974     char[128] mimeType1;        ///< MIME type
975     char[128] mimeType2;        ///< additional MIME type
976 
977     this(const char* _name, const char* _macType, const char* _dosType,
978          const char* _unixType, const char* _mimeType1, const char* _mimeType2)
979     {
980         vst_strncpy (name.ptr, _name ? _name : "", 127);
981         vst_strncpy (macType.ptr, _macType ? _macType : "", 7);
982         vst_strncpy (dosType.ptr, _dosType ? _dosType : "", 7);
983         vst_strncpy (unixType.ptr, _unixType ? _unixType : "", 7);
984         vst_strncpy (mimeType1.ptr, _mimeType1 ? _mimeType1 : "", 127);
985         vst_strncpy (mimeType2.ptr, _mimeType2 ? _mimeType2 : "", 127);
986     }
987 //-------------------------------------------------------------------------------------------------------
988 }
989 
990 //-------------------------------------------------------------------------------------------------------
991 /** File Selector Description used in #audioMasterOpenFileSelector. */
992 //-------------------------------------------------------------------------------------------------------
993 struct VstFileSelect
994 {
995 //-------------------------------------------------------------------------------------------------------
996     VstInt32 command;           ///< @see VstFileSelectCommand
997     VstInt32 type;              ///< @see VstFileSelectType
998     VstInt32 macCreator;        ///< optional: 0 = no creator
999     VstInt32 nbFileTypes;       ///< number of fileTypes
1000     VstFileType* fileTypes;     ///< list of fileTypes  @see VstFileType
1001     char[1024] title;           ///< text to display in file selector's title
1002     char* initialPath;          ///< initial path
1003     char* returnPath;           ///< use with #kVstFileLoad and #kVstDirectorySelect. null: Host allocates memory, plug-in must call #closeOpenFileSelector!
1004     VstInt32 sizeReturnPath;    ///< size of allocated memory for return paths
1005     char** returnMultiplePaths; ///< use with kVstMultipleFilesLoad. Host allocates memory, plug-in must call #closeOpenFileSelector!
1006     VstInt32 nbReturnPath;      ///< number of selected paths
1007     VstIntPtr reserved;         ///< reserved for Host application
1008 
1009     char[116] future;           ///< reserved for future use
1010 //-------------------------------------------------------------------------------------------------------
1011 }
1012 
1013 //-------------------------------------------------------------------------------------------------------
1014 /** Command constants used in #VstFileSelect structure. */
1015 //-------------------------------------------------------------------------------------------------------
1016 alias int VstFileSelectCommand;
1017 enum : VstFileSelectCommand
1018 {
1019 //-------------------------------------------------------------------------------------------------------
1020     kVstFileLoad = 0,       ///< for loading a file
1021     kVstFileSave,           ///< for saving a file
1022     kVstMultipleFilesLoad,  ///< for loading multiple files
1023     kVstDirectorySelect     ///< for selecting a directory/folder
1024 //-------------------------------------------------------------------------------------------------------
1025 }
1026 
1027 //-------------------------------------------------------------------------------------------------------
1028 /** Types used in #VstFileSelect structure. */
1029 //-------------------------------------------------------------------------------------------------------
1030 alias int VstFileSelectType;
1031 enum : VstFileSelectType
1032 {
1033 //-------------------------------------------------------------------------------------------------------
1034     kVstFileType = 0        ///< regular file selector
1035 //-------------------------------------------------------------------------------------------------------
1036 }
1037 
1038 //-------------------------------------------------------------------------------------------------------
1039 /** Structure used for #effBeginLoadBank/#effBeginLoadProgram. */
1040 //-------------------------------------------------------------------------------------------------------
1041 struct VstPatchChunkInfo
1042 {
1043 //-------------------------------------------------------------------------------------------------------
1044     VstInt32 version_;           ///< Format Version (should be 1)
1045     VstInt32 pluginUniqueID;    ///< UniqueID of the plug-in
1046     VstInt32 pluginVersion;     ///< Plug-in Version
1047     VstInt32 numElements;       ///< Number of Programs (Bank) or Parameters (Program)
1048 
1049     char[48] future;            ///< Reserved for future use
1050 //-------------------------------------------------------------------------------------------------------
1051 }
1052 
1053 //-------------------------------------------------------------------------------------------------------
1054 /** PanLaw Type. */
1055 //-------------------------------------------------------------------------------------------------------
1056 alias int VstPanLawType;
1057 enum : VstPanLawType
1058 {
1059 //-------------------------------------------------------------------------------------------------------
1060     kLinearPanLaw = 0,  ///< L = pan * M; R = (1 - pan) * M;
1061     kEqualPowerPanLaw   ///< L = pow (pan, 0.5) * M; R = pow ((1 - pan), 0.5) * M;
1062 //-------------------------------------------------------------------------------------------------------
1063 }
1064 
1065 //-------------------------------------------------------------------------------------------------------
1066 /** Process Levels returned by #audioMasterGetCurrentProcessLevel. */
1067 //-------------------------------------------------------------------------------------------------------
1068 alias int VstProcessLevels;
1069 enum : VstProcessLevels
1070 {
1071 //-------------------------------------------------------------------------------------------------------
1072     kVstProcessLevelUnknown = 0,    ///< not supported by Host
1073     kVstProcessLevelUser,           ///< 1: currently in user thread (GUI)
1074     kVstProcessLevelRealtime,       ///< 2: currently in audio thread (where process is called)
1075     kVstProcessLevelPrefetch,       ///< 3: currently in 'sequencer' thread (MIDI, timer etc)
1076     kVstProcessLevelOffline         ///< 4: currently offline processing and thus in user thread
1077 //-------------------------------------------------------------------------------------------------------
1078 }
1079 
1080 //-------------------------------------------------------------------------------------------------------
1081 /** Automation States returned by #audioMasterGetAutomationState. */
1082 //-------------------------------------------------------------------------------------------------------
1083 alias int VstAutomationStates;
1084 enum : VstAutomationStates
1085 {
1086 //-------------------------------------------------------------------------------------------------------
1087     kVstAutomationUnsupported = 0,  ///< not supported by Host
1088     kVstAutomationOff,              ///< off
1089     kVstAutomationRead,             ///< read
1090     kVstAutomationWrite,            ///< write
1091     kVstAutomationReadWrite         ///< read and write
1092 //-------------------------------------------------------------------------------------------------------
1093 }