ardour
aeffectx.h
Go to the documentation of this file.
1 /*
2  * aeffectx.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  */
24 #include <stdint.h>
25 #ifndef _AEFFECTX_H
26 #define _AEFFECTX_H
27 
28 #define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
29  ( ( (int) b ) << 16 ) | \
30  ( ( (int) c ) << 8 ) | \
31  ( ( (int) d ) << 0 ) )
32 
33 #define audioMasterAutomate 0
34 #define audioMasterVersion 1
35 #define audioMasterCurrentId 2
36 #define audioMasterIdle 3
37 #define audioMasterPinConnected 4
38 // unsupported? 5
39 #define audioMasterWantMidi 6
40 #define audioMasterGetTime 7
41 #define audioMasterProcessEvents 8
42 #define audioMasterSetTime 9
43 #define audioMasterTempoAt 10
44 #define audioMasterGetNumAutomatableParameters 11
45 #define audioMasterGetParameterQuantization 12
46 #define audioMasterIOChanged 13
47 #define audioMasterNeedIdle 14
48 #define audioMasterSizeWindow 15
49 #define audioMasterGetSampleRate 16
50 #define audioMasterGetBlockSize 17
51 #define audioMasterGetInputLatency 18
52 #define audioMasterGetOutputLatency 19
53 #define audioMasterGetPreviousPlug 20
54 #define audioMasterGetNextPlug 21
55 #define audioMasterWillReplaceOrAccumulate 22
56 #define audioMasterGetCurrentProcessLevel 23
57 #define audioMasterGetAutomationState 24
58 #define audioMasterOfflineStart 25
59 #define audioMasterOfflineRead 26
60 #define audioMasterOfflineWrite 27
61 #define audioMasterOfflineGetCurrentPass 28
62 #define audioMasterOfflineGetCurrentMetaPass 29
63 #define audioMasterSetOutputSampleRate 30
64 // unsupported? 31
65 #define audioMasterGetSpeakerArrangement 31 // deprecated in 2.4?
66 #define audioMasterGetVendorString 32
67 #define audioMasterGetProductString 33
68 #define audioMasterGetVendorVersion 34
69 #define audioMasterVendorSpecific 35
70 #define audioMasterSetIcon 36
71 #define audioMasterCanDo 37
72 #define audioMasterGetLanguage 38
73 #define audioMasterOpenWindow 39
74 #define audioMasterCloseWindow 40
75 #define audioMasterGetDirectory 41
76 #define audioMasterUpdateDisplay 42
77 #define audioMasterBeginEdit 43
78 #define audioMasterEndEdit 44
79 #define audioMasterOpenFileSelector 45
80 #define audioMasterCloseFileSelector 46 // currently unused
81 #define audioMasterEditFile 47 // currently unused
82 #define audioMasterGetChunkFile 48 // currently unused
83 #define audioMasterGetInputSpeakerArrangement 49 // currently unused
84 
85 #define effFlagsHasEditor 1
86 #define effFlagsCanReplacing (1 << 4) // very likely
87 #define effFlagsIsSynth (1 << 8) // currently unused
88 
89 #define effOpen 0
90 #define effClose 1 // currently unused
91 #define effSetProgram 2 // currently unused
92 #define effGetProgram 3 // currently unused
93 #define effGetProgramName 5 // currently unused
94 #define effGetParamName 8 // currently unused
95 #define effSetSampleRate 10
96 #define effSetBlockSize 11
97 #define effMainsChanged 12
98 #define effEditGetRect 13
99 #define effEditOpen 14
100 #define effEditClose 15
101 #define effEditIdle 19
102 #define effEditTop 20
103 #define effProcessEvents 25
104 // the next one from http://asseca.com/vst-24-specs/index.html
105 #define effGetPlugCategory 35
106 #define effGetEffectName 45
107 #define effGetVendorString 47
108 #define effGetProductString 48
109 #define effGetVendorVersion 49
110 #define effCanDo 51 // currently unused
111 /* from http://asseca.com/vst-24-specs/efIdle.html */
112 #define effIdle 53
113 /* from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
114 #define effGetParameterProperties 56
115 #define effGetVstVersion 58 // currently unused
116 /* http://asseca.com/vst-24-specs/efShellGetNextPlugin.html */
117 #define effShellGetNextPlugin 70
118 /* The next two were gleaned from http://www.kvraudio.com/forum/printview.php?t=143587&start=0 */
119 #define effStartProcess 71
120 #define effStopProcess 72
121 
122 #define effBeginSetProgram 67
123 #define effEndSetProgram 68
124 
125 #ifdef WORDS_BIGENDIAN
126 // "VstP"
127 #define kEffectMagic 0x50747356
128 #else
129 // "PtsV"
130 #define kEffectMagic 0x56737450
131 #endif
132 
133 #define kVstLangEnglish 1
134 #define kVstMidiType 1
135 
136 struct RemoteVstPlugin;
137 
138 #define kVstTransportPlaying (1 << 1)
139 
140 #define kVstNanosValid (1 << 8)
141 #define kVstPpqPosValid (1 << 9)
142 #define kVstTempoValid (1 << 10)
143 #define kVstBarsValid (1 << 11)
144 #define kVstCyclePosValid (1 << 12)
145 #define kVstTimeSigValid (1 << 13)
146 #define kVstSmpteValid (1 << 14)
147 #define kVstClockValid (1 << 15)
148 
150 {
151  // 00
152  int type;
153  // 04
154  int byteSize;
155  // 08
157  // 0c?
158  int flags;
159  // 10?
161  // 14?
163  // 18
164  char midiData[4];
165  // 1c?
166  char detune;
167  // 1d?
169  // 1e?
170  char reserved1;
171  // 1f?
172  char reserved2;
173 };
174 
176 
177 
178 struct _VstEvent
179 {
180  char dump[sizeof (VstMidiEvent)];
181 
182 };
183 
184 typedef struct _VstEvent VstEvent;
185 
187 {
188  // 00
190  // 04
191  void *reserved;
192  // 08
194 };
195 
196 /* constants from http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3740&sid=183f74631fee71a493316735e2b9f28b */
197 
199 {
205 };
206 
207 
208 /* constants from http://asseca.com/vst-24-specs/efGetPlugCategory.html */
209 
211 {
225 };
226 
227 typedef struct _VstEvents VstEvents;
228 
229 /* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
231 {
232  float stepFloat; /* float step */
233  float smallStepFloat; /* small float step */
234  float largeStepFloat; /* large float step */
235  char label[VestigeMaxLabelLen]; /* parameter label */
236  int32_t flags; /* @see VstParameterFlags */
237  int32_t minInteger; /* integer minimum */
238  int32_t maxInteger; /* integer maximum */
239  int32_t stepInteger; /* integer step */
240  int32_t largeStepInteger; /* large integer step */
241  char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
242  int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
243  int16_t category; /* 0: no category, else group index + 1 */
244  int16_t numParametersInCategory; /* number of parameters in category */
245  int16_t reserved; /* zero */
246  char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
247  char future[16]; /* reserved for future use */
248 };
249 
251 
252 /* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
254 {
255  kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
256  kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
257  kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
258  kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
259  kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
260  kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
261  kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
262 };
263 
264 struct _AEffect
265 {
266  // Never use virtual functions!!!
267  // 00-03
268  int magic;
269  // dispatcher 04-07
270  intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
271  // process, quite sure 08-0b
272  void (* process) (struct _AEffect *, float **, float **, int);
273  // setParameter 0c-0f
274  void (* setParameter) (struct _AEffect *, int, float);
275  // getParameter 10-13
276  float (* getParameter) (struct _AEffect *, int);
277  // programs 14-17
279  // Params 18-1b
281  // Input 1c-1f
283  // Output 20-23
285  // flags 24-27
286  int flags;
287  // Fill somewhere 28-2b
288  void *ptr1;
289  void *ptr2;
290  // Zeroes 2c-2f 30-33 34-37 38-3b
291  char empty3[4 + 4 + 4];
292  // 1.0f 3c-3f
294  // An object? pointer 40-43
295  void *ptr3;
296  // Zeroes 44-47
297  void *user;
298  // Id 48-4b
299  int32_t uniqueID;
300  // Don't know 4c-4f
301  char unknown1[4];
302  // processReplacing 50-53
303  void (* processReplacing) (struct _AEffect *, float **, float **, int);
304 };
305 
306 typedef struct _AEffect AEffect;
307 
308 typedef struct _VstTimeInfo
309 {
310  /* info from online documentation of VST provided by Steinberg */
311 
312  double samplePos;
313  double sampleRate;
314  double nanoSeconds;
315  double ppqPos;
316  double tempo;
317  double barStartPos;
319  double cycleEndPos;
322  int32_t smpteOffset;
323  int32_t smpteFrameRate;
325  int32_t flags;
326 
327 } VstTimeInfo;
328 
329 typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
330 
331 #endif
char reserved2
Definition: aeffectx.h:172
char noteOffVelocity
Definition: aeffectx.h:168
double cycleStartPos
Definition: aeffectx.h:318
char empty3[4+4+4]
Definition: aeffectx.h:291
intptr_t(* audioMasterCallback)(AEffect *, int32_t, int32_t, intptr_t, void *, float)
Definition: aeffectx.h:329
char categoryLabel[VestigeMaxCategLabelLen]
Definition: aeffectx.h:246
int numParams
Definition: aeffectx.h:280
int noteOffset
Definition: aeffectx.h:162
double cycleEndPos
Definition: aeffectx.h:319
float(* getParameter)(struct _AEffect *, int)
Definition: aeffectx.h:276
void(* process)(struct _AEffect *, float **, float **, int)
Definition: aeffectx.h:272
char label[VestigeMaxLabelLen]
Definition: aeffectx.h:235
int noteLength
Definition: aeffectx.h:160
void(* setParameter)(struct _AEffect *, int, float)
Definition: aeffectx.h:274
intptr_t(* dispatcher)(struct _AEffect *, int, int, intptr_t, void *, float)
Definition: aeffectx.h:270
int32_t flags
Definition: aeffectx.h:325
int32_t samplesToNextClock
Definition: aeffectx.h:324
int16_t numParametersInCategory
Definition: aeffectx.h:244
double nanoSeconds
Definition: aeffectx.h:314
double ppqPos
Definition: aeffectx.h:315
VstPlugCategory
Definition: aeffectx.h:210
char reserved1
Definition: aeffectx.h:170
int magic
Definition: aeffectx.h:268
void * reserved
Definition: aeffectx.h:191
VstEvent * events[]
Definition: aeffectx.h:193
void * ptr2
Definition: aeffectx.h:289
char unknown1[4]
Definition: aeffectx.h:301
double samplePos
Definition: aeffectx.h:312
int intptr_t
Definition: types.h:46
void(* processReplacing)(struct _AEffect *, float **, float **, int)
Definition: aeffectx.h:303
void * ptr1
Definition: aeffectx.h:288
void * ptr3
Definition: aeffectx.h:295
struct _VstTimeInfo VstTimeInfo
int32_t uniqueID
Definition: aeffectx.h:299
char shortLabel[VestigeMaxShortLabelLen]
Definition: aeffectx.h:241
char dump[sizeof(VstMidiEvent)]
Definition: aeffectx.h:180
Vestige2StringConstants
Definition: aeffectx.h:198
double sampleRate
Definition: aeffectx.h:313
int numOutputs
Definition: aeffectx.h:284
int numPrograms
Definition: aeffectx.h:278
int32_t timeSigDenominator
Definition: aeffectx.h:321
double tempo
Definition: aeffectx.h:316
int numInputs
Definition: aeffectx.h:282
int flags
Definition: aeffectx.h:286
int deltaFrames
Definition: aeffectx.h:156
char midiData[4]
Definition: aeffectx.h:164
int numEvents
Definition: aeffectx.h:189
VstParameterFlags
Definition: aeffectx.h:253
float unkown_float
Definition: aeffectx.h:293
double barStartPos
Definition: aeffectx.h:317
void * user
Definition: aeffectx.h:297
int32_t timeSigNumerator
Definition: aeffectx.h:320
int32_t smpteOffset
Definition: aeffectx.h:322
int32_t smpteFrameRate
Definition: aeffectx.h:323
struct _VstMidiEvent VstMidiEvent
Definition: aeffectx.h:175