2 * vestige.h - simple header to allow VeSTige compilation and eventually work
4 * Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
23 * This VeSTige header is included in this package in the good-faith
24 * belief that it has been cleanly and legally reverse engineered
25 * without reference to the official VST SDK and without its
26 * developer(s) having agreed to the VST SDK license agreement.
33 #define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
34 ( ( (int) b ) << 16 ) | \
35 ( ( (int) c ) << 8 ) | \
36 ( ( (int) d ) << 0 ) )
38 #define audioMasterAutomate 0
39 #define audioMasterVersion 1
40 #define audioMasterCurrentId 2
41 #define audioMasterIdle 3
42 #define audioMasterPinConnected 4
44 #define audioMasterWantMidi 6
45 #define audioMasterGetTime 7
46 #define audioMasterProcessEvents 8
47 #define audioMasterSetTime 9
48 #define audioMasterTempoAt 10
49 #define audioMasterGetNumAutomatableParameters 11
50 #define audioMasterGetParameterQuantization 12
51 #define audioMasterIOChanged 13
52 #define audioMasterNeedIdle 14
53 #define audioMasterSizeWindow 15
54 #define audioMasterGetSampleRate 16
55 #define audioMasterGetBlockSize 17
56 #define audioMasterGetInputLatency 18
57 #define audioMasterGetOutputLatency 19
58 #define audioMasterGetPreviousPlug 20
59 #define audioMasterGetNextPlug 21
60 #define audioMasterWillReplaceOrAccumulate 22
61 #define audioMasterGetCurrentProcessLevel 23
62 #define audioMasterGetAutomationState 24
63 #define audioMasterOfflineStart 25
64 #define audioMasterOfflineRead 26
65 #define audioMasterOfflineWrite 27
66 #define audioMasterOfflineGetCurrentPass 28
67 #define audioMasterOfflineGetCurrentMetaPass 29
68 #define audioMasterSetOutputSampleRate 30
70 #define audioMasterGetSpeakerArrangement 31 // deprecated in 2.4?
71 #define audioMasterGetVendorString 32
72 #define audioMasterGetProductString 33
73 #define audioMasterGetVendorVersion 34
74 #define audioMasterVendorSpecific 35
75 #define audioMasterSetIcon 36
76 #define audioMasterCanDo 37
77 #define audioMasterGetLanguage 38
78 #define audioMasterOpenWindow 39
79 #define audioMasterCloseWindow 40
80 #define audioMasterGetDirectory 41
81 #define audioMasterUpdateDisplay 42
82 #define audioMasterBeginEdit 43 //BeginGesture
83 #define audioMasterEndEdit 44 //EndGesture
84 #define audioMasterOpenFileSelector 45
85 #define audioMasterCloseFileSelector 46 // currently unused
86 #define audioMasterEditFile 47 // currently unused
87 #define audioMasterGetChunkFile 48 // currently unused
88 #define audioMasterGetInputSpeakerArrangement 49 // currently unused
90 #define effFlagsHasEditor 1
91 #define effFlagsCanReplacing (1 << 4) // very likely
92 #define effFlagsIsSynth (1 << 8) // currently unused
95 #define effClose 1 // currently unused
96 #define effSetProgram 2 // currently unused
97 #define effGetProgram 3 // currently unused
98 #define effGetProgramName 5 // currently unused
99 #define effGetParamName 8 // currently unused
100 #define effSetSampleRate 10
101 #define effSetBlockSize 11
102 #define effMainsChanged 12
103 #define effEditGetRect 13
104 #define effEditOpen 14
105 #define effEditClose 15
106 #define effEditIdle 19
107 #define effEditTop 20
108 #define effProcessEvents 25
109 // the next one from http://asseca.com/vst-24-specs/index.html
110 #define effGetPlugCategory 35
111 #define effGetEffectName 45
112 #define effGetVendorString 47
113 #define effGetProductString 48
114 #define effGetVendorVersion 49
115 #define effCanDo 51 // currently unused
116 /* from http://asseca.com/vst-24-specs/efIdle.html */
118 /* from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
119 #define effGetParameterProperties 56
120 #define effGetVstVersion 58 // currently unused
121 /* http://asseca.com/vst-24-specs/efShellGetNextPlugin.html */
122 #define effShellGetNextPlugin 70
123 /* The next two were gleaned from http://www.kvraudio.com/forum/printview.php?t=143587&start=0 */
124 #define effStartProcess 71
125 #define effStopProcess 72
127 #define effBeginSetProgram 67
128 #define effEndSetProgram 68
130 #ifdef WORDS_BIGENDIAN
132 #define kEffectMagic 0x50747356
135 #define kEffectMagic 0x56737450
138 #define kVstLangEnglish 1
139 #define kVstMidiType 1
141 struct RemoteVstPlugin;
143 #define kVstTransportChanged 1
144 #define kVstTransportPlaying (1 << 1)
145 #define kVstTransportCycleActive (1 << 2)
146 #define kVstTransportRecording (1 << 3)
148 #define kVstAutomationWriting (1 << 6)
149 #define kVstAutomationReading (1 << 7)
151 #define kVstNanosValid (1 << 8)
152 #define kVstPpqPosValid (1 << 9)
153 #define kVstTempoValid (1 << 10)
154 #define kVstBarsValid (1 << 11)
155 #define kVstCyclePosValid (1 << 12)
156 #define kVstTimeSigValid (1 << 13)
157 #define kVstSmpteValid (1 << 14)
158 #define kVstClockValid (1 << 15)
179 char noteOffVelocity;
186 typedef struct _VstMidiEvent VstMidiEvent;
191 char dump[sizeof (VstMidiEvent)];
195 typedef struct _VstEvent VstEvent;
207 /* constants from http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3740&sid=183f74631fee71a493316735e2b9f28b */
209 enum Vestige2StringConstants
211 VestigeMaxNameLen = 64,
212 VestigeMaxLabelLen = 128,
213 VestigeMaxShortLabelLen = 8,
214 VestigeMaxCategLabelLen = 24,
215 VestigeMaxFileNameLen = 100
219 /* constants from http://asseca.com/vst-24-specs/efGetPlugCategory.html */
223 kPlugCategUnknown = 0,
228 kPlugCategSpacializer,
231 kPlugCategRestoration,
232 kPlugCategOfflineProcess,
238 typedef struct _VstEvents VstEvents;
240 /* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
241 struct _VstParameterProperties
243 float stepFloat; /* float step */
244 float smallStepFloat; /* small float step */
245 float largeStepFloat; /* large float step */
246 char label[64]; /* parameter label */
247 int32_t flags; /* @see VstParameterFlags */
248 int32_t minInteger; /* integer minimum */
249 int32_t maxInteger; /* integer maximum */
250 int32_t stepInteger; /* integer step */
251 int32_t largeStepInteger; /* large integer step */
252 char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
253 int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
254 int16_t category; /* 0: no category, else group index + 1 */
255 int16_t numParametersInCategory; /* number of parameters in category */
256 int16_t reserved; /* zero */
257 char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
258 char future[16]; /* reserved for future use */
261 typedef struct _VstParameterProperties VstParameterProperties;
263 /* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
264 enum VstParameterFlags
266 kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
267 kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
268 kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
269 kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
270 kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
271 kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
272 kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
277 // Never use virtual functions!!!
281 intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
282 // process, quite sure 08-0b
283 void (* process) (struct _AEffect *, float **, float **, int);
284 // setParameter 0c-0f
285 void (* setParameter) (struct _AEffect *, int, float);
286 // getParameter 10-13
287 float (* getParameter) (struct _AEffect *, int);
298 // Fill somewhere 28-2b
301 // Zeroes 2c-2f 30-33 34-37 38-3b
302 char empty3[4 + 4 + 4];
305 // An object? pointer 40-43
313 // processReplacing 50-53
314 void (* processReplacing) (struct _AEffect *, float **, float **, int);
317 typedef struct _AEffect AEffect;
319 typedef struct _VstTimeInfo
321 /* info from online documentation of VST provided by Steinberg */
329 double cycleStartPos;
331 int32_t timeSigNumerator;
332 int32_t timeSigDenominator;
334 int32_t smpteFrameRate;
335 int32_t samplesToNextClock;
340 typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);