1 /**
2 * Translation of the VST SDK.
3 * Copyright: Steinberg.
4 * License:   To use this file you MUST agree with the Steinberg VST license included in the VST SDK.
5 * Authors:   D translation by Guillaume Piolat.
6 */
7 module dplug.vst.aeffectx;
8 
9 import dplug.vst.aeffect;
10 
11 align(8):
12 
13 /// String length limits (in characters excl. 0 byte).
14 alias int Vst2StringConstants;
15 enum : Vst2StringConstants
16 {
17     kVstMaxNameLen       = 64,  /// used for #MidiProgramName, #MidiProgramCategory, #MidiKeyName, #VstSpeakerProperties, #VstPinProperties
18     kVstMaxLabelLen      = 64,  /// used for #VstParameterProperties->label, #VstPinProperties->label
19     kVstMaxShortLabelLen = 8,   /// used for #VstParameterProperties->shortLabel, #VstPinProperties->shortLabel
20     kVstMaxCategLabelLen = 24,  /// used for #VstParameterProperties->label
21     kVstMaxFileNameLen   = 100  /// used for #VstAudioFile->name
22 }
23 
24 /// A generic timestamped event.
25 struct VstEvent
26 {
27     VstInt32 type;          ///< @see VstEventTypes
28     VstInt32 byteSize;      ///< size of this event, excl. type and byteSize
29     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
30     VstInt32 flags;         ///< generic flags, none defined yet
31 
32     char[16] data;          ///< data size may vary, depending on event type
33 }
34 
35 /// VstEvent Types used by #VstEvent.
36 alias int VstEventTypes;
37 enum : VstEventTypes
38 {
39     kVstMidiType = 1,       ///< MIDI event  @see VstMidiEvent
40     DEPRECATED_kVstAudioType,       ///< \deprecated unused event type
41     DEPRECATED_kVstVideoType,       ///< \deprecated unused event type
42     DEPRECATED_kVstParameterType,   ///< \deprecated unused event type
43     DEPRECATED_kVstTriggerType, ///< \deprecated unused event type
44     kVstSysExType           ///< MIDI system exclusive  @see VstMidiSysexEvent
45 }
46 
47 /// A block of events for the current processed audio block.
48 struct VstEvents
49 {
50     VstInt32 numEvents;     ///< number of Events in array
51     VstIntPtr reserved;     ///< zero (Reserved for future use)
52     VstEvent*[2] events;    ///< event pointer array, variable size
53 }
54 
55 /// MIDI Event (to be casted from VstEvent).
56 struct VstMidiEvent
57 {
58     VstInt32 type;          ///< #kVstMidiType
59     VstInt32 byteSize;      ///< sizeof (VstMidiEvent)
60     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
61     VstInt32 flags;         ///< @see VstMidiEventFlags
62     VstInt32 noteLength;    ///< (in sample frames) of entire note, if available, else 0
63     VstInt32 noteOffset;    ///< offset (in sample frames) into note from note start if available, else 0
64     char[4] midiData;       ///< 1 to 3 MIDI bytes; midiData[3] is reserved (zero)
65     char detune;            ///< -64 to +63 cents; for scales other than 'well-tempered' ('microtuning')
66     char noteOffVelocity;   ///< Note Off Velocity [0, 127]
67     char reserved1;         ///< zero (Reserved for future use)
68     char reserved2;         ///< zero (Reserved for future use)
69 }
70 
71 /// Flags used in #VstMidiEvent.
72 alias int VstMidiEventFlags;
73 enum : VstMidiEventFlags
74 {
75     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)
76 }
77 
78 /// MIDI Sysex Event (to be casted from #VstEvent).
79 struct VstMidiSysexEvent
80 {
81     VstInt32 type;          ///< #kVstSysexType
82     VstInt32 byteSize;      ///< sizeof (VstMidiSysexEvent)
83     VstInt32 deltaFrames;   ///< sample frames related to the current block start sample position
84     VstInt32 flags;         ///< none defined yet (should be zero)
85     VstInt32 dumpBytes;     ///< byte size of sysexDump
86     VstIntPtr resvd1;       ///< zero (Reserved for future use)
87     char* sysexDump;        ///< sysex dump
88     VstIntPtr resvd2;       ///< zero (Reserved for future use)
89 }
90 
91 //-------------------------------------------------------------------------------------------------------
92 // VstTimeInfo
93 //-------------------------------------------------------------------------------------------------------
94 //-------------------------------------------------------------------------------------------------------
95 /** VstTimeInfo requested via #audioMasterGetTime.  @see AudioEffectX::getTimeInfo
96 
97 \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.
98 \note VstTimeInfo::ppqPos : At tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000 samples at 48kHz sample rate.
99 .25 ppq is one sixteenth note then. if you need something like 480ppq, you simply multiply ppq by that scaler.
100 \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 :-).
101 \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.
102 */
103 //-------------------------------------------------------------------------------------------------------
104 struct VstTimeInfo
105 {
106     double samplePos;               ///< current Position in audio samples (always valid)
107     double sampleRate;              ///< current Sample Rate in Herz (always valid)
108     double nanoSeconds;             ///< System Time in nanoseconds (10^-9 second)
109     double ppqPos;                  ///< Musical Position, in Quarter Note (1.0 equals 1 Quarter Note)
110     double tempo;                   ///< current Tempo in BPM (Beats Per Minute)
111     double barStartPos;             ///< last Bar Start Position, in Quarter Note
112     double cycleStartPos;           ///< Cycle Start (left locator), in Quarter Note
113     double cycleEndPos;             ///< Cycle End (right locator), in Quarter Note
114     VstInt32 timeSigNumerator;      ///< Time Signature Numerator (e.g. 3 for 3/4)
115     VstInt32 timeSigDenominator;    ///< Time Signature Denominator (e.g. 4 for 3/4)
116     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.
117     VstInt32 smpteFrameRate;        ///< @see VstSmpteFrameRate
118     VstInt32 samplesToNextClock;    ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest clock)
119     VstInt32 flags;                 ///< @see VstTimeInfoFlags
120 }
121 
122 /// Flags used in #VstTimeInfo.
123 alias int VstTimeInfoFlags;
124 enum : VstTimeInfoFlags
125 {
126     kVstTransportChanged     = 1,       ///< indicates that play, cycle or record state has changed
127     kVstTransportPlaying     = 1 << 1,  ///< set if Host sequencer is currently playing
128     kVstTransportCycleActive = 1 << 2,  ///< set if Host sequencer is in cycle mode
129     kVstTransportRecording   = 1 << 3,  ///< set if Host sequencer is in record mode
130     kVstAutomationWriting    = 1 << 6,  ///< set if automation write mode active (record parameter changes)
131     kVstAutomationReading    = 1 << 7,  ///< set if automation read mode active (play parameter changes)
132     kVstNanosValid           = 1 << 8,  ///< VstTimeInfo::nanoSeconds valid
133     kVstPpqPosValid          = 1 << 9,  ///< VstTimeInfo::ppqPos valid
134     kVstTempoValid           = 1 << 10, ///< VstTimeInfo::tempo valid
135     kVstBarsValid            = 1 << 11, ///< VstTimeInfo::barStartPos valid
136     kVstCyclePosValid        = 1 << 12, ///< VstTimeInfo::cycleStartPos and VstTimeInfo::cycleEndPos valid
137     kVstTimeSigValid         = 1 << 13, ///< VstTimeInfo::timeSigNumerator and VstTimeInfo::timeSigDenominator valid
138     kVstSmpteValid           = 1 << 14, ///< VstTimeInfo::smpteOffset and VstTimeInfo::smpteFrameRate valid
139     kVstClockValid           = 1 << 15  ///< VstTimeInfo::samplesToNextClock valid
140 }
141 
142 //-------------------------------------------------------------------------------------------------------
143 /** SMPTE Frame Rates. */
144 //-------------------------------------------------------------------------------------------------------
145 alias int VstSmpteFrameRate;
146 enum : VstSmpteFrameRate
147 {
148 //-------------------------------------------------------------------------------------------------------
149     kVstSmpte24fps    = 0,      ///< 24 fps
150     kVstSmpte25fps    = 1,      ///< 25 fps
151     kVstSmpte2997fps  = 2,      ///< 29.97 fps
152     kVstSmpte30fps    = 3,      ///< 30 fps
153     kVstSmpte2997dfps = 4,      ///< 29.97 drop
154     kVstSmpte30dfps   = 5,      ///< 30 drop
155 
156     kVstSmpteFilm16mm = 6,      ///< Film 16mm
157     kVstSmpteFilm35mm = 7,      ///< Film 35mm
158     kVstSmpte239fps   = 10,     ///< HDTV: 23.976 fps
159     kVstSmpte249fps   = 11,     ///< HDTV: 24.976 fps
160     kVstSmpte599fps   = 12,     ///< HDTV: 59.94 fps
161     kVstSmpte60fps    = 13      ///< HDTV: 60 fps
162 //-------------------------------------------------------------------------------------------------------
163 };
164 
165 //-------------------------------------------------------------------------------------------------------
166 /** Variable IO for Offline Processing. */
167 //-------------------------------------------------------------------------------------------------------
168 struct VstVariableIo
169 {
170 //-------------------------------------------------------------------------------------------------------
171     float** inputs;                             ///< input audio buffers
172     float** outputs;                            ///< output audio buffers
173     VstInt32 numSamplesInput;                   ///< number of incoming samples
174     VstInt32 numSamplesOutput;                  ///< number of outgoing samples
175     VstInt32* numSamplesInputProcessed;         ///< number of samples actually processed of input
176     VstInt32* numSamplesOutputProcessed;        ///< number of samples actually processed of output
177 //-------------------------------------------------------------------------------------------------------
178 };
179 
180 //-------------------------------------------------------------------------------------------------------
181 /** Language code returned by audioMasterGetLanguage. */
182 //-------------------------------------------------------------------------------------------------------
183 alias int VstHostLanguage;
184 enum : VstHostLanguage
185 {
186 //-------------------------------------------------------------------------------------------------------
187     kVstLangEnglish = 1,    ///< English
188     kVstLangGerman,         ///< German
189     kVstLangFrench,         ///< French
190     kVstLangItalian,        ///< Italian
191     kVstLangSpanish,        ///< Spanish
192     kVstLangJapanese        ///< Japanese
193 //-------------------------------------------------------------------------------------------------------
194 };
195 
196 //-------------------------------------------------------------------------------------------------------
197 /** VST 2.x dispatcher Opcodes (Plug-in to Host). Extension of #AudioMasterOpcodes */
198 //-------------------------------------------------------------------------------------------------------
199 
200 alias int AudioMasterOpcodesX;
201 enum : AudioMasterOpcodesX
202 {
203 //-------------------------------------------------------------------------------------------------------
204     DEPRECATED_audioMasterWantMidi = DEPRECATED_audioMasterPinConnected + 2,    ///< \deprecated deprecated in VST 2.4
205 
206     audioMasterGetTime,             ///< [return value]: #VstTimeInfo* or null if not supported [value]: request mask  @see VstTimeInfoFlags @see AudioEffectX::getTimeInfo
207     audioMasterProcessEvents,       ///< [ptr]: pointer to #VstEvents  @see VstEvents @see AudioEffectX::sendVstEventsToHost
208 
209     DEPRECATED_audioMasterSetTime,    ///< \deprecated deprecated in VST 2.4
210     DEPRECATED_audioMasterTempoAt,    ///< \deprecated deprecated in VST 2.4
211     DEPRECATED_audioMasterGetNumAutomatableParameters,    ///< \deprecated deprecated in VST 2.4
212     DEPRECATED_audioMasterGetParameterQuantization,       ///< \deprecated deprecated in VST 2.4
213 
214     audioMasterIOChanged,           ///< [return value]: 1 if supported  @see AudioEffectX::ioChanged
215 
216     DEPRECATED_audioMasterNeedIdle,   ///< \deprecated deprecated in VST 2.4
217 
218     audioMasterSizeWindow,          ///< [index]: width [value]: height [return value]: 1 if supported  @see AudioEffectX::sizeWindow
219     audioMasterGetSampleRate,       ///< [return value]: current sample rate  @see AudioEffectX::updateSampleRate
220     audioMasterGetBlockSize,        ///< [return value]: current block size  @see AudioEffectX::updateBlockSize
221     audioMasterGetInputLatency,     ///< [return value]: input latency in audio samples  @see AudioEffectX::getInputLatency
222     audioMasterGetOutputLatency,    ///< [return value]: output latency in audio samples  @see AudioEffectX::getOutputLatency
223 
224     DEPRECATED_audioMasterGetPreviousPlug,            ///< \deprecated deprecated in VST 2.4
225     DEPRECATED_audioMasterGetNextPlug,                ///< \deprecated deprecated in VST 2.4
226     DEPRECATED_audioMasterWillReplaceOrAccumulate,    ///< \deprecated deprecated in VST 2.4
227 
228     audioMasterGetCurrentProcessLevel,  ///< [return value]: current process level  @see VstProcessLevels
229     audioMasterGetAutomationState,      ///< [return value]: current automation state  @see VstAutomationStates
230 
231     audioMasterOfflineStart,            ///< [index]: numNewAudioFiles [value]: numAudioFiles [ptr]: #VstAudioFile*  @see AudioEffectX::offlineStart
232     audioMasterOfflineRead,             ///< [index]: bool readSource [value]: #VstOfflineOption* @see VstOfflineOption [ptr]: #VstOfflineTask*  @see VstOfflineTask @see AudioEffectX::offlineRead
233     audioMasterOfflineWrite,            ///< @see audioMasterOfflineRead @see AudioEffectX::offlineRead
234     audioMasterOfflineGetCurrentPass,   ///< @see AudioEffectX::offlineGetCurrentPass
235     audioMasterOfflineGetCurrentMetaPass,   ///< @see AudioEffectX::offlineGetCurrentMetaPass
236 
237     DEPRECATED_audioMasterSetOutputSampleRate,            ///< \deprecated deprecated in VST 2.4
238     DEPRECATED_audioMasterGetOutputSpeakerArrangement,    ///< \deprecated deprecated in VST 2.4
239 
240     audioMasterGetVendorString,         ///< [ptr]: char buffer for vendor string, limited to #kVstMaxVendorStrLen  @see AudioEffectX::getHostVendorString
241     audioMasterGetProductString,        ///< [ptr]: char buffer for vendor string, limited to #kVstMaxProductStrLen  @see AudioEffectX::getHostProductString
242     audioMasterGetVendorVersion,        ///< [return value]: vendor-specific version  @see AudioEffectX::getHostVendorVersion
243     audioMasterVendorSpecific,          ///< no definition, vendor specific handling  @see AudioEffectX::hostVendorSpecific
244 
245     DEPRECATED_audioMasterSetIcon,        ///< \deprecated deprecated in VST 2.4
246 
247     audioMasterCanDo,                   ///< [ptr]: "can do" string [return value]: 1 for supported
248     audioMasterGetLanguage,             ///< [return value]: language code  @see VstHostLanguage
249 
250     DEPRECATED_audioMasterOpenWindow,     ///< \deprecated deprecated in VST 2.4
251     DEPRECATED_audioMasterCloseWindow,    ///< \deprecated deprecated in VST 2.4
252 
253     audioMasterGetDirectory,            ///< [return value]: FSSpec on MAC, else char*  @see AudioEffectX::getDirectory
254     audioMasterUpdateDisplay,           ///< no arguments
255     audioMasterBeginEdit,               ///< [index]: parameter index  @see AudioEffectX::beginEdit
256     audioMasterEndEdit,                 ///< [index]: parameter index  @see AudioEffectX::endEdit
257     audioMasterOpenFileSelector,        ///< [ptr]: VstFileSelect* [return value]: 1 if supported  @see AudioEffectX::openFileSelector
258     audioMasterCloseFileSelector,       ///< [ptr]: VstFileSelect*  @see AudioEffectX::closeFileSelector
259 
260     DEPRECATED_audioMasterEditFile,       ///< \deprecated deprecated in VST 2.4
261 
262     DEPRECATED_audioMasterGetChunkFile,   ///< \deprecated deprecated in VST 2.4 [ptr]: char[2048] or sizeof (FSSpec) [return value]: 1 if supported  @see AudioEffectX::getChunkFile
263 
264     DEPRECATED_audioMasterGetInputSpeakerArrangement  ///< \deprecated deprecated in VST 2.4
265 }
266 
267 //-------------------------------------------------------------------------------------------------------
268 /** VST 2.x dispatcher Opcodes (Host to Plug-in). Extension of #AEffectOpcodes */
269 //-------------------------------------------------------------------------------------------------------
270 alias int AEffectXOpcodes;
271 enum : AEffectXOpcodes
272 {
273 //-------------------------------------------------------------------------------------------------------
274     effProcessEvents = effSetChunk + 1      ///< [ptr]: #VstEvents*  @see AudioEffectX::processEvents
275 
276     , effCanBeAutomated                     ///< [index]: parameter index [return value]: 1=true, 0=false  @see AudioEffectX::canParameterBeAutomated
277     , effString2Parameter                   ///< [index]: parameter index [ptr]: parameter string [return value]: true for success  @see AudioEffectX::string2parameter
278 
279     , DEPRECATED_effGetNumProgramCategories   ///< \deprecated deprecated in VST 2.4
280 
281     , effGetProgramNameIndexed              ///< [index]: program index [ptr]: buffer for program name, limited to #kVstMaxProgNameLen [return value]: true for success  @see AudioEffectX::getProgramNameIndexed
282 
283     , DEPRECATED_effCopyProgram   ///< \deprecated deprecated in VST 2.4
284     , DEPRECATED_effConnectInput  ///< \deprecated deprecated in VST 2.4
285     , DEPRECATED_effConnectOutput ///< \deprecated deprecated in VST 2.4
286 
287     , effGetInputProperties                 ///< [index]: input index [ptr]: #VstPinProperties* [return value]: 1 if supported  @see AudioEffectX::getInputProperties
288     , effGetOutputProperties                ///< [index]: output index [ptr]: #VstPinProperties* [return value]: 1 if supported  @see AudioEffectX::getOutputProperties
289     , effGetPlugCategory                    ///< [return value]: category  @see VstPlugCategory @see AudioEffectX::getPlugCategory
290 
291     , DEPRECATED_effGetCurrentPosition    ///< \deprecated deprecated in VST 2.4
292     , DEPRECATED_effGetDestinationBuffer  ///< \deprecated deprecated in VST 2.4
293 
294     , effOfflineNotify                      ///< [ptr]: #VstAudioFile array [value]: count [index]: start flag  @see AudioEffectX::offlineNotify
295     , effOfflinePrepare                     ///< [ptr]: #VstOfflineTask array [value]: count  @see AudioEffectX::offlinePrepare
296     , effOfflineRun                         ///< [ptr]: #VstOfflineTask array [value]: count  @see AudioEffectX::offlineRun
297 
298     , effProcessVarIo                       ///< [ptr]: #VstVariableIo*  @see AudioEffectX::processVariableIo
299     , effSetSpeakerArrangement              ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement*  @see AudioEffectX::setSpeakerArrangement
300 
301     , DEPRECATED_effSetBlockSizeAndSampleRate ///< \deprecated deprecated in VST 2.4
302 
303     , effSetBypass                          ///< [value]: 1 = bypass, 0 = no bypass  @see AudioEffectX::setBypass
304     , effGetEffectName                      ///< [ptr]: buffer for effect name, limited to #kVstMaxEffectNameLen  @see AudioEffectX::getEffectName
305 
306     , DEPRECATED_effGetErrorText  ///< \deprecated deprecated in VST 2.4
307 
308     , effGetVendorString                    ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxVendorStrLen  @see AudioEffectX::getVendorString
309     , effGetProductString                   ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxProductStrLen  @see AudioEffectX::getProductString
310     , effGetVendorVersion                   ///< [return value]: vendor-specific version  @see AudioEffectX::getVendorVersion
311     , effVendorSpecific                     ///< no definition, vendor specific handling  @see AudioEffectX::vendorSpecific
312     , effCanDo                              ///< [ptr]: "can do" string [return value]: 0: "don't know" -1: "no" 1: "yes"  @see AudioEffectX::canDo
313     , effGetTailSize                        ///< [return value]: tail size (for example the reverb time of a reverb plug-in); 0 is default (return 1 for 'no tail')
314 
315     , DEPRECATED_effIdle              ///< \deprecated deprecated in VST 2.4
316     , DEPRECATED_effGetIcon           ///< \deprecated deprecated in VST 2.4
317     , DEPRECATED_effSetViewPosition   ///< \deprecated deprecated in VST 2.4
318 
319     , effGetParameterProperties             ///< [index]: parameter index [ptr]: #VstParameterProperties* [return value]: 1 if supported  @see AudioEffectX::getParameterProperties
320 
321     , DEPRECATED_effKeysRequired  ///< \deprecated deprecated in VST 2.4
322 
323     , effGetVstVersion                      ///< [return value]: VST version  @see AudioEffectX::getVstVersion
324 
325     // VST 2.1
326     , effEditKeyDown                        ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used  @see AEffEditor::onKeyDown
327     , effEditKeyUp                          ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used  @see AEffEditor::onKeyUp
328     , effSetEditKnobMode                    ///< [value]: knob mode 0: circular, 1: circular relativ, 2: linear (CKnobMode in VSTGUI)  @see AEffEditor::setKnobMode
329 
330     , effGetMidiProgramName                 ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: number of used programs, 0 if unsupported  @see AudioEffectX::getMidiProgramName
331     , effGetCurrentMidiProgram              ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: index of current program  @see AudioEffectX::getCurrentMidiProgram
332     , effGetMidiProgramCategory             ///< [index]: MIDI channel [ptr]: #MidiProgramCategory* [return value]: number of used categories, 0 if unsupported  @see AudioEffectX::getMidiProgramCategory
333     , effHasMidiProgramsChanged             ///< [index]: MIDI channel [return value]: 1 if the #MidiProgramName(s) or #MidiKeyName(s) have changed  @see AudioEffectX::hasMidiProgramsChanged
334     , effGetMidiKeyName                     ///< [index]: MIDI channel [ptr]: #MidiKeyName* [return value]: true if supported, false otherwise  @see AudioEffectX::getMidiKeyName
335 
336     , effBeginSetProgram                    ///< no arguments  @see AudioEffectX::beginSetProgram
337     , effEndSetProgram                      ///< no arguments  @see AudioEffectX::endSetProgram
338 
339     // VST 2.3
340     , effGetSpeakerArrangement              ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement*  @see AudioEffectX::getSpeakerArrangement
341     , effShellGetNextPlugin                 ///< [ptr]: buffer for plug-in name, limited to #kVstMaxProductStrLen [return value]: next plugin's uniqueID  @see AudioEffectX::getNextShellPlugin
342 
343     , effStartProcess                       ///< no arguments  @see AudioEffectX::startProcess
344     , effStopProcess                        ///< no arguments  @see AudioEffectX::stopProcess
345     , effSetTotalSampleToProcess            ///< [value]: number of samples to process, offline only!  @see AudioEffectX::setTotalSampleToProcess
346     , effSetPanLaw                          ///< [value]: pan law [opt]: gain  @see VstPanLawType @see AudioEffectX::setPanLaw
347 
348     , effBeginLoadBank                      ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: bank can't be loaded, 1: bank can be loaded, 0: unsupported  @see AudioEffectX::beginLoadBank
349     , effBeginLoadProgram                   ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: prog can't be loaded, 1: prog can be loaded, 0: unsupported  @see AudioEffectX::beginLoadProgram
350 
351     // VST 2.4
352     , effSetProcessPrecision                ///< [value]: @see VstProcessPrecision  @see AudioEffectX::setProcessPrecision
353     , effGetNumMidiInputChannels            ///< [return value]: number of used MIDI input channels (1-15)  @see AudioEffectX::getNumMidiInputChannels
354     , effGetNumMidiOutputChannels           ///< [return value]: number of used MIDI output channels (1-15)  @see AudioEffectX::getNumMidiOutputChannels
355 }
356 
357 //-------------------------------------------------------------------------------------------------------
358 /** Symbolic precision constants used for effSetProcessPrecision. */
359 //-------------------------------------------------------------------------------------------------------
360 alias int VstProcessPrecision;
361 enum : VstProcessPrecision
362 {
363     kVstProcessPrecision32 = 0,     ///< single precision float (32bits)
364     kVstProcessPrecision64          ///< double precision (64bits)
365 }
366 
367 //-------------------------------------------------------------------------------------------------------
368 /** Parameter Properties used in #effGetParameterProperties. */
369 //-------------------------------------------------------------------------------------------------------
370 struct VstParameterProperties
371 {
372 //-------------------------------------------------------------------------------------------------------
373     float stepFloat;            ///< float step
374     float smallStepFloat;       ///< small float step
375     float largeStepFloat;       ///< large float step
376     char[kVstMaxLabelLen] label;///< parameter label
377     VstInt32 flags;             ///< @see VstParameterFlags
378     VstInt32 minInteger;        ///< integer minimum
379     VstInt32 maxInteger;        ///< integer maximum
380     VstInt32 stepInteger;       ///< integer step
381     VstInt32 largeStepInteger;  ///< large integer step
382     char[kVstMaxShortLabelLen] shortLabel;  ///< short label, recommended: 6 + delimiter
383 
384     // The following are for remote controller display purposes.
385     // Note that the kVstParameterSupportsDisplayIndex flag must be set.
386     // Host can scan all parameters, and find out in what order
387     // to display them:
388 
389     VstInt16 displayIndex;      ///< index where this parameter should be displayed (starting with 0)
390 
391     // Host can also possibly display the parameter group (category), such as...
392     // ---------------------------
393     // Osc 1
394     // Wave  Detune  Octave  Mod
395     // ---------------------------
396     // ...if the plug-in supports it (flag #kVstParameterSupportsDisplayCategory)
397 
398     VstInt16 category;          ///< 0: no category, else group index + 1
399     VstInt16 numParametersInCategory;           ///< number of parameters in category
400     VstInt16 reserved;          ///< zero
401     char[kVstMaxCategLabelLen] categoryLabel;   ///< category label, e.g. "Osc 1"
402 
403     char[16] future;            ///< reserved for future use
404 //-------------------------------------------------------------------------------------------------------
405 }
406 
407 //-------------------------------------------------------------------------------------------------------
408 /** Flags used in #VstParameterProperties. */
409 //-------------------------------------------------------------------------------------------------------
410 alias int VstParameterFlags;
411 enum : VstParameterFlags
412 {
413 //-------------------------------------------------------------------------------------------------------
414     kVstParameterIsSwitch                = 1 << 0,  ///< parameter is a switch (on/off)
415     kVstParameterUsesIntegerMinMax       = 1 << 1,  ///< minInteger, maxInteger valid
416     kVstParameterUsesFloatStep           = 1 << 2,  ///< stepFloat, smallStepFloat, largeStepFloat valid
417     kVstParameterUsesIntStep             = 1 << 3,  ///< stepInteger, largeStepInteger valid
418     kVstParameterSupportsDisplayIndex    = 1 << 4,  ///< displayIndex valid
419     kVstParameterSupportsDisplayCategory = 1 << 5,  ///< category, etc. valid
420     kVstParameterCanRamp                 = 1 << 6   ///< set if parameter value can ramp up/down
421 //-------------------------------------------------------------------------------------------------------
422 }
423 
424 //-------------------------------------------------------------------------------------------------------
425 /** Pin Properties used in #effGetInputProperties and #effGetOutputProperties. */
426 //-------------------------------------------------------------------------------------------------------
427 struct VstPinProperties
428 {
429 //-------------------------------------------------------------------------------------------------------
430     char[kVstMaxLabelLen] label;    ///< pin name
431     VstInt32 flags;                 ///< @see VstPinPropertiesFlags
432     VstInt32 arrangementType;       ///< @see VstSpeakerArrangementType
433     char[kVstMaxShortLabelLen] shortLabel;  ///< short name (recommended: 6 + delimiter)
434 
435     char[48] future;                ///< reserved for future use
436 //-------------------------------------------------------------------------------------------------------
437 }
438 
439 //-------------------------------------------------------------------------------------------------------
440 /** Flags used in #VstPinProperties. */
441 //-------------------------------------------------------------------------------------------------------
442 alias int VstPinPropertiesFlags;
443 enum : VstPinPropertiesFlags
444 {
445 //-------------------------------------------------------------------------------------------------------
446     kVstPinIsActive   = 1 << 0,     ///< pin is active, ignored by Host
447     kVstPinIsStereo   = 1 << 1,     ///< pin is first of a stereo pair
448     kVstPinUseSpeaker = 1 << 2      ///< #VstPinProperties::arrangementType is valid and can be used to get the wanted arrangement
449 //-------------------------------------------------------------------------------------------------------
450 }
451 
452 //-------------------------------------------------------------------------------------------------------
453 /** Plug-in Categories. */
454 //-------------------------------------------------------------------------------------------------------
455 alias int VstPlugCategory;
456 enum : VstPlugCategory
457 {
458 //-------------------------------------------------------------------------------------------------------
459     kPlugCategUnknown = 0,      ///< Unknown, category not implemented
460     kPlugCategEffect,           ///< Simple Effect
461     kPlugCategSynth,            ///< VST Instrument (Synths, samplers,...)
462     kPlugCategAnalysis,         ///< Scope, Tuner, ...
463     kPlugCategMastering,        ///< Dynamics, ...
464     kPlugCategSpacializer,      ///< Panners, ...
465     kPlugCategRoomFx,           ///< Delays and Reverbs
466     kPlugSurroundFx,            ///< Dedicated surround processor
467     kPlugCategRestoration,      ///< Denoiser, ...
468     kPlugCategOfflineProcess,   ///< Offline Process
469     kPlugCategShell,            ///< Plug-in is container of other plug-ins  @see effShellGetNextPlugin
470     kPlugCategGenerator,        ///< ToneGenerator, ...
471 
472     kPlugCategMaxCount          ///< Marker to count the categories
473 //-------------------------------------------------------------------------------------------------------
474 }
475 
476 //-------------------------------------------------------------------------------------------------------
477 // MIDI Programs
478 //-------------------------------------------------------------------------------------------------------
479 //-------------------------------------------------------------------------------------------------------
480 /** MIDI Program Description. */
481 //-------------------------------------------------------------------------------------------------------
482 struct MidiProgramName
483 {
484 //-------------------------------------------------------------------------------------------------------
485     VstInt32 thisProgramIndex;      ///< 0 or greater: fill struct for this program index
486     char[kVstMaxNameLen] name;      ///< program name
487     char midiProgram;               ///< -1:off, 0-127
488     char midiBankMsb;               ///< -1:off, 0-127
489     char midiBankLsb;               ///< -1:off, 0-127
490     char reserved;                  ///< zero
491     VstInt32 parentCategoryIndex;   ///< -1:no parent category
492     VstInt32 flags;                 ///< omni etc. @see VstMidiProgramNameFlags
493 //-------------------------------------------------------------------------------------------------------
494 }
495 
496 //-------------------------------------------------------------------------------------------------------
497 /** Flags used in MidiProgramName. */
498 //-------------------------------------------------------------------------------------------------------
499 alias int VstMidiProgramNameFlags;
500 enum : VstMidiProgramNameFlags
501 {
502 //-------------------------------------------------------------------------------------------------------
503     kMidiIsOmni = 1 ///< default is multi. for omni mode, channel 0 is used for inquiries and program changes
504 //-------------------------------------------------------------------------------------------------------
505 }
506 
507 //-------------------------------------------------------------------------------------------------------
508 /** MIDI Program Category. */
509 //-------------------------------------------------------------------------------------------------------
510 struct MidiProgramCategory
511 {
512 //-------------------------------------------------------------------------------------------------------
513     VstInt32 thisCategoryIndex;     ///< 0 or greater:  fill struct for this category index.
514     char[kVstMaxNameLen] name;      ///< name
515     VstInt32 parentCategoryIndex;   ///< -1:no parent category
516     VstInt32 flags;                 ///< reserved, none defined yet, zero.
517 //-------------------------------------------------------------------------------------------------------
518 }
519 
520 //-------------------------------------------------------------------------------------------------------
521 /** MIDI Key Description. */
522 //-------------------------------------------------------------------------------------------------------
523 struct MidiKeyName
524 {
525 //-------------------------------------------------------------------------------------------------------
526     VstInt32 thisProgramIndex;      ///< 0 or greater:  fill struct for this program index.
527     VstInt32 thisKeyNumber;         ///< 0 - 127. fill struct for this key number.
528     char[kVstMaxNameLen] keyName;   ///< key name, empty means regular key names
529     VstInt32 reserved;              ///< zero
530     VstInt32 flags;                 ///< reserved, none defined yet, zero.
531 //-------------------------------------------------------------------------------------------------------
532 }
533 
534 //-------------------------------------------------------------------------------------------------------
535 // Surround Setup
536 //-------------------------------------------------------------------------------------------------------
537 //-------------------------------------------------------------------------------------------------------
538 /** Speaker Properties.
539     The origin for azimuth is right (as by math conventions dealing with radians).
540     The elevation origin is also right, visualizing a rotation of a circle across the
541     -pi/pi axis of the horizontal circle. Thus, an elevation of -pi/2 corresponds
542     to bottom, and a speaker standing on the left, and 'beaming' upwards would have
543     an azimuth of -pi, and an elevation of pi/2.
544     For user interface representation, grads are more likely to be used, and the
545     origins will obviously 'shift' accordingly. */
546 //-------------------------------------------------------------------------------------------------------
547 struct VstSpeakerProperties
548 {
549 //-------------------------------------------------------------------------------------------------------
550     float azimuth;      ///< unit: rad, range: -PI...PI, exception: 10.f for LFE channel
551     float elevation;    ///< unit: rad, range: -PI/2...PI/2, exception: 10.f for LFE channel
552     float radius;       ///< unit: meter, exception: 0.f for LFE channel
553     float reserved;     ///< zero (reserved for future use)
554     char[kVstMaxNameLen] name;  ///< for other setups, other names should be given (L/R/C... won't do)
555     VstInt32 type;      ///< @see VstSpeakerType
556 
557     char[28] future;    ///< reserved for future use
558 //-------------------------------------------------------------------------------------------------------
559 }
560 
561 //-------------------------------------------------------------------------------------------------------
562 /** Speaker Arrangement. */
563 //-------------------------------------------------------------------------------------------------------
564 struct VstSpeakerArrangement
565 {
566 //-------------------------------------------------------------------------------------------------------
567     VstInt32 type;                      ///< e.g. #kSpeakerArr51 for 5.1  @see VstSpeakerArrangementType
568     VstInt32 numChannels;               ///< number of channels in this speaker arrangement
569     VstSpeakerProperties[8] speakers;   ///< variable sized speaker array
570 //-------------------------------------------------------------------------------------------------------
571 }
572 
573 //-------------------------------------------------------------------------------------------------------
574 /** Speaker Types. */
575 //-------------------------------------------------------------------------------------------------------
576 alias int VstSpeakerType;
577 enum : VstSpeakerType
578 {
579 //-------------------------------------------------------------------------------------------------------
580     kSpeakerUndefined = 0x7fffffff, ///< Undefined
581     kSpeakerM = 0,                  ///< Mono (M)
582     kSpeakerL,                      ///< Left (L)
583     kSpeakerR,                      ///< Right (R)
584     kSpeakerC,                      ///< Center (C)
585     kSpeakerLfe,                    ///< Subbass (Lfe)
586     kSpeakerLs,                     ///< Left Surround (Ls)
587     kSpeakerRs,                     ///< Right Surround (Rs)
588     kSpeakerLc,                     ///< Left of Center (Lc)
589     kSpeakerRc,                     ///< Right of Center (Rc)
590     kSpeakerS,                      ///< Surround (S)
591     kSpeakerCs = kSpeakerS,         ///< Center of Surround (Cs) = Surround (S)
592     kSpeakerSl,                     ///< Side Left (Sl)
593     kSpeakerSr,                     ///< Side Right (Sr)
594     kSpeakerTm,                     ///< Top Middle (Tm)
595     kSpeakerTfl,                    ///< Top Front Left (Tfl)
596     kSpeakerTfc,                    ///< Top Front Center (Tfc)
597     kSpeakerTfr,                    ///< Top Front Right (Tfr)
598     kSpeakerTrl,                    ///< Top Rear Left (Trl)
599     kSpeakerTrc,                    ///< Top Rear Center (Trc)
600     kSpeakerTrr,                    ///< Top Rear Right (Trr)
601     kSpeakerLfe2                    ///< Subbass 2 (Lfe2)
602 //-------------------------------------------------------------------------------------------------------
603 }
604 
605 //-------------------------------------------------------------------------------------------------------
606 /** User-defined speaker types, to be extended in the negative range.
607     Will be handled as their corresponding speaker types with abs values:
608     e.g abs(#kSpeakerU1) == #kSpeakerL, abs(#kSpeakerU2) == #kSpeakerR */
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 }