aeffectx.h 7.2 KB

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