Remove juce completely, cleanup
[carla.git] / source / includes / vestige / vestige.h
blob72f1c9c4f8369da89b5b188f25eca5fdb8274db3
1 /*
2 * IMPORTANT: The author of Carla has no connection with the
3 * author of the VeSTige VST-compatibility header, has had no
4 * involvement in its creation.
6 * The VeSTige header is included in this package in the good-faith
7 * belief that it has been cleanly and legally reverse engineered
8 * without reference to the official VST SDK and without its
9 * developer(s) having agreed to the VST SDK license agreement.
13 * simple header to allow VeSTige compilation and eventually work
15 * Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public
19 * License as published by the Free Software Foundation; either
20 * version 2 of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
27 * You should have received a copy of the GNU General Public
28 * License along with this program (see COPYING); if not, write to the
29 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
30 * Boston, MA 02110-1301 USA.
33 #include <stdint.h>
34 #ifndef _VESTIGE_H
35 #define _VESTIGE_H
37 #if ! (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
38 # define __cdecl
39 #endif
41 #define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
42 ( ( (int) b ) << 16 ) | \
43 ( ( (int) c ) << 8 ) | \
44 ( ( (int) d ) << 0 ) )
46 #define audioMasterAutomate 0
47 #define audioMasterVersion 1
48 #define audioMasterCurrentId 2
49 #define audioMasterIdle 3
50 #define audioMasterPinConnected 4
51 // unsupported? 5
52 #define audioMasterWantMidi 6
53 #define audioMasterGetTime 7
54 #define audioMasterProcessEvents 8
55 #define audioMasterSetTime 9
56 #define audioMasterTempoAt 10
57 #define audioMasterGetNumAutomatableParameters 11
58 #define audioMasterGetParameterQuantization 12
59 #define audioMasterIOChanged 13
60 #define audioMasterNeedIdle 14
61 #define audioMasterSizeWindow 15
62 #define audioMasterGetSampleRate 16
63 #define audioMasterGetBlockSize 17
64 #define audioMasterGetInputLatency 18
65 #define audioMasterGetOutputLatency 19
66 #define audioMasterGetPreviousPlug 20
67 #define audioMasterGetNextPlug 21
68 #define audioMasterWillReplaceOrAccumulate 22
69 #define audioMasterGetCurrentProcessLevel 23
70 #define audioMasterGetAutomationState 24
71 #define audioMasterOfflineStart 25
72 #define audioMasterOfflineRead 26
73 #define audioMasterOfflineWrite 27
74 #define audioMasterOfflineGetCurrentPass 28
75 #define audioMasterOfflineGetCurrentMetaPass 29
76 #define audioMasterSetOutputSampleRate 30
77 // unsupported? 31
78 #define audioMasterGetSpeakerArrangement 31 // deprecated in 2.4?
79 #define audioMasterGetVendorString 32
80 #define audioMasterGetProductString 33
81 #define audioMasterGetVendorVersion 34
82 #define audioMasterVendorSpecific 35
83 #define audioMasterSetIcon 36
84 #define audioMasterCanDo 37
85 #define audioMasterGetLanguage 38
86 #define audioMasterOpenWindow 39
87 #define audioMasterCloseWindow 40
88 #define audioMasterGetDirectory 41
89 #define audioMasterUpdateDisplay 42
90 #define audioMasterBeginEdit 43
91 #define audioMasterEndEdit 44
92 #define audioMasterOpenFileSelector 45
93 #define audioMasterCloseFileSelector 46 // currently unused
94 #define audioMasterEditFile 47 // currently unused
95 #define audioMasterGetChunkFile 48 // currently unused
96 #define audioMasterGetInputSpeakerArrangement 49 // currently unused
98 #define effFlagsHasEditor 1
99 #define effFlagsCanReplacing (1 << 4) // very likely
100 #define effFlagsIsSynth (1 << 8) // currently unused
102 #define effOpen 0
103 #define effClose 1
104 #define effSetProgram 2
105 #define effGetProgram 3
106 #define effGetProgramName 5
107 #define effGetParamName 8
108 #define effSetSampleRate 10
109 #define effSetBlockSize 11
110 #define effMainsChanged 12
111 #define effEditGetRect 13
112 #define effEditOpen 14
113 #define effEditClose 15
114 #define effEditIdle 19
115 #define effEditTop 20
116 #define effProcessEvents 25
117 #define effGetPlugCategory 35
118 #define effGetEffectName 45
119 #define effGetVendorString 47
120 #define effGetProductString 48
121 #define effGetVendorVersion 49
122 #define effCanDo 51
123 #define effIdle 53
124 #define effGetParameterProperties 56
125 #define effGetVstVersion 58
126 #define effShellGetNextPlugin 70
127 #define effStartProcess 71
128 #define effStopProcess 72
130 #define effBeginSetProgram 67
131 #define effEndSetProgram 68
133 #ifdef WORDS_BIGENDIAN
134 // "VstP"
135 #define kEffectMagic 0x50747356
136 #else
137 // "PtsV"
138 #define kEffectMagic 0x56737450
139 #endif
141 #define kVstLangEnglish 1
142 #define kVstMidiType 1
144 struct RemoteVstPlugin;
146 #define kVstTransportChanged 1
147 #define kVstTransportPlaying (1 << 1)
148 #define kVstTransportCycleActive (1 << 2)
149 #define kVstTransportRecording (1 << 3)
151 #define kVstAutomationWriting (1 << 6)
152 #define kVstAutomationReading (1 << 7)
154 #define kVstNanosValid (1 << 8)
155 #define kVstPpqPosValid (1 << 9)
156 #define kVstTempoValid (1 << 10)
157 #define kVstBarsValid (1 << 11)
158 #define kVstCyclePosValid (1 << 12)
159 #define kVstTimeSigValid (1 << 13)
160 #define kVstSmpteValid (1 << 14)
161 #define kVstClockValid (1 << 15)
163 struct _VstMidiEvent
165 // 00
166 int type;
167 // 04
168 int byteSize;
169 // 08
170 int deltaFrames;
171 // 0c?
172 int flags;
173 // 10?
174 int noteLength;
175 // 14?
176 int noteOffset;
177 // 18
178 char midiData[4];
179 // 1c?
180 char detune;
181 // 1d?
182 char noteOffVelocity;
183 // 1e?
184 char reserved1;
185 // 1f?
186 char reserved2;
189 typedef struct _VstMidiEvent VstMidiEvent;
192 struct _VstEvent
194 char dump[sizeof (VstMidiEvent)];
198 typedef struct _VstEvent VstEvent;
200 struct _VstEvents
202 // 00
203 int numEvents;
204 // 04
205 void *reserved;
206 // 08
207 VstEvent * events[2];
210 enum Vestige2StringConstants
212 VestigeMaxNameLen = 64,
213 VestigeMaxLabelLen = 64,
214 VestigeMaxShortLabelLen = 8,
215 VestigeMaxCategLabelLen = 24,
216 VestigeMaxFileNameLen = 100
220 enum VstPlugCategory
222 kPlugCategUnknown = 0,
223 kPlugCategEffect,
224 kPlugCategSynth,
225 kPlugCategAnalysis,
226 kPlugCategMastering,
227 kPlugCategSpacializer,
228 kPlugCategRoomFx,
229 kPlugSurroundFx,
230 kPlugCategRestoration,
231 kPlugCategOfflineProcess,
232 kPlugCategShell,
233 kPlugCategGenerator,
234 kPlugCategMaxCount
237 typedef struct _VstEvents VstEvents;
239 struct _VstParameterProperties
241 float stepFloat; /* float step */
242 float smallStepFloat; /* small float step */
243 float largeStepFloat; /* large float step */
244 char label[VestigeMaxLabelLen]; /* parameter label */
245 int32_t flags; /* @see VstParameterFlags */
246 int32_t minInteger; /* integer minimum */
247 int32_t maxInteger; /* integer maximum */
248 int32_t stepInteger; /* integer step */
249 int32_t largeStepInteger; /* large integer step */
250 char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
251 int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
252 int16_t category; /* 0: no category, else group index + 1 */
253 int16_t numParametersInCategory; /* number of parameters in category */
254 int16_t reserved; /* zero */
255 char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
256 char future[16]; /* reserved for future use */
259 typedef struct _VstParameterProperties VstParameterProperties;
261 enum VstParameterFlags
263 kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
264 kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
265 kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
266 kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
267 kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
268 kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
269 kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
272 struct _AEffect
274 // Never use virtual functions!!!
275 // 00-03
276 int magic;
277 // dispatcher 04-07
278 intptr_t (__cdecl *dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
279 // process, quite sure 08-0b
280 void (__cdecl *process) (struct _AEffect *, float **, float **, int);
281 // setParameter 0c-0f
282 void (__cdecl *setParameter) (struct _AEffect *, int, float);
283 // getParameter 10-13
284 float (__cdecl *getParameter) (struct _AEffect *, int);
285 // programs 14-17
286 int numPrograms;
287 // Params 18-1b
288 int numParams;
289 // Input 1c-1f
290 int numInputs;
291 // Output 20-23
292 int numOutputs;
293 // flags 24-27
294 int flags;
295 // Fill somewhere 28-2b
296 void *ptr1;
297 void *ptr2;
298 int initialDelay;
299 // Zeroes 30-33 34-37 38-3b
300 char empty2[4 + 4];
301 // 1.0f 3c-3f
302 float unkown_float;
303 // An object? pointer 40-43
304 void *object;
305 // Zeroes 44-47
306 void *user;
307 // Id 48-4b
308 int32_t uniqueID;
309 // plugin version 4c-4f
310 int32_t version;
311 // processReplacing 50-53
312 void (__cdecl *processReplacing) (struct _AEffect *, float **, float **, int);
315 typedef struct _AEffect AEffect;
317 typedef struct _VstTimeInfo
319 /* info from online documentation of VST provided by Steinberg */
321 double samplePos;
322 double sampleRate;
323 double nanoSeconds;
324 double ppqPos;
325 double tempo;
326 double barStartPos;
327 double cycleStartPos;
328 double cycleEndPos;
329 int32_t timeSigNumerator;
330 int32_t timeSigDenominator;
331 int32_t smpteOffset;
332 int32_t smpteFrameRate;
333 int32_t samplesToNextClock;
334 int32_t flags;
336 } VstTimeInfo;
338 typedef intptr_t (__cdecl *audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
340 #endif