Ardour  9.0-pre0-582-g084a23a80d
vestige.h
Go to the documentation of this file.
1 /*
2  * vestige.h - simple header to allow VeSTige compilation and eventually work
3  *
4  * Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
5  *
6  * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
7  *
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.
12  *
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.
17  *
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.
22  *
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.
27  */
28 
29 #include <stdint.h>
30 #ifndef _VESTIGE_H
31 #define _VESTIGE_H
32 
33 #define CCONST(a, b, c, d) (( ((int) a) << 24 ) | \
34  ( ((int) b) << 16 ) | \
35  ( ((int) c) << 8 ) | \
36  ( ((int) d) << 0 ))
37 
38 #define audioMasterAutomate 0
39 #define audioMasterVersion 1
40 #define audioMasterCurrentId 2
41 #define audioMasterIdle 3
42 #define audioMasterPinConnected 4
43 // unsupported? 5
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
69 // unsupported? 31
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
89 
90 #define effFlagsHasEditor 1
91 #define effFlagsCanReplacing (1 << 4) // very likely
92 #define effFlagsIsSynth (1 << 8) // currently unused
93 
94 #define effOpen 0
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 #define effCanBeAutomated 26
110 // the next one from http://asseca.com/vst-24-specs/index.html
111 #define effGetPlugCategory 35
112 #define effGetEffectName 45
113 #define effGetVendorString 47
114 #define effGetProductString 48
115 #define effGetVendorVersion 49
116 #define effCanDo 51 // currently unused
117 /* from http://asseca.com/vst-24-specs/efIdle.html */
118 #define effIdle 53
119 /* from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
120 #define effGetParameterProperties 56
121 #define effGetVstVersion 58 // currently unused
122 /* http://asseca.com/vst-24-specs/efShellGetNextPlugin.html */
123 #define effShellGetNextPlugin 70
124 /* The next two were gleaned from http://www.kvraudio.com/forum/printview.php?t=143587&start=0 */
125 #define effStartProcess 71
126 #define effStopProcess 72
127 
128 #define effBeginSetProgram 67
129 #define effEndSetProgram 68
130 
131 #ifdef WORDS_BIGENDIAN
132 // "VstP"
133 #define kEffectMagic 0x50747356
134 #else
135 // "PtsV"
136 #define kEffectMagic 0x56737450
137 #endif
138 
139 #define kVstLangEnglish 1
140 #define kVstMidiType 1
141 
142 struct RemoteVstPlugin;
143 
144 #define kVstTransportChanged 1
145 #define kVstTransportPlaying (1 << 1)
146 #define kVstTransportCycleActive (1 << 2)
147 #define kVstTransportRecording (1 << 3)
148 
149 #define kVstAutomationWriting (1 << 6)
150 #define kVstAutomationReading (1 << 7)
151 
152 #define kVstNanosValid (1 << 8)
153 #define kVstPpqPosValid (1 << 9)
154 #define kVstTempoValid (1 << 10)
155 #define kVstBarsValid (1 << 11)
156 #define kVstCyclePosValid (1 << 12)
157 #define kVstTimeSigValid (1 << 13)
158 #define kVstSmpteValid (1 << 14)
159 #define kVstClockValid (1 << 15)
160 
162 {
163  // 00
164  int type;
165  // 04
166  int byteSize;
167  // 08
169  // 0c?
170  int flags;
171  // 10?
173  // 14?
175  // 18
176  char midiData[4];
177  // 1c?
178  char detune;
179  // 1d?
181  // 1e?
182  char reserved1;
183  // 1f?
184  char reserved2;
185 };
186 
187 typedef struct _VstMidiEvent VstMidiEvent;
188 
189 
190 struct _VstEvent
191 {
192  char dump[sizeof (VstMidiEvent)];
193 
194 };
195 
196 typedef struct _VstEvent VstEvent;
197 
199 {
200  // 00
202  // 04
203  void *reserved;
204  // 08
206 };
207 
208 /* constants from http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3740&sid=183f74631fee71a493316735e2b9f28b */
209 
211 {
217 };
218 
219 
220 /* constants from http://asseca.com/vst-24-specs/efGetPlugCategory.html */
221 
223 {
237 };
238 
239 typedef struct _VstEvents VstEvents;
240 
241 /* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
243 {
244  float stepFloat; /* float step */
245  float smallStepFloat; /* small float step */
246  float largeStepFloat; /* large float step */
247  char label[64]; /* parameter label */
248  int32_t flags; /* @see VstParameterFlags */
249  int32_t minInteger; /* integer minimum */
250  int32_t maxInteger; /* integer maximum */
251  int32_t stepInteger; /* integer step */
252  int32_t largeStepInteger; /* large integer step */
253  char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
254  int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
255  int16_t category; /* 0: no category, else group index + 1 */
256  int16_t numParametersInCategory; /* number of parameters in category */
257  int16_t reserved; /* zero */
258  char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
259  char future[16]; /* reserved for future use */
260 };
261 
263 
264 /* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
266 {
267  kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
268  kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
269  kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
270  kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
271  kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
272  kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
273  kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
274 };
275 
276 struct _AEffect
277 {
278  // Never use virtual functions!!!
279  // 00-03
280  int magic;
281  // dispatcher 04-07
282  intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
283  // process, quite sure 08-0b
284  void (* process) (struct _AEffect *, float **, float **, int);
285  // setParameter 0c-0f
286  void (* setParameter) (struct _AEffect *, int, float);
287  // getParameter 10-13
288  float (* getParameter) (struct _AEffect *, int);
289  // programs 14-17
291  // Params 18-1b
293  // Input 1c-1f
295  // Output 20-23
297  // flags 24-27
298  int flags;
299  // Fill somewhere 28-2b
300  void *ptr1;
301  void *ptr2;
302  // Zeroes 2c-2f 30-33 34-37 38-3b
303  char empty3[4 + 4 + 4];
304  // 1.0f 3c-3f
306  // An object? pointer 40-43
307  void *ptr3;
308  // Zeroes 44-47
309  void *user;
310  // Id 48-4b
311  int32_t uniqueID;
312  // Version 4c-4f
313  int32_t version;
314  // processReplacing 50-53
315  void (* processReplacing) (struct _AEffect *, float **, float **, int);
316 };
317 
318 typedef struct _AEffect AEffect;
319 
320 typedef struct _VstTimeInfo
321 {
322  /* info from online documentation of VST provided by Steinberg */
323 
324  double samplePos;
325  double sampleRate;
326  double nanoSeconds;
327  double ppqPos;
328  double tempo;
329  double barStartPos;
331  double cycleEndPos;
334  int32_t smpteOffset;
335  int32_t smpteFrameRate;
337  int32_t flags;
338 
340 
341 typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
342 
343 #endif
int32_t version
Definition: vestige.h:313
void * user
Definition: vestige.h:309
float(* getParameter)(struct _AEffect *, int)
Definition: vestige.h:288
int numPrograms
Definition: vestige.h:290
int32_t uniqueID
Definition: vestige.h:311
int numOutputs
Definition: vestige.h:296
intptr_t(* dispatcher)(struct _AEffect *, int, int, intptr_t, void *, float)
Definition: vestige.h:282
void * ptr1
Definition: vestige.h:300
int flags
Definition: vestige.h:298
void(* process)(struct _AEffect *, float **, float **, int)
Definition: vestige.h:284
void(* processReplacing)(struct _AEffect *, float **, float **, int)
Definition: vestige.h:315
int numParams
Definition: vestige.h:292
char empty3[4+4+4]
Definition: vestige.h:303
int magic
Definition: vestige.h:280
void * ptr2
Definition: vestige.h:301
void(* setParameter)(struct _AEffect *, int, float)
Definition: vestige.h:286
void * ptr3
Definition: vestige.h:307
int numInputs
Definition: vestige.h:294
float unkown_float
Definition: vestige.h:305
char dump[sizeof(VstMidiEvent)]
Definition: vestige.h:192
int numEvents
Definition: vestige.h:201
VstEvent * events[]
Definition: vestige.h:205
void * reserved
Definition: vestige.h:203
char noteOffVelocity
Definition: vestige.h:180
int noteLength
Definition: vestige.h:172
int deltaSamples
Definition: vestige.h:168
int noteOffset
Definition: vestige.h:174
char reserved2
Definition: vestige.h:184
char reserved1
Definition: vestige.h:182
char detune
Definition: vestige.h:178
char midiData[4]
Definition: vestige.h:176
int byteSize
Definition: vestige.h:166
int32_t largeStepInteger
Definition: vestige.h:252
char shortLabel[VestigeMaxShortLabelLen]
Definition: vestige.h:253
int16_t numParametersInCategory
Definition: vestige.h:256
char categoryLabel[VestigeMaxCategLabelLen]
Definition: vestige.h:258
int32_t samplesToNextClock
Definition: vestige.h:336
double barStartPos
Definition: vestige.h:329
int32_t timeSigDenominator
Definition: vestige.h:333
int32_t smpteFrameRate
Definition: vestige.h:335
double samplePos
Definition: vestige.h:324
double ppqPos
Definition: vestige.h:327
double cycleStartPos
Definition: vestige.h:330
double sampleRate
Definition: vestige.h:325
double cycleEndPos
Definition: vestige.h:331
double tempo
Definition: vestige.h:328
int32_t flags
Definition: vestige.h:337
int32_t smpteOffset
Definition: vestige.h:334
int32_t timeSigNumerator
Definition: vestige.h:332
double nanoSeconds
Definition: vestige.h:326
VstPlugCategory
Definition: vestige.h:223
@ kPlugCategMaxCount
Definition: vestige.h:236
@ kPlugCategGenerator
Definition: vestige.h:235
@ kPlugCategSynth
Definition: vestige.h:226
@ kPlugCategRestoration
Definition: vestige.h:232
@ kPlugSurroundFx
Definition: vestige.h:231
@ kPlugCategAnalysis
Definition: vestige.h:227
@ kPlugCategOfflineProcess
Definition: vestige.h:233
@ kPlugCategRoomFx
Definition: vestige.h:230
@ kPlugCategUnknown
Definition: vestige.h:224
@ kPlugCategMastering
Definition: vestige.h:228
@ kPlugCategShell
Definition: vestige.h:234
@ kPlugCategEffect
Definition: vestige.h:225
@ kPlugCategSpacializer
Definition: vestige.h:229
struct _VstMidiEvent VstMidiEvent
Definition: vestige.h:187
intptr_t(* audioMasterCallback)(AEffect *, int32_t, int32_t, intptr_t, void *, float)
Definition: vestige.h:341
Vestige2StringConstants
Definition: vestige.h:211
@ VestigeMaxCategLabelLen
Definition: vestige.h:215
@ VestigeMaxFileNameLen
Definition: vestige.h:216
@ VestigeMaxNameLen
Definition: vestige.h:212
@ VestigeMaxLabelLen
Definition: vestige.h:213
@ VestigeMaxShortLabelLen
Definition: vestige.h:214
struct _VstTimeInfo VstTimeInfo
VstParameterFlags
Definition: vestige.h:266
@ kVstParameterUsesIntegerMinMax
Definition: vestige.h:268
@ kVstParameterUsesIntStep
Definition: vestige.h:270
@ kVstParameterUsesFloatStep
Definition: vestige.h:269
@ kVstParameterSupportsDisplayIndex
Definition: vestige.h:271
@ kVstParameterSupportsDisplayCategory
Definition: vestige.h:272
@ kVstParameterIsSwitch
Definition: vestige.h:267
@ kVstParameterCanRamp
Definition: vestige.h:273