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.

zynaddsubfx-src.cpp 11KB

10 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #include "CarlaDefines.h"
  18. #define PLUGINVERSION
  19. #define SOURCE_DIR "/usr/share/zynaddsubfx/examples"
  20. #undef override
  21. // ignore some compiler warnings
  22. #if defined(__GNUC__) && (__GNUC__ >= 6)
  23. # pragma GCC diagnostic push
  24. # pragma GCC diagnostic ignored "-Wshift-negative-value"
  25. #elif defined(__clang__)
  26. # pragma clang diagnostic push
  27. # pragma clang diagnostic ignored "-Winconsistent-missing-override"
  28. # pragma clang diagnostic ignored "-Wunused-private-field"
  29. #endif
  30. // base c-style headers
  31. #include "zynaddsubfx/tlsf/tlsf.h"
  32. #include "zynaddsubfx/rtosc/rtosc.h"
  33. // C-code includes
  34. extern "C" {
  35. #include "zynaddsubfx/tlsf/tlsf.c"
  36. #undef TLSF_64BIT
  37. #undef tlsf_decl
  38. #undef tlsf_fls_sizet
  39. #undef tlsf_cast
  40. #undef tlsf_min
  41. #undef tlsf_max
  42. #undef tlsf_assert
  43. #undef _tlsf_glue2
  44. #undef _tlsf_glue
  45. #undef tlsf_static_assert
  46. #undef tlsf_insist
  47. #include "zynaddsubfx/rtosc/dispatch.c"
  48. #include "zynaddsubfx/rtosc/rtosc.c"
  49. }
  50. // rtosc includes
  51. #include "zynaddsubfx/rtosc/cpp/automations.cpp"
  52. #include "zynaddsubfx/rtosc/cpp/midimapper.cpp"
  53. #include "zynaddsubfx/rtosc/cpp/miditable.cpp"
  54. #undef RTOSC_INVALID_MIDI
  55. #undef MAX_UNHANDLED_PATH
  56. #include "zynaddsubfx/rtosc/cpp/ports.cpp"
  57. #undef __builtin_expect
  58. #include "zynaddsubfx/rtosc/cpp/subtree-serialize.cpp"
  59. #include "zynaddsubfx/rtosc/cpp/thread-link.cpp"
  60. #undef off_t
  61. #include "zynaddsubfx/rtosc/cpp/undo-history.cpp"
  62. // zynaddsubfx includes
  63. #include "zynaddsubfx/version.cpp"
  64. #include "zynaddsubfx/Containers/MultiPseudoStack.cpp"
  65. #undef rBegin
  66. #undef rObject
  67. #undef rStdString
  68. #undef rStdStringCb
  69. #undef rChangeCb
  70. #define rChangeCb
  71. #include "zynaddsubfx/Containers/NotePool.cpp"
  72. #undef rBegin
  73. #undef rObject
  74. #undef rStdString
  75. #undef rStdStringCb
  76. #undef rChangeCb
  77. #define rChangeCb
  78. #include "zynaddsubfx/Containers/ScratchString.cpp"
  79. #undef rBegin
  80. #undef rObject
  81. #undef rStdString
  82. #undef rStdStringCb
  83. #undef rChangeCb
  84. #define rChangeCb
  85. #include "zynaddsubfx/DSP/AnalogFilter.cpp"
  86. #undef rBegin
  87. #undef rObject
  88. #undef rStdString
  89. #undef rStdStringCb
  90. #undef rChangeCb
  91. #define rChangeCb
  92. #include "zynaddsubfx/DSP/FFTwrapper.cpp"
  93. #undef rBegin
  94. #undef rObject
  95. #undef rStdString
  96. #undef rStdStringCb
  97. #undef rChangeCb
  98. #define rChangeCb
  99. #include "zynaddsubfx/DSP/Filter.cpp"
  100. #undef rBegin
  101. #undef rObject
  102. #undef rStdString
  103. #undef rStdStringCb
  104. #undef rChangeCb
  105. #define rChangeCb
  106. #include "zynaddsubfx/DSP/FormantFilter.cpp"
  107. #undef rBegin
  108. #undef rObject
  109. #undef rStdString
  110. #undef rStdStringCb
  111. #undef rChangeCb
  112. #define rChangeCb
  113. #include "zynaddsubfx/DSP/SVFilter.cpp"
  114. #undef rBegin
  115. #undef rObject
  116. #undef rStdString
  117. #undef rStdStringCb
  118. #undef rChangeCb
  119. #define rChangeCb
  120. #include "zynaddsubfx/DSP/Unison.cpp"
  121. #undef rBegin
  122. #undef rObject
  123. #undef rStdString
  124. #undef rStdStringCb
  125. #undef rChangeCb
  126. #define rChangeCb
  127. #include "zynaddsubfx/Effects/Alienwah.cpp"
  128. #undef rBegin
  129. #undef rObject
  130. #undef rStdString
  131. #undef rStdStringCb
  132. #undef rChangeCb
  133. #define rChangeCb
  134. #include "zynaddsubfx/Effects/Chorus.cpp"
  135. #undef rBegin
  136. #undef rObject
  137. #undef rStdString
  138. #undef rStdStringCb
  139. #undef rChangeCb
  140. #define rChangeCb
  141. #include "zynaddsubfx/Effects/Distorsion.cpp"
  142. #undef rBegin
  143. #undef rObject
  144. #undef rStdString
  145. #undef rStdStringCb
  146. #undef rChangeCb
  147. #define rChangeCb
  148. #include "zynaddsubfx/Effects/DynamicFilter.cpp"
  149. #undef rBegin
  150. #undef rObject
  151. #undef rStdString
  152. #undef rStdStringCb
  153. #undef rChangeCb
  154. #define rChangeCb
  155. #include "zynaddsubfx/Effects/Echo.cpp"
  156. #undef MAX_DELAY
  157. #undef rBegin
  158. #undef rObject
  159. #undef rStdString
  160. #undef rStdStringCb
  161. #undef rChangeCb
  162. #define rChangeCb
  163. #include "zynaddsubfx/Effects/Effect.cpp"
  164. #undef rBegin
  165. #undef rObject
  166. #undef rStdString
  167. #undef rStdStringCb
  168. #undef rChangeCb
  169. #define rChangeCb
  170. #include "zynaddsubfx/Effects/EffectLFO.cpp"
  171. #undef rBegin
  172. #undef rObject
  173. #undef rStdString
  174. #undef rStdStringCb
  175. #undef rChangeCb
  176. #define rChangeCb
  177. #include "zynaddsubfx/Effects/EffectMgr.cpp"
  178. #undef rBegin
  179. #undef rObject
  180. #undef rStdString
  181. #undef rStdStringCb
  182. #undef rChangeCb
  183. #define rChangeCb
  184. #include "zynaddsubfx/Effects/EQ.cpp"
  185. #undef rBegin
  186. #undef rObject
  187. #undef rStdString
  188. #undef rStdStringCb
  189. #undef rChangeCb
  190. #define rChangeCb
  191. #include "zynaddsubfx/Effects/Phaser.cpp"
  192. #undef PHASER_LFO_SHAPE
  193. #undef ONE_
  194. #undef ZERO_
  195. #undef rBegin
  196. #undef rObject
  197. #undef rStdString
  198. #undef rStdStringCb
  199. #undef rChangeCb
  200. #define rChangeCb
  201. #include "zynaddsubfx/Effects/Reverb.cpp"
  202. #undef rBegin
  203. #undef rObject
  204. #undef rStdString
  205. #undef rStdStringCb
  206. #undef rChangeCb
  207. #define rChangeCb
  208. #include "zynaddsubfx/Misc/Allocator.cpp"
  209. #undef rBegin
  210. #undef rObject
  211. #undef rStdString
  212. #undef rStdStringCb
  213. #undef rChangeCb
  214. #define rChangeCb
  215. #include "zynaddsubfx/Misc/Bank.cpp"
  216. #undef INSTRUMENT_EXTENSION
  217. #undef FORCE_BANK_DIR_FILE
  218. #undef rBegin
  219. #undef rObject
  220. #undef rStdString
  221. #undef rStdStringCb
  222. #undef rChangeCb
  223. #define rChangeCb
  224. #define INSTRUMENT_EXTENSION INSTRUMENT_EXTENSION_DB
  225. #include "zynaddsubfx/Misc/BankDb.cpp"
  226. #undef INSTRUMENT_EXTENSION
  227. #undef rBegin
  228. #undef rObject
  229. #undef rStdString
  230. #undef rStdStringCb
  231. #undef rChangeCb
  232. #define rChangeCb
  233. #include "zynaddsubfx/Misc/CallbackRepeater.cpp"
  234. #undef rBegin
  235. #undef rObject
  236. #undef rStdString
  237. #undef rStdStringCb
  238. #undef rChangeCb
  239. #define rChangeCb
  240. #include "zynaddsubfx/Misc/Config.cpp"
  241. #undef rBegin
  242. #undef rObject
  243. #undef rStdString
  244. #undef rStdStringCb
  245. #undef rChangeCb
  246. #define rChangeCb
  247. #include "zynaddsubfx/Misc/Master.cpp"
  248. #undef rObject
  249. #undef rStdString
  250. #undef rStdStringCb
  251. #undef rChangeCb
  252. #define rChangeCb
  253. #include "zynaddsubfx/Misc/Microtonal.cpp"
  254. #undef MAX_LINE_SIZE
  255. #undef rBegin
  256. #undef rObject
  257. #undef rStdString
  258. #undef rStdStringCb
  259. #undef rChangeCb
  260. #define rChangeCb
  261. #include "zynaddsubfx/Misc/MiddleWare.cpp"
  262. #undef rBegin
  263. #undef rObject
  264. #undef rStdString
  265. #undef rStdStringCb
  266. #undef rChangeCb
  267. #define rChangeCb
  268. #include "zynaddsubfx/Misc/Part.cpp"
  269. #undef CLONE
  270. #undef rBegin
  271. #undef rObject
  272. #undef rStdString
  273. #undef rStdStringCb
  274. #undef rChangeCb
  275. #define rChangeCb
  276. #include "zynaddsubfx/Misc/PresetExtractor.cpp"
  277. #undef rBegin
  278. #undef rObject
  279. #undef rStdString
  280. #undef rStdStringCb
  281. #undef rChangeCb
  282. #define rChangeCb
  283. #include "zynaddsubfx/Misc/Recorder.cpp"
  284. #undef rBegin
  285. #undef rObject
  286. #undef rStdString
  287. #undef rStdStringCb
  288. #undef rChangeCb
  289. #define rChangeCb
  290. #include "zynaddsubfx/Misc/Util.cpp"
  291. #undef rBegin
  292. #undef rObject
  293. #undef rStdString
  294. #undef rStdStringCb
  295. #undef rChangeCb
  296. #define rChangeCb
  297. #include "zynaddsubfx/Misc/WavFile.cpp"
  298. #undef rBegin
  299. #undef rObject
  300. #undef rStdString
  301. #undef rStdStringCb
  302. #undef rChangeCb
  303. #define rChangeCb
  304. #include "zynaddsubfx/Misc/WaveShapeSmps.cpp"
  305. #undef rBegin
  306. #undef rObject
  307. #undef rStdString
  308. #undef rStdStringCb
  309. #undef rChangeCb
  310. #define rChangeCb
  311. #include "zynaddsubfx/Misc/XMLwrapper.cpp"
  312. #undef rBegin
  313. #undef rObject
  314. #undef rStdString
  315. #undef rStdStringCb
  316. #undef rChangeCb
  317. #define rChangeCb
  318. #include "zynaddsubfx/Params/ADnoteParameters.cpp"
  319. #undef EXPAND
  320. #undef rBegin
  321. #undef rObject
  322. #undef rStdString
  323. #undef rStdStringCb
  324. #undef rChangeCb
  325. #define rChangeCb
  326. #include "zynaddsubfx/Params/Controller.cpp"
  327. #undef rBegin
  328. #undef rObject
  329. #undef rStdString
  330. #undef rStdStringCb
  331. #undef rChangeCb
  332. #define rChangeCb
  333. #include "zynaddsubfx/Params/EnvelopeParams.cpp"
  334. #undef rBegin
  335. #undef rObject
  336. #undef rStdString
  337. #undef rStdStringCb
  338. #undef rChangeCb
  339. #define rChangeCb
  340. #include "zynaddsubfx/Params/FilterParams.cpp"
  341. #undef rBegin
  342. #undef rObject
  343. #undef rStdString
  344. #undef rStdStringCb
  345. #undef rChangeCb
  346. #define rChangeCb
  347. #include "zynaddsubfx/Params/LFOParams.cpp"
  348. #undef rBegin
  349. #undef rObject
  350. #undef rStdString
  351. #undef rStdStringCb
  352. #undef rChangeCb
  353. #define rChangeCb
  354. #include "zynaddsubfx/Params/PADnoteParameters.cpp"
  355. #undef PC
  356. #undef P_C
  357. #undef rBegin
  358. #undef rObject
  359. #undef rStdString
  360. #undef rStdStringCb
  361. #undef rChangeCb
  362. #define rChangeCb
  363. #include "zynaddsubfx/Params/Presets.cpp"
  364. #undef rBegin
  365. #undef rObject
  366. #undef rStdString
  367. #undef rStdStringCb
  368. #undef rChangeCb
  369. #define rChangeCb
  370. #include "zynaddsubfx/Params/PresetsArray.cpp"
  371. #undef rBegin
  372. #undef rObject
  373. #undef rStdString
  374. #undef rStdStringCb
  375. #undef rChangeCb
  376. #define rChangeCb
  377. #include "zynaddsubfx/Params/PresetsStore.cpp"
  378. #undef rBegin
  379. #undef rObject
  380. #undef rStdString
  381. #undef rStdStringCb
  382. #undef rChangeCb
  383. #define rChangeCb
  384. #include "zynaddsubfx/Params/SUBnoteParameters.cpp"
  385. #undef doPaste
  386. #undef doPPaste
  387. #undef rBegin
  388. #undef rObject
  389. #undef rStdString
  390. #undef rStdStringCb
  391. #undef rChangeCb
  392. #define rChangeCb
  393. #include "zynaddsubfx/Synth/ADnote.cpp"
  394. #undef rBegin
  395. #undef rObject
  396. #undef rStdString
  397. #undef rStdStringCb
  398. #undef rChangeCb
  399. #define rChangeCb
  400. #include "zynaddsubfx/Synth/Envelope.cpp"
  401. #undef rBegin
  402. #undef rObject
  403. #undef rStdString
  404. #undef rStdStringCb
  405. #undef rChangeCb
  406. #define rChangeCb
  407. #include "zynaddsubfx/Synth/LFO.cpp"
  408. #undef rBegin
  409. #undef rObject
  410. #undef rStdString
  411. #undef rStdStringCb
  412. #undef rChangeCb
  413. #define rChangeCb
  414. #include "zynaddsubfx/Synth/ModFilter.cpp"
  415. #undef rBegin
  416. #undef rObject
  417. #undef rStdString
  418. #undef rStdStringCb
  419. #undef rChangeCb
  420. #define rChangeCb
  421. #include "zynaddsubfx/Synth/OscilGen.cpp"
  422. #undef PC
  423. #undef DIFF
  424. #undef PRESERVE
  425. #undef RESTORE
  426. #undef FUNC
  427. #undef FILTER
  428. #undef rBegin
  429. #undef rObject
  430. #undef rStdString
  431. #undef rStdStringCb
  432. #undef rChangeCb
  433. #define rChangeCb
  434. #include "zynaddsubfx/Synth/PADnote.cpp"
  435. #undef rBegin
  436. #undef rObject
  437. #undef rStdString
  438. #undef rStdStringCb
  439. #undef rChangeCb
  440. #define rChangeCb
  441. #include "zynaddsubfx/Synth/Resonance.cpp"
  442. #undef rBegin
  443. #undef rObject
  444. #undef rStdString
  445. #undef rStdStringCb
  446. #undef rChangeCb
  447. #define rChangeCb
  448. #include "zynaddsubfx/Synth/SUBnote.cpp"
  449. #undef rBegin
  450. #undef rObject
  451. #undef rStdString
  452. #undef rStdStringCb
  453. #undef rChangeCb
  454. #define rChangeCb
  455. #include "zynaddsubfx/Synth/SynthNote.cpp"
  456. #undef rBegin
  457. #undef rObject
  458. #undef rStdString
  459. #undef rStdStringCb
  460. #undef rChangeCb
  461. #define rChangeCb
  462. #include "zynaddsubfx/Synth/WatchPoint.cpp"
  463. #undef rBegin
  464. #undef rObject
  465. #undef rStdString
  466. #undef rStdStringCb
  467. #undef rChangeCb
  468. #define rChangeCb
  469. #include "zynaddsubfx/UI/ConnectionDummy.cpp"
  470. #undef rBegin
  471. #undef rObject
  472. #undef rStdString
  473. #undef rStdStringCb
  474. #undef rChangeCb
  475. #define rChangeCb
  476. #include "zynaddsubfx/globals.cpp"
  477. #if defined(__GNUC__) && (__GNUC__ >= 6)
  478. # pragma GCC diagnostic pop
  479. #elif defined(__clang__)
  480. # pragma clang diagnostic pop
  481. #endif
  482. // Dummy variables and functions for linking purposes
  483. namespace zyncarla {
  484. class WavFile;
  485. namespace Nio {
  486. void masterSwap(Master*){}
  487. bool setSource(std::string){return true;}
  488. bool setSink(std::string){return true;}
  489. std::set<std::string> getSources(void){return std::set<std::string>();}
  490. std::set<std::string> getSinks(void){return std::set<std::string>();}
  491. std::string getSource(void){return "";}
  492. std::string getSink(void){return "";}
  493. void waveNew(WavFile*){}
  494. void waveStart(){}
  495. void waveStop(){}
  496. }
  497. }