Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

280 lines
7.5KB

  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. #define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
  28. ( ( (int) b ) << 16 ) | \
  29. ( ( (int) c ) << 8 ) | \
  30. ( ( (int) d ) << 0 ) )
  31. #define audioMasterAutomate 0
  32. #define audioMasterVersion 1
  33. #define audioMasterCurrentId 2
  34. #define audioMasterIdle 3
  35. #define audioMasterPinConnected 4
  36. // unsupported? 5
  37. #define audioMasterWantMidi 6
  38. #define audioMasterGetTime 7
  39. #define audioMasterProcessEvents 8
  40. #define audioMasterSetTime 9
  41. #define audioMasterTempoAt 10
  42. #define audioMasterGetNumAutomatableParameters 11
  43. #define audioMasterGetParameterQuantization 12
  44. #define audioMasterIOChanged 13
  45. #define audioMasterNeedIdle 14
  46. #define audioMasterSizeWindow 15
  47. #define audioMasterGetSampleRate 16
  48. #define audioMasterGetBlockSize 17
  49. #define audioMasterGetInputLatency 18
  50. #define audioMasterGetOutputLatency 19
  51. #define audioMasterGetPreviousPlug 20
  52. #define audioMasterGetNextPlug 21
  53. #define audioMasterWillReplaceOrAccumulate 22
  54. #define audioMasterGetCurrentProcessLevel 23
  55. #define audioMasterGetAutomationState 24
  56. #define audioMasterOfflineStart 25
  57. #define audioMasterOfflineRead 26
  58. #define audioMasterOfflineWrite 27
  59. #define audioMasterOfflineGetCurrentPass 28
  60. #define audioMasterOfflineGetCurrentMetaPass 29
  61. #define audioMasterSetOutputSampleRate 30
  62. // unsupported? 31
  63. #define audioMasterGetSpeakerArrangement 31 // deprecated in 2.4?
  64. #define audioMasterGetVendorString 32
  65. #define audioMasterGetProductString 33
  66. #define audioMasterGetVendorVersion 34
  67. #define audioMasterVendorSpecific 35
  68. #define audioMasterSetIcon 36
  69. #define audioMasterCanDo 37
  70. #define audioMasterGetLanguage 38
  71. #define audioMasterOpenWindow 39
  72. #define audioMasterCloseWindow 40
  73. #define audioMasterGetDirectory 41
  74. #define audioMasterUpdateDisplay 42
  75. #define audioMasterBeginEdit 43
  76. #define audioMasterEndEdit 44
  77. #define audioMasterOpenFileSelector 45
  78. #define audioMasterCloseFileSelector 46 // currently unused
  79. #define audioMasterEditFile 47 // currently unused
  80. #define audioMasterGetChunkFile 48 // currently unused
  81. #define audioMasterGetInputSpeakerArrangement 49 // currently unused
  82. #define effFlagsHasEditor 1
  83. #define effFlagsCanReplacing (1 << 4) // very likely
  84. #define effFlagsIsSynth (1 << 8) // currently unused
  85. #define effOpen 0
  86. #define effClose 1 // currently unused
  87. #define effSetProgram 2 // currently unused
  88. #define effGetProgram 3 // currently unused
  89. #define effGetProgramName 5 // currently unused
  90. #define effGetParamName 8 // currently unused
  91. #define effSetSampleRate 10
  92. #define effSetBlockSize 11
  93. #define effMainsChanged 12
  94. #define effEditGetRect 13
  95. #define effEditOpen 14
  96. #define effEditClose 15
  97. #define effEditIdle 19
  98. #define effEditTop 20
  99. #define effProcessEvents 25
  100. #define effGetEffectName 45
  101. #define effGetVendorString 47
  102. #define effGetProductString 48
  103. #define effGetVendorVersion 49
  104. #define effCanDo 51 // currently unused
  105. /* from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
  106. #define effGetParameterProperties 56
  107. #define effGetVstVersion 58 // currently unused
  108. #define kEffectMagic (CCONST( 'V', 's', 't', 'P' ))
  109. #define kVstLangEnglish 1
  110. #define kVstMidiType 1
  111. #define kVstTempoValid (1 << 10)
  112. #define kVstTransportPlaying (1 << 1)
  113. struct RemoteVstPlugin;
  114. #define kVstNanosValid (1 << 8)
  115. #define kVstPpqPosValid (1 << 9)
  116. #define kVstTempoValid (1 << 10)
  117. #define kVstBarsValid (1 << 11)
  118. #define kVstCyclePosValid (1 << 12)
  119. #define kVstTimeSigValid (1 << 13)
  120. #define kVstSmpteValid (1 << 14)
  121. #define kVstClockValid (1 << 15)
  122. struct _VstMidiEvent
  123. {
  124. // 00
  125. int type;
  126. // 04
  127. int byteSize;
  128. // 08
  129. int deltaFrames;
  130. // 0c?
  131. int flags;
  132. // 10?
  133. int noteLength;
  134. // 14?
  135. int noteOffset;
  136. // 18
  137. char midiData[4];
  138. // 1c?
  139. char detune;
  140. // 1d?
  141. char noteOffVelocity;
  142. // 1e?
  143. char reserved1;
  144. // 1f?
  145. char reserved2;
  146. };
  147. typedef struct _VstMidiEvent VstMidiEvent;
  148. struct _VstEvent
  149. {
  150. char dump[sizeof (VstMidiEvent)];
  151. };
  152. typedef struct _VstEvent VstEvent;
  153. struct _VstEvents
  154. {
  155. // 00
  156. int numEvents;
  157. // 04
  158. void *reserved;
  159. // 08
  160. VstEvent * events[2];
  161. };
  162. typedef struct _VstEvents VstEvents;
  163. /* this struct taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
  164. struct _VstParameterProperties
  165. {
  166. float stepFloat;
  167. float smallStepFloat;
  168. float largeStepFloat;
  169. char label[64];
  170. int32_t flags;
  171. int32_t minInteger;
  172. int32_t maxInteger;
  173. int32_t stepInteger;
  174. int32_t largeStepInteger;
  175. char shortLabel[8];
  176. };
  177. typedef struct _VstParameterProperties VstParameterProperties;
  178. /* this enum taken from http://asseca.com/vst-24-specs/efGetParameterProperties.html */
  179. enum VstParameterFlags
  180. {
  181. kVstParameterIsSwitch = 1 << 0, /* parameter is a switch (on/off) */
  182. kVstParameterUsesIntegerMinMax = 1 << 1, /* minInteger, maxInteger valid */
  183. kVstParameterUsesFloatStep = 1 << 2, /* stepFloat, smallStepFloat, largeStepFloat valid */
  184. kVstParameterUsesIntStep = 1 << 3, /* stepInteger, largeStepInteger valid */
  185. kVstParameterSupportsDisplayIndex = 1 << 4, /* displayIndex valid */
  186. kVstParameterSupportsDisplayCategory = 1 << 5, /* category, etc. valid */
  187. kVstParameterCanRamp = 1 << 6 /* set if parameter value can ramp up/down */
  188. };
  189. struct _AEffect
  190. {
  191. // Never use virtual functions!!!
  192. // 00-03
  193. int magic;
  194. // dispatcher 04-07
  195. intptr_t (* dispatcher) (struct _AEffect *, int, int, intptr_t, void *, float);
  196. // process, quite sure 08-0b
  197. void (* process) (struct _AEffect *, float **, float **, int);
  198. // setParameter 0c-0f
  199. void (* setParameter) (struct _AEffect *, int, float);
  200. // getParameter 10-13
  201. float (* getParameter) (struct _AEffect *, int);
  202. // programs 14-17
  203. int numPrograms;
  204. // Params 18-1b
  205. int numParams;
  206. // Input 1c-1f
  207. int numInputs;
  208. // Output 20-23
  209. int numOutputs;
  210. // flags 24-27
  211. int flags;
  212. // Fill somewhere 28-2b
  213. void *ptr1;
  214. void *ptr2;
  215. // Zeroes 2c-2f 30-33 34-37 38-3b
  216. char empty3[4 + 4 + 4];
  217. // 1.0f 3c-3f
  218. float unkown_float;
  219. // An object? pointer 40-43
  220. void *ptr3;
  221. // Zeroes 44-47
  222. void *user;
  223. // Id 48-4b
  224. int32_t uniqueID;
  225. // Don't know 4c-4f
  226. char unknown1[4];
  227. // processReplacing 50-53
  228. void (* processReplacing) (struct _AEffect *, float **, float **, int);
  229. };
  230. typedef struct _AEffect AEffect;
  231. struct _VstTimeInfo
  232. {
  233. // 00
  234. double samplePos;
  235. // 08
  236. double sampleRate;
  237. // unconfirmed 10 18
  238. char empty1[8 + 8];
  239. // 20?
  240. double tempo;
  241. // unconfirmed 28 30 38
  242. char empty2[8 + 8 + 8];
  243. // 40?
  244. int timeSigNumerator;
  245. // 44?
  246. int timeSigDenominator;
  247. // unconfirmed 48 4c 50
  248. char empty3[4 + 4 + 4];
  249. // 54
  250. int flags;
  251. };
  252. typedef struct _VstTimeInfo VstTimeInfo;
  253. typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
  254. #endif