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