2 * aeffectx.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.
28 #define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
29 ( ( (int) b ) << 16 ) | \
30 ( ( (int) c ) << 8 ) | \
31 ( ( (int) d ) << 0 ) )
33 #define audioMasterAutomate 0
34 #define audioMasterVersion 1
35 #define audioMasterCurrentId 2
36 #define audioMasterIdle 3
37 #define audioMasterPinConnected 4
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
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
85 #define effFlagsHasEditor 1
86 #define effFlagsCanReplacing (1 << 4) // very likely
87 #define effFlagsIsSynth (1 << 8) // currently unused
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 */
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
122 #define effBeginSetProgram 67
123 #define effEndSetProgram 68
125 #ifdef WORDS_BIGENDIAN
127 #define kEffectMagic 0x50747356
130 #define kEffectMagic 0x56737450
133 #define kVstLangEnglish 1
134 #define kVstMidiType 1
136 struct RemoteVstPlugin;
138 #define kVstTransportChanged 1
139 #define kVstTransportPlaying (1 << 1)
140 #define kVstTransportCycleActive (1 << 2)
141 #define kVstTransportRecording (1 << 3)
143 #define kVstAutomationWriting (1 << 6)
144 #define kVstAutomationReading (1 << 7)
146 #define kVstNanosValid (1 << 8)
147 #define kVstPpqPosValid (1 << 9)
148 #define kVstTempoValid (1 << 10)
149 #define kVstBarsValid (1 << 11)
150 #define kVstCyclePosValid (1 << 12)
151 #define kVstTimeSigValid (1 << 13)
152 #define kVstSmpteValid (1 << 14)
153 #define kVstClockValid (1 << 15)
174 char noteOffVelocity;
181 typedef struct _VstMidiEvent VstMidiEvent;
186 char dump[sizeof (VstMidiEvent)];
190 typedef struct _VstEvent VstEvent;
202 /* constants from http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3740&sid=183f74631fee71a493316735e2b9f28b */
204 enum Vestige2StringConstants
206 VestigeMaxNameLen = 64,
207 VestigeMaxLabelLen = 64,
208 VestigeMaxShortLabelLen = 8,
209 VestigeMaxCategLabelLen = 24,
210 VestigeMaxFileNameLen = 100
214 /* constants from http://asseca.com/vst-24-specs/efGetPlugCategory.html */
218 kPlugCategUnknown = 0,
223 kPlugCategSpacializer,
226 kPlugCategRestoration,
227 kPlugCategOfflineProcess,
233 typedef struct _VstEvents VstEvents;
235 /* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
236 struct _VstParameterProperties
238 float stepFloat; /* float step */
239 float smallStepFloat; /* small float step */
240 float largeStepFloat; /* large float step */
241 char label[VestigeMaxLabelLen]; /* parameter label */
242 int32_t flags; /* @see VstParameterFlags */
243 int32_t minInteger; /* integer minimum */
244 int32_t maxInteger; /* integer maximum */
245 int32_t stepInteger; /* integer step */
246 int32_t largeStepInteger; /* large integer step */
247 char shortLabel[VestigeMaxShortLabelLen]; /* short label, recommended: 6 + delimiter */
248 int16_t displayIndex; /* index where this parameter should be displayed (starting with 0) */
249 int16_t category; /* 0: no category, else group index + 1 */
250 int16_t numParametersInCategory; /* number of parameters in category */
251 int16_t reserved; /* zero */
252 char categoryLabel[VestigeMaxCategLabelLen]; /* category label, e.g. "Osc 1" */
253 char future[16]; /* reserved for future use */
256 typedef struct _VstParameterProperties VstParameterProperties;
258 /* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
259 enum VstParameterFlags
261 kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
262 kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
263 kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
264 kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
265 kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
266 kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
267 kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
272 // Never use virtual functions!!!
276 intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
277 // process, quite sure 08-0b
278 void (* process) (struct _AEffect *, float **, float **, int);
279 // setParameter 0c-0f
280 void (* setParameter) (struct _AEffect *, int, float);
281 // getParameter 10-13
282 float (* getParameter) (struct _AEffect *, int);
293 // Fill somewhere 28-2b
296 // Zeroes 2c-2f 30-33 34-37 38-3b
297 char empty3[4 + 4 + 4];
300 // An object? pointer 40-43
308 // processReplacing 50-53
309 void (* processReplacing) (struct _AEffect *, float **, float **, int);
312 typedef struct _AEffect AEffect;
314 typedef struct _VstTimeInfo
316 /* info from online documentation of VST provided by Steinberg */
324 double cycleStartPos;
326 int32_t timeSigNumerator;
327 int32_t timeSigDenominator;
329 int32_t smpteFrameRate;
330 int32_t samplesToNextClock;
335 typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);