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.

CarlaBackend.h 44KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946
  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2021 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. #ifndef CARLA_BACKEND_H_INCLUDED
  18. #define CARLA_BACKEND_H_INCLUDED
  19. #include "CarlaDefines.h"
  20. #ifdef CARLA_PROPER_CPP11_SUPPORT
  21. # include <cstdint>
  22. #else
  23. # include <stdint.h>
  24. #endif
  25. #define STR_MAX 0xFF
  26. #ifdef __cplusplus
  27. # define CARLA_BACKEND_START_NAMESPACE namespace CarlaBackend {
  28. # define CARLA_BACKEND_END_NAMESPACE }
  29. # define CARLA_BACKEND_USE_NAMESPACE using namespace CarlaBackend;
  30. # include <algorithm>
  31. # include <cmath>
  32. # include <limits>
  33. /* Start namespace */
  34. CARLA_BACKEND_START_NAMESPACE
  35. #endif
  36. /*!
  37. * @defgroup CarlaBackendAPI Carla Backend API
  38. *
  39. * The Carla Backend API.
  40. *
  41. * These are the base definitions for everything in the Carla backend code.
  42. * @{
  43. */
  44. /* ------------------------------------------------------------------------------------------------------------
  45. * Carla Backend API (base definitions) */
  46. /*!
  47. * Maximum default number of loadable plugins.
  48. */
  49. static const uint MAX_DEFAULT_PLUGINS = 512;
  50. /*!
  51. * Maximum number of loadable plugins in rack mode.
  52. */
  53. static const uint MAX_RACK_PLUGINS = 64;
  54. /*!
  55. * Maximum number of loadable plugins in patchbay mode.
  56. */
  57. static const uint MAX_PATCHBAY_PLUGINS = 255;
  58. /*!
  59. * Maximum default number of parameters allowed.
  60. * @see ENGINE_OPTION_MAX_PARAMETERS
  61. */
  62. static const uint MAX_DEFAULT_PARAMETERS = 200;
  63. /*!
  64. * The "plugin Id" for the global Carla instance.
  65. * Currently only used for audio peaks.
  66. */
  67. static const uint MAIN_CARLA_PLUGIN_ID = 0xFFFF;
  68. /* ------------------------------------------------------------------------------------------------------------
  69. * Engine Driver Device Hints */
  70. /*!
  71. * @defgroup EngineDriverHints Engine Driver Device Hints
  72. *
  73. * Various engine driver device hints.
  74. * @see CarlaEngine::getHints(), CarlaEngine::getDriverDeviceInfo() and carla_get_engine_driver_device_info()
  75. * @{
  76. */
  77. /*!
  78. * Engine driver device has custom control-panel.
  79. */
  80. static const uint ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1;
  81. /*!
  82. * Engine driver device can use a triple-buffer (3 number of periods instead of the usual 2).
  83. * @see ENGINE_OPTION_AUDIO_NUM_PERIODS
  84. */
  85. static const uint ENGINE_DRIVER_DEVICE_CAN_TRIPLE_BUFFER = 0x2;
  86. /*!
  87. * Engine driver device can change buffer-size on the fly.
  88. * @see ENGINE_OPTION_AUDIO_BUFFER_SIZE
  89. */
  90. static const uint ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x4;
  91. /*!
  92. * Engine driver device can change sample-rate on the fly.
  93. * @see ENGINE_OPTION_AUDIO_SAMPLE_RATE
  94. */
  95. static const uint ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x8;
  96. /** @} */
  97. /* ------------------------------------------------------------------------------------------------------------
  98. * Plugin Hints */
  99. /*!
  100. * @defgroup PluginHints Plugin Hints
  101. *
  102. * Various plugin hints.
  103. * @see CarlaPlugin::getHints() and carla_get_plugin_info()
  104. * @{
  105. */
  106. /*!
  107. * Plugin is a bridge.
  108. * This hint is required because "bridge" itself is not a plugin type.
  109. */
  110. static const uint PLUGIN_IS_BRIDGE = 0x001;
  111. /*!
  112. * Plugin is hard real-time safe.
  113. */
  114. static const uint PLUGIN_IS_RTSAFE = 0x002;
  115. /*!
  116. * Plugin is a synth (produces sound).
  117. */
  118. static const uint PLUGIN_IS_SYNTH = 0x004;
  119. /*!
  120. * Plugin has its own custom UI.
  121. * @see CarlaPlugin::showCustomUI() and carla_show_custom_ui()
  122. */
  123. static const uint PLUGIN_HAS_CUSTOM_UI = 0x008;
  124. /*!
  125. * Plugin can use internal Dry/Wet control.
  126. */
  127. static const uint PLUGIN_CAN_DRYWET = 0x010;
  128. /*!
  129. * Plugin can use internal Volume control.
  130. */
  131. static const uint PLUGIN_CAN_VOLUME = 0x020;
  132. /*!
  133. * Plugin can use internal (Stereo) Balance controls.
  134. */
  135. static const uint PLUGIN_CAN_BALANCE = 0x040;
  136. /*!
  137. * Plugin can use internal (Mono) Panning control.
  138. */
  139. static const uint PLUGIN_CAN_PANNING = 0x080;
  140. /*!
  141. * Plugin needs a constant, fixed-size audio buffer.
  142. */
  143. static const uint PLUGIN_NEEDS_FIXED_BUFFERS = 0x100;
  144. /*!
  145. * Plugin needs to receive all UI events in the main thread.
  146. */
  147. static const uint PLUGIN_NEEDS_UI_MAIN_THREAD = 0x200;
  148. /*!
  149. * Plugin uses 1 program per MIDI channel.
  150. * @note: Only used in some internal plugins and sf2 files.
  151. */
  152. static const uint PLUGIN_USES_MULTI_PROGS = 0x400;
  153. /*!
  154. * Plugin can make use of inline display API.
  155. */
  156. static const uint PLUGIN_HAS_INLINE_DISPLAY = 0x800;
  157. /*!
  158. * Plugin has its own custom UI which can be embed into another Window.
  159. * @see CarlaPlugin::embedCustomUI() and carla_embed_custom_ui()
  160. * @note This is very experimental and subject to change at this point
  161. */
  162. static const uint PLUGIN_HAS_CUSTOM_EMBED_UI = 0x1000;
  163. /** @} */
  164. /* ------------------------------------------------------------------------------------------------------------
  165. * Plugin Options */
  166. /*!
  167. * @defgroup PluginOptions Plugin Options
  168. *
  169. * Various plugin options.
  170. * @note Do not modify these values, as they are saved as-is in project files.
  171. * @see CarlaPlugin::getOptionsAvailable(), CarlaPlugin::getOptionsEnabled(), carla_get_plugin_info() and carla_set_option()
  172. * @{
  173. */
  174. /*!
  175. * Use constant/fixed-size audio buffers.
  176. */
  177. static const uint PLUGIN_OPTION_FIXED_BUFFERS = 0x001;
  178. /*!
  179. * Force mono plugin as stereo.
  180. */
  181. static const uint PLUGIN_OPTION_FORCE_STEREO = 0x002;
  182. /*!
  183. * Map MIDI programs to plugin programs.
  184. */
  185. static const uint PLUGIN_OPTION_MAP_PROGRAM_CHANGES = 0x004;
  186. /*!
  187. * Use chunks to save and restore data instead of parameter values.
  188. */
  189. static const uint PLUGIN_OPTION_USE_CHUNKS = 0x008;
  190. /*!
  191. * Send MIDI control change events.
  192. */
  193. static const uint PLUGIN_OPTION_SEND_CONTROL_CHANGES = 0x010;
  194. /*!
  195. * Send MIDI channel pressure events.
  196. */
  197. static const uint PLUGIN_OPTION_SEND_CHANNEL_PRESSURE = 0x020;
  198. /*!
  199. * Send MIDI note after-touch events.
  200. */
  201. static const uint PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040;
  202. /*!
  203. * Send MIDI pitch-bend events.
  204. */
  205. static const uint PLUGIN_OPTION_SEND_PITCHBEND = 0x080;
  206. /*!
  207. * Send MIDI all-sounds/notes-off events, single note-offs otherwise.
  208. */
  209. static const uint PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100;
  210. /*!
  211. * Send MIDI bank/program changes.
  212. * @note: This option conflicts with PLUGIN_OPTION_MAP_PROGRAM_CHANGES and cannot be used at the same time.
  213. */
  214. static const uint PLUGIN_OPTION_SEND_PROGRAM_CHANGES = 0x200;
  215. /*!
  216. * Skip sending MIDI note events.
  217. * This if off-by-default as a way to keep backwards compatibility.
  218. * We always want notes enabled by default, not the contrary.
  219. */
  220. static const uint PLUGIN_OPTION_SKIP_SENDING_NOTES = 0x400;
  221. /*!
  222. * Special flag to indicate that plugin options are not yet set.
  223. * This flag exists because 0x0 as an option value is a valid one, so we need something else to indicate "null-ness".
  224. */
  225. static const uint PLUGIN_OPTIONS_NULL = 0x10000;
  226. /** @} */
  227. /* ------------------------------------------------------------------------------------------------------------
  228. * Parameter Hints */
  229. /*!
  230. * @defgroup ParameterHints Parameter Hints
  231. *
  232. * Various parameter hints.
  233. * @see CarlaPlugin::getParameterData() and carla_get_parameter_data()
  234. * @{
  235. */
  236. /*!
  237. * Parameter value is boolean.
  238. * It's always at either minimum or maximum value.
  239. */
  240. static const uint PARAMETER_IS_BOOLEAN = 0x001;
  241. /*!
  242. * Parameter value is integer.
  243. */
  244. static const uint PARAMETER_IS_INTEGER = 0x002;
  245. /*!
  246. * Parameter value is logarithmic.
  247. */
  248. static const uint PARAMETER_IS_LOGARITHMIC = 0x004;
  249. /*!
  250. * Parameter is enabled.
  251. * It can be viewed, changed and stored.
  252. */
  253. static const uint PARAMETER_IS_ENABLED = 0x010;
  254. /*!
  255. * Parameter is automable (real-time safe).
  256. */
  257. static const uint PARAMETER_IS_AUTOMABLE = 0x020;
  258. /*!
  259. * Parameter is read-only.
  260. * It cannot be changed.
  261. */
  262. static const uint PARAMETER_IS_READ_ONLY = 0x040;
  263. /*!
  264. * Parameter needs sample rate to work.
  265. * Value and ranges are multiplied by sample rate on usage and divided by sample rate on save.
  266. */
  267. static const uint PARAMETER_USES_SAMPLERATE = 0x100;
  268. /*!
  269. * Parameter uses scale points to define internal values in a meaningful way.
  270. */
  271. static const uint PARAMETER_USES_SCALEPOINTS = 0x200;
  272. /*!
  273. * Parameter uses custom text for displaying its value.
  274. * @see CarlaPlugin::getParameterText() and carla_get_parameter_text()
  275. */
  276. static const uint PARAMETER_USES_CUSTOM_TEXT = 0x400;
  277. /*!
  278. * Parameter can be turned into a CV control.
  279. */
  280. static const uint PARAMETER_CAN_BE_CV_CONTROLLED = 0x800;
  281. /*!
  282. * Parameter should not be saved as part of the project/session.
  283. * @note only valid for parameter inputs.
  284. */
  285. static const uint PARAMETER_IS_NOT_SAVED = 0x1000;
  286. /** @} */
  287. /* ------------------------------------------------------------------------------------------------------------
  288. * Mapped Parameter Flags */
  289. /*!
  290. * @defgroup MappedParameterFlags Mapped Parameter Flags
  291. *
  292. * Various flags for parameter mappings.
  293. * @see ParameterData::mappedFlags
  294. * @{
  295. */
  296. /*!
  297. * Parameter mapping uses delta value instead of full scale.
  298. * Only relevant for MIDI CC mappings.
  299. */
  300. static const uint PARAMETER_MAPPING_MIDI_DELTA = 0x001;
  301. /** @} */
  302. /* ------------------------------------------------------------------------------------------------------------
  303. * Patchbay Port Hints */
  304. /*!
  305. * @defgroup PatchbayPortHints Patchbay Port Hints
  306. *
  307. * Various patchbay port hints.
  308. * @{
  309. */
  310. /*!
  311. * Patchbay port is input.
  312. * When this hint is not set, port is assumed to be output.
  313. */
  314. static const uint PATCHBAY_PORT_IS_INPUT = 0x01;
  315. /*!
  316. * Patchbay port is of Audio type.
  317. */
  318. static const uint PATCHBAY_PORT_TYPE_AUDIO = 0x02;
  319. /*!
  320. * Patchbay port is of CV type (Control Voltage).
  321. */
  322. static const uint PATCHBAY_PORT_TYPE_CV = 0x04;
  323. /*!
  324. * Patchbay port is of MIDI type.
  325. */
  326. static const uint PATCHBAY_PORT_TYPE_MIDI = 0x08;
  327. /*!
  328. * Patchbay port is of OSC type.
  329. */
  330. static const uint PATCHBAY_PORT_TYPE_OSC = 0x10;
  331. /** @} */
  332. /* ------------------------------------------------------------------------------------------------------------
  333. * Patchbay Port Group Hints */
  334. /*!
  335. * @defgroup PatchbayPortGroupHints Patchbay Port Group Hints
  336. *
  337. * Various patchbay port group hints.
  338. * @{
  339. */
  340. /*!
  341. * Indicates that this group should be considered the "main" input.
  342. */
  343. static const uint PATCHBAY_PORT_GROUP_MAIN_INPUT = 0x01;
  344. /*!
  345. * Indicates that this group should be considered the "main" output.
  346. */
  347. static const uint PATCHBAY_PORT_GROUP_MAIN_OUTPUT = 0x02;
  348. /*!
  349. * A stereo port group, where the 1st port is left and the 2nd is right.
  350. */
  351. static const uint PATCHBAY_PORT_GROUP_STEREO = 0x04;
  352. /*!
  353. * A mid-side stereo group, where the 1st port is center and the 2nd is side.
  354. */
  355. static const uint PATCHBAY_PORT_GROUP_MID_SIDE = 0x08;
  356. /** @} */
  357. /* ------------------------------------------------------------------------------------------------------------
  358. * Custom Data Types */
  359. /*!
  360. * @defgroup CustomDataTypes Custom Data Types
  361. *
  362. * These types define how the value in the CustomData struct is stored.
  363. * @see CustomData::type
  364. * @{
  365. */
  366. /*!
  367. * Boolean string type URI.
  368. * Only "true" and "false" are valid values.
  369. */
  370. static const char* const CUSTOM_DATA_TYPE_BOOLEAN = "http://kxstudio.sf.net/ns/carla/boolean";
  371. /*!
  372. * Chunk type URI.
  373. */
  374. static const char* const CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk";
  375. /*!
  376. * Property type URI.
  377. */
  378. static const char* const CUSTOM_DATA_TYPE_PROPERTY = "http://kxstudio.sf.net/ns/carla/property";
  379. /*!
  380. * String type URI.
  381. */
  382. static const char* const CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string";
  383. /** @} */
  384. /* ------------------------------------------------------------------------------------------------------------
  385. * Custom Data Keys */
  386. /*!
  387. * @defgroup CustomDataKeys Custom Data Keys
  388. *
  389. * Pre-defined keys used internally in Carla.
  390. * @see CustomData::key
  391. * @{
  392. */
  393. /*!
  394. * UI position key.
  395. */
  396. static const char* const CUSTOM_DATA_KEY_UI_POSITION = "CarlaUiPosition";
  397. /*!
  398. * UI size key.
  399. */
  400. static const char* const CUSTOM_DATA_KEY_UI_SIZE = "CarlaUiSize";
  401. /*!
  402. * UI visible key.
  403. */
  404. static const char* const CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUiVisible";
  405. /** @} */
  406. /* ------------------------------------------------------------------------------------------------------------
  407. * Binary Type */
  408. /*!
  409. * The binary type of a plugin.
  410. */
  411. typedef enum {
  412. /*!
  413. * Null binary type.
  414. */
  415. BINARY_NONE = 0,
  416. /*!
  417. * POSIX 32bit binary.
  418. */
  419. BINARY_POSIX32 = 1,
  420. /*!
  421. * POSIX 64bit binary.
  422. */
  423. BINARY_POSIX64 = 2,
  424. /*!
  425. * Windows 32bit binary.
  426. */
  427. BINARY_WIN32 = 3,
  428. /*!
  429. * Windows 64bit binary.
  430. */
  431. BINARY_WIN64 = 4,
  432. /*!
  433. * Other binary type.
  434. */
  435. BINARY_OTHER = 5
  436. } BinaryType;
  437. /* ------------------------------------------------------------------------------------------------------------
  438. * File Type */
  439. /*!
  440. * File type.
  441. */
  442. typedef enum {
  443. /*!
  444. * Null file type.
  445. */
  446. FILE_NONE = 0,
  447. /*!
  448. * Audio file.
  449. */
  450. FILE_AUDIO = 1,
  451. /*!
  452. * MIDI file.
  453. */
  454. FILE_MIDI = 2
  455. } FileType;
  456. /* ------------------------------------------------------------------------------------------------------------
  457. * Plugin Type */
  458. /*!
  459. * Plugin type.
  460. * Some files are handled as if they were plugins.
  461. */
  462. typedef enum {
  463. /*!
  464. * Null plugin type.
  465. */
  466. PLUGIN_NONE = 0,
  467. /*!
  468. * Internal plugin.
  469. */
  470. PLUGIN_INTERNAL = 1,
  471. /*!
  472. * LADSPA plugin.
  473. */
  474. PLUGIN_LADSPA = 2,
  475. /*!
  476. * DSSI plugin.
  477. */
  478. PLUGIN_DSSI = 3,
  479. /*!
  480. * LV2 plugin.
  481. */
  482. PLUGIN_LV2 = 4,
  483. /*!
  484. * VST2 plugin.
  485. */
  486. PLUGIN_VST2 = 5,
  487. /*!
  488. * VST3 plugin.
  489. * @note Windows and MacOS only
  490. */
  491. PLUGIN_VST3 = 6,
  492. /*!
  493. * AU plugin.
  494. * @note MacOS only
  495. */
  496. PLUGIN_AU = 7,
  497. /*!
  498. * DLS file.
  499. */
  500. PLUGIN_DLS = 8,
  501. /*!
  502. * GIG file.
  503. */
  504. PLUGIN_GIG = 9,
  505. /*!
  506. * SF2/3 file (SoundFont).
  507. */
  508. PLUGIN_SF2 = 10,
  509. /*!
  510. * SFZ file.
  511. */
  512. PLUGIN_SFZ = 11,
  513. /*!
  514. * JACK application.
  515. */
  516. PLUGIN_JACK = 12
  517. } PluginType;
  518. /* ------------------------------------------------------------------------------------------------------------
  519. * Plugin Category */
  520. /*!
  521. * Plugin category, which describes the functionality of a plugin.
  522. */
  523. typedef enum {
  524. /*!
  525. * Null plugin category.
  526. */
  527. PLUGIN_CATEGORY_NONE = 0,
  528. /*!
  529. * A synthesizer or generator.
  530. */
  531. PLUGIN_CATEGORY_SYNTH = 1,
  532. /*!
  533. * A delay or reverb.
  534. */
  535. PLUGIN_CATEGORY_DELAY = 2,
  536. /*!
  537. * An equalizer.
  538. */
  539. PLUGIN_CATEGORY_EQ = 3,
  540. /*!
  541. * A filter.
  542. */
  543. PLUGIN_CATEGORY_FILTER = 4,
  544. /*!
  545. * A distortion plugin.
  546. */
  547. PLUGIN_CATEGORY_DISTORTION = 5,
  548. /*!
  549. * A 'dynamic' plugin (amplifier, compressor, gate, etc).
  550. */
  551. PLUGIN_CATEGORY_DYNAMICS = 6,
  552. /*!
  553. * A 'modulator' plugin (chorus, flanger, phaser, etc).
  554. */
  555. PLUGIN_CATEGORY_MODULATOR = 7,
  556. /*!
  557. * An 'utility' plugin (analyzer, converter, mixer, etc).
  558. */
  559. PLUGIN_CATEGORY_UTILITY = 8,
  560. /*!
  561. * Miscellaneous plugin (used to check if the plugin has a category).
  562. */
  563. PLUGIN_CATEGORY_OTHER = 9
  564. } PluginCategory;
  565. /* ------------------------------------------------------------------------------------------------------------
  566. * Parameter Type */
  567. /*!
  568. * Plugin parameter type.
  569. */
  570. typedef enum {
  571. /*!
  572. * Null parameter type.
  573. */
  574. PARAMETER_UNKNOWN = 0,
  575. /*!
  576. * Input parameter.
  577. */
  578. PARAMETER_INPUT = 1,
  579. /*!
  580. * Output parameter.
  581. */
  582. PARAMETER_OUTPUT = 2
  583. } ParameterType;
  584. /* ------------------------------------------------------------------------------------------------------------
  585. * Internal Parameter Index */
  586. /*!
  587. * Special parameters used internally in Carla.
  588. * Plugins do not know about their existence.
  589. */
  590. typedef enum {
  591. /*!
  592. * Null parameter.
  593. */
  594. PARAMETER_NULL = -1,
  595. #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
  596. /*!
  597. * Active parameter, boolean type.
  598. * Default is 'false'.
  599. */
  600. PARAMETER_ACTIVE = -2,
  601. /*!
  602. * Dry/Wet parameter.
  603. * Range 0.0...1.0; default is 1.0.
  604. */
  605. PARAMETER_DRYWET = -3,
  606. /*!
  607. * Volume parameter.
  608. * Range 0.0...1.27; default is 1.0.
  609. */
  610. PARAMETER_VOLUME = -4,
  611. /*!
  612. * Stereo Balance-Left parameter.
  613. * Range -1.0...1.0; default is -1.0.
  614. */
  615. PARAMETER_BALANCE_LEFT = -5,
  616. /*!
  617. * Stereo Balance-Right parameter.
  618. * Range -1.0...1.0; default is 1.0.
  619. */
  620. PARAMETER_BALANCE_RIGHT = -6,
  621. /*!
  622. * Mono Panning parameter.
  623. * Range -1.0...1.0; default is 0.0.
  624. */
  625. PARAMETER_PANNING = -7,
  626. /*!
  627. * MIDI Control channel, integer type.
  628. * Range -1...15 (-1 = off).
  629. */
  630. PARAMETER_CTRL_CHANNEL = -8,
  631. #endif
  632. /*!
  633. * Max value, defined only for convenience.
  634. */
  635. PARAMETER_MAX = -9
  636. } InternalParameterIndex;
  637. /* ------------------------------------------------------------------------------------------------------------
  638. * Special Mapped Control Index */
  639. /*!
  640. * Specially designated mapped control indexes.
  641. * Values between 0 and 119 (0x77) are reserved for MIDI CC, which uses direct values.
  642. * @see ParameterData::mappedControlIndex
  643. */
  644. typedef enum {
  645. /*!
  646. * Unused control index, meaning no mapping is enabled.
  647. */
  648. CONTROL_INDEX_NONE = -1,
  649. /*!
  650. * CV control index, meaning the parameter is exposed as CV port.
  651. */
  652. CONTROL_INDEX_CV = 130,
  653. /*!
  654. * Special value to indicate MIDI pitchbend.
  655. */
  656. CONTROL_INDEX_MIDI_PITCHBEND = 131,
  657. /*!
  658. * Special value to indicate MIDI learn.
  659. */
  660. CONTROL_INDEX_MIDI_LEARN = 132,
  661. /*!
  662. * Highest index allowed for mappings.
  663. */
  664. CONTROL_INDEX_MAX_ALLOWED = CONTROL_INDEX_MIDI_LEARN
  665. } SpecialMappedControlIndex;
  666. /* ------------------------------------------------------------------------------------------------------------
  667. * Engine Callback Opcode */
  668. /*!
  669. * Engine callback opcodes.
  670. * Front-ends must never block indefinitely during a callback.
  671. * @see EngineCallbackFunc, CarlaEngine::setCallback() and carla_set_engine_callback()
  672. */
  673. typedef enum {
  674. /*!
  675. * Debug.
  676. * This opcode is undefined and used only for testing purposes.
  677. */
  678. ENGINE_CALLBACK_DEBUG = 0,
  679. /*!
  680. * A plugin has been added.
  681. * @a pluginId Plugin Id
  682. * @a valueStr Plugin name
  683. */
  684. ENGINE_CALLBACK_PLUGIN_ADDED = 1,
  685. /*!
  686. * A plugin has been removed.
  687. * @a pluginId Plugin Id
  688. */
  689. ENGINE_CALLBACK_PLUGIN_REMOVED = 2,
  690. /*!
  691. * A plugin has been renamed.
  692. * @a pluginId Plugin Id
  693. * @a valueStr New plugin name
  694. */
  695. ENGINE_CALLBACK_PLUGIN_RENAMED = 3,
  696. /*!
  697. * A plugin has become unavailable.
  698. * @a pluginId Plugin Id
  699. * @a valueStr Related error string
  700. */
  701. ENGINE_CALLBACK_PLUGIN_UNAVAILABLE = 4,
  702. /*!
  703. * A parameter value has changed.
  704. * @a pluginId Plugin Id
  705. * @a value1 Parameter index
  706. * @a valuef New parameter value
  707. */
  708. ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED = 5,
  709. /*!
  710. * A parameter default has changed.
  711. * @a pluginId Plugin Id
  712. * @a value1 Parameter index
  713. * @a valuef New default value
  714. */
  715. ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED = 6,
  716. #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
  717. /*!
  718. * A parameter's mapped control index has changed.
  719. * @a pluginId Plugin Id
  720. * @a value1 Parameter index
  721. * @a value2 New control index
  722. */
  723. ENGINE_CALLBACK_PARAMETER_MAPPED_CONTROL_INDEX_CHANGED = 7,
  724. /*!
  725. * A parameter's MIDI channel has changed.
  726. * @a pluginId Plugin Id
  727. * @a value1 Parameter index
  728. * @a value2 New MIDI channel
  729. */
  730. ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED = 8,
  731. /*!
  732. * A plugin option has changed.
  733. * @a pluginId Plugin Id
  734. * @a value1 Option
  735. * @a value2 New on/off state (1 for on, 0 for off)
  736. * @see PluginOptions
  737. */
  738. ENGINE_CALLBACK_OPTION_CHANGED = 9,
  739. #endif
  740. /*!
  741. * The current program of a plugin has changed.
  742. * @a pluginId Plugin Id
  743. * @a value1 New program index
  744. */
  745. ENGINE_CALLBACK_PROGRAM_CHANGED = 10,
  746. /*!
  747. * The current MIDI program of a plugin has changed.
  748. * @a pluginId Plugin Id
  749. * @a value1 New MIDI program index
  750. */
  751. ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED = 11,
  752. /*!
  753. * A plugin's custom UI state has changed.
  754. * @a pluginId Plugin Id
  755. * @a value1 New state, as follows:
  756. * 0: UI is now hidden
  757. * 1: UI is now visible
  758. * -1: UI has crashed and should not be shown again
  759. */
  760. ENGINE_CALLBACK_UI_STATE_CHANGED = 12,
  761. /*!
  762. * A note has been pressed.
  763. * @a pluginId Plugin Id
  764. * @a value1 Channel
  765. * @a value2 Note
  766. * @a value3 Velocity
  767. */
  768. ENGINE_CALLBACK_NOTE_ON = 13,
  769. /*!
  770. * A note has been released.
  771. * @a pluginId Plugin Id
  772. * @a value1 Channel
  773. * @a value2 Note
  774. */
  775. ENGINE_CALLBACK_NOTE_OFF = 14,
  776. /*!
  777. * A plugin needs update.
  778. * @a pluginId Plugin Id
  779. */
  780. ENGINE_CALLBACK_UPDATE = 15,
  781. /*!
  782. * A plugin's data/information has changed.
  783. * @a pluginId Plugin Id
  784. */
  785. ENGINE_CALLBACK_RELOAD_INFO = 16,
  786. /*!
  787. * A plugin's parameters have changed.
  788. * @a pluginId Plugin Id
  789. */
  790. ENGINE_CALLBACK_RELOAD_PARAMETERS = 17,
  791. /*!
  792. * A plugin's programs have changed.
  793. * @a pluginId Plugin Id
  794. */
  795. ENGINE_CALLBACK_RELOAD_PROGRAMS = 18,
  796. /*!
  797. * A plugin state has changed.
  798. * @a pluginId Plugin Id
  799. */
  800. ENGINE_CALLBACK_RELOAD_ALL = 19,
  801. #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
  802. /*!
  803. * A patchbay client has been added.
  804. * @a pluginId Client Id
  805. * @a value1 Client icon
  806. * @a value2 Plugin Id (-1 if not a plugin)
  807. * @a valueStr Client name
  808. * @see PatchbayIcon
  809. */
  810. ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 20,
  811. /*!
  812. * A patchbay client has been removed.
  813. * @a pluginId Client Id
  814. */
  815. ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 21,
  816. /*!
  817. * A patchbay client has been renamed.
  818. * @a pluginId Client Id
  819. * @a valueStr New client name
  820. */
  821. ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 22,
  822. /*!
  823. * A patchbay client data has changed.
  824. * @a pluginId Client Id
  825. * @a value1 New icon
  826. * @a value2 New plugin Id (-1 if not a plugin)
  827. * @see PatchbayIcon
  828. */
  829. ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 23,
  830. /*!
  831. * A patchbay port has been added.
  832. * @a pluginId Client Id
  833. * @a value1 Port Id
  834. * @a value2 Port hints
  835. * @a value3 Port group Id (0 for none)
  836. * @a valueStr Port name
  837. * @see PatchbayPortHints
  838. */
  839. ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 24,
  840. /*!
  841. * A patchbay port has been removed.
  842. * @a pluginId Client Id
  843. * @a value1 Port Id
  844. */
  845. ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 25,
  846. /*!
  847. * A patchbay port has changed (like the name or group Id).
  848. * @a pluginId Client Id
  849. * @a value1 Port Id
  850. * @a value2 Port hints
  851. * @a value3 Port group Id (0 for none)
  852. * @a valueStr Port name
  853. */
  854. ENGINE_CALLBACK_PATCHBAY_PORT_CHANGED = 26,
  855. /*!
  856. * A patchbay connection has been added.
  857. * @a pluginId Connection Id
  858. * @a valueStr Out group and port plus in group and port, in "og:op:ig:ip" syntax.
  859. */
  860. ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 27,
  861. /*!
  862. * A patchbay connection has been removed.
  863. * @a pluginId Connection Id
  864. */
  865. ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 28,
  866. #endif
  867. /*!
  868. * Engine started.
  869. * @a pluginId How many plugins are known to be running
  870. * @a value1 Process mode
  871. * @a value2 Transport mode
  872. * @a value3 Buffer size
  873. * @a valuef Sample rate
  874. * @a valuestr Engine driver
  875. * @see EngineProcessMode
  876. * @see EngineTransportMode
  877. */
  878. ENGINE_CALLBACK_ENGINE_STARTED = 29,
  879. /*!
  880. * Engine stopped.
  881. */
  882. ENGINE_CALLBACK_ENGINE_STOPPED = 30,
  883. /*!
  884. * Engine process mode has changed.
  885. * @a value1 New process mode
  886. * @see EngineProcessMode
  887. */
  888. ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 31,
  889. /*!
  890. * Engine transport mode has changed.
  891. * @a value1 New transport mode
  892. * @a valueStr New transport features enabled
  893. * @see EngineTransportMode
  894. */
  895. ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 32,
  896. /*!
  897. * Engine buffer-size changed.
  898. * @a value1 New buffer size
  899. */
  900. ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 33,
  901. /*!
  902. * Engine sample-rate changed.
  903. * @a valuef New sample rate
  904. */
  905. ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 34,
  906. /*!
  907. * A cancelable action has been started or stopped.
  908. * @a pluginId Plugin Id the action relates to, -1 for none
  909. * @a value1 1 for action started, 0 for stopped
  910. * @a valueStr Action name
  911. */
  912. ENGINE_CALLBACK_CANCELABLE_ACTION = 35,
  913. /*!
  914. * Project has finished loading.
  915. */
  916. ENGINE_CALLBACK_PROJECT_LOAD_FINISHED = 36,
  917. /*!
  918. * NSM callback, to be handled by a frontend.
  919. * Frontend must call carla_nsm_ready() with opcode as parameter as a response
  920. * @a value1 NSM opcode
  921. * @a value2 Integer value
  922. * @a valueStr String value
  923. * @see NsmCallbackOpcode
  924. */
  925. ENGINE_CALLBACK_NSM = 37,
  926. /*!
  927. * Idle frontend.
  928. * This is used by the engine during long operations that might block the frontend,
  929. * giving it the possibility to idle while the operation is still in place.
  930. */
  931. ENGINE_CALLBACK_IDLE = 38,
  932. /*!
  933. * Show a message as information.
  934. * @a valueStr The message
  935. */
  936. ENGINE_CALLBACK_INFO = 39,
  937. /*!
  938. * Show a message as an error.
  939. * @a valueStr The message
  940. */
  941. ENGINE_CALLBACK_ERROR = 40,
  942. /*!
  943. * The engine has crashed or malfunctioned and will no longer work.
  944. */
  945. ENGINE_CALLBACK_QUIT = 41,
  946. /*!
  947. * A plugin requested for its inline display to be redrawn.
  948. * @a pluginId Plugin Id to redraw
  949. */
  950. ENGINE_CALLBACK_INLINE_DISPLAY_REDRAW = 42,
  951. /*!
  952. * A patchbay port group has been added.
  953. * @a pluginId Client Id
  954. * @a value1 Group Id (unique value within this client)
  955. * @a value2 Group hints
  956. * @a valueStr Group name
  957. * @see PatchbayPortGroupHints
  958. */
  959. ENGINE_CALLBACK_PATCHBAY_PORT_GROUP_ADDED = 43,
  960. /*!
  961. * A patchbay port group has been removed.
  962. * @a pluginId Client Id
  963. * @a value1 Group Id
  964. */
  965. ENGINE_CALLBACK_PATCHBAY_PORT_GROUP_REMOVED = 44,
  966. /*!
  967. * A patchbay port group has changed.
  968. * @a pluginId Client Id
  969. * @a value1 Group Id
  970. * @a value2 Group hints
  971. * @a valueStr Group name
  972. * @see PatchbayPortGroupHints
  973. */
  974. ENGINE_CALLBACK_PATCHBAY_PORT_GROUP_CHANGED = 45,
  975. /*!
  976. * A parameter's mapped range has changed.
  977. * @a pluginId Plugin Id
  978. * @a value1 Parameter index
  979. * @a valueStr New mapped range as "%f:%f" syntax
  980. */
  981. ENGINE_CALLBACK_PARAMETER_MAPPED_RANGE_CHANGED = 46,
  982. /*!
  983. * A patchbay client position has changed.
  984. * @a pluginId Client Id
  985. * @a value1 X position 1
  986. * @a value2 Y position 1
  987. * @a value3 X position 2
  988. * @a valuef Y position 2
  989. */
  990. ENGINE_CALLBACK_PATCHBAY_CLIENT_POSITION_CHANGED = 47,
  991. /*!
  992. * A plugin embed UI has been resized.
  993. * @a pluginId Plugin Id to resize
  994. * @a value1 New width
  995. * @a value2 New height
  996. */
  997. ENGINE_CALLBACK_EMBED_UI_RESIZED = 48
  998. } EngineCallbackOpcode;
  999. /* ------------------------------------------------------------------------------------------------------------
  1000. * NSM Callback Opcode */
  1001. /*!
  1002. * NSM callback opcodes.
  1003. * @see ENGINE_CALLBACK_NSM
  1004. */
  1005. typedef enum {
  1006. /*!
  1007. * NSM is available and initialized.
  1008. */
  1009. NSM_CALLBACK_INIT = 0,
  1010. /*!
  1011. * Error from NSM side.
  1012. * @a valueInt Error code
  1013. * @a valueStr Error string
  1014. */
  1015. NSM_CALLBACK_ERROR = 1,
  1016. /*!
  1017. * Announce message.
  1018. * @a valueInt SM Flags (WIP, to be defined)
  1019. * @a valueStr SM Name
  1020. */
  1021. NSM_CALLBACK_ANNOUNCE = 2,
  1022. /*!
  1023. * Open message.
  1024. * @a valueStr Project filename
  1025. */
  1026. NSM_CALLBACK_OPEN = 3,
  1027. /*!
  1028. * Save message.
  1029. */
  1030. NSM_CALLBACK_SAVE = 4,
  1031. /*!
  1032. * Session-is-loaded message.
  1033. */
  1034. NSM_CALLBACK_SESSION_IS_LOADED = 5,
  1035. /*!
  1036. * Show-optional-gui message.
  1037. */
  1038. NSM_CALLBACK_SHOW_OPTIONAL_GUI = 6,
  1039. /*!
  1040. * Hide-optional-gui message.
  1041. */
  1042. NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7,
  1043. /*!
  1044. * Set client name id message.
  1045. */
  1046. NSM_CALLBACK_SET_CLIENT_NAME_ID = 8
  1047. } NsmCallbackOpcode;
  1048. /* ------------------------------------------------------------------------------------------------------------
  1049. * Engine Option */
  1050. /*!
  1051. * Engine options.
  1052. * @see CarlaEngine::getOptions(), CarlaEngine::setOption() and carla_set_engine_option()
  1053. */
  1054. typedef enum {
  1055. /*!
  1056. * Debug.
  1057. * This option is undefined and used only for testing purposes.
  1058. */
  1059. ENGINE_OPTION_DEBUG = 0,
  1060. /*!
  1061. * Set the engine processing mode.
  1062. * Default is ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS on Linux and ENGINE_PROCESS_MODE_PATCHBAY for all other OSes.
  1063. * @see EngineProcessMode
  1064. */
  1065. ENGINE_OPTION_PROCESS_MODE = 1,
  1066. /*!
  1067. * Set the engine transport mode.
  1068. * Default is ENGINE_TRANSPORT_MODE_JACK on Linux and ENGINE_TRANSPORT_MODE_INTERNAL for all other OSes.
  1069. * @see EngineTransportMode
  1070. */
  1071. ENGINE_OPTION_TRANSPORT_MODE = 2,
  1072. /*!
  1073. * Force mono plugins as stereo, by running 2 instances at the same time.
  1074. * Default is false, but always true when process mode is ENGINE_PROCESS_MODE_CONTINUOUS_RACK.
  1075. * @note Not supported by all plugins
  1076. * @see PLUGIN_OPTION_FORCE_STEREO
  1077. */
  1078. ENGINE_OPTION_FORCE_STEREO = 3,
  1079. /*!
  1080. * Use plugin bridges whenever possible.
  1081. * Default is no, EXPERIMENTAL.
  1082. */
  1083. ENGINE_OPTION_PREFER_PLUGIN_BRIDGES = 4,
  1084. /*!
  1085. * Use UI bridges whenever possible, otherwise UIs will be directly handled in the main backend thread.
  1086. * Default is yes.
  1087. */
  1088. ENGINE_OPTION_PREFER_UI_BRIDGES = 5,
  1089. /*!
  1090. * Make custom plugin UIs always-on-top.
  1091. * Default is yes.
  1092. */
  1093. ENGINE_OPTION_UIS_ALWAYS_ON_TOP = 6,
  1094. /*!
  1095. * Maximum number of parameters allowed.
  1096. * Default is MAX_DEFAULT_PARAMETERS.
  1097. */
  1098. ENGINE_OPTION_MAX_PARAMETERS = 7,
  1099. /*!
  1100. * Reset Xrun counter after project load.
  1101. */
  1102. ENGINE_OPTION_RESET_XRUNS = 8,
  1103. /*!
  1104. * Timeout value for how much to wait for UI bridges to respond, in milliseconds.
  1105. * Default is 4000 (4 seconds).
  1106. */
  1107. ENGINE_OPTION_UI_BRIDGES_TIMEOUT = 9,
  1108. /*!
  1109. * Audio buffer size.
  1110. * Default is 512.
  1111. */
  1112. ENGINE_OPTION_AUDIO_BUFFER_SIZE = 10,
  1113. /*!
  1114. * Audio sample rate.
  1115. * Default is 44100.
  1116. */
  1117. ENGINE_OPTION_AUDIO_SAMPLE_RATE = 11,
  1118. /*!
  1119. * Wherever to use 3 audio periods instead of the default 2.
  1120. * Default is false.
  1121. */
  1122. ENGINE_OPTION_AUDIO_TRIPLE_BUFFER = 12,
  1123. /*!
  1124. * Audio driver.
  1125. * Default depends on platform.
  1126. */
  1127. ENGINE_OPTION_AUDIO_DRIVER = 13,
  1128. /*!
  1129. * Audio device (within a driver).
  1130. * Default unset.
  1131. */
  1132. ENGINE_OPTION_AUDIO_DEVICE = 14,
  1133. #ifndef BUILD_BRIDGE
  1134. /*!
  1135. * Wherever to enable OSC support in the engine.
  1136. */
  1137. ENGINE_OPTION_OSC_ENABLED = 15,
  1138. /*!
  1139. * The network TCP port to use for OSC.
  1140. * A value of 0 means use a random port.
  1141. * A value of < 0 means to not enable the TCP port for OSC.
  1142. * @note Valid ports begin at 1024 and end at 32767 (inclusive)
  1143. */
  1144. ENGINE_OPTION_OSC_PORT_TCP = 16,
  1145. /*!
  1146. * The network UDP port to use for OSC.
  1147. * A value of 0 means use a random port.
  1148. * A value of < 0 means to not enable the UDP port for OSC.
  1149. * @note Disabling this option prevents DSSI UIs from working!
  1150. * @note Valid ports begin at 1024 and end at 32767 (inclusive)
  1151. */
  1152. ENGINE_OPTION_OSC_PORT_UDP = 17,
  1153. #endif
  1154. /*!
  1155. * Set path used for a specific file type.
  1156. * Uses value as the file format, valueStr as actual path.
  1157. */
  1158. ENGINE_OPTION_FILE_PATH = 18,
  1159. /*!
  1160. * Set path used for a specific plugin type.
  1161. * Uses value as the plugin format, valueStr as actual path.
  1162. * @see PluginType
  1163. */
  1164. ENGINE_OPTION_PLUGIN_PATH = 19,
  1165. /*!
  1166. * Set path to the binary files.
  1167. * Default unset.
  1168. * @note Must be set for plugin and UI bridges to work
  1169. */
  1170. ENGINE_OPTION_PATH_BINARIES = 20,
  1171. /*!
  1172. * Set path to the resource files.
  1173. * Default unset.
  1174. * @note Must be set for some internal plugins to work
  1175. */
  1176. ENGINE_OPTION_PATH_RESOURCES = 21,
  1177. /*!
  1178. * Prevent bad plugin and UI behaviour.
  1179. * @note: Linux only
  1180. */
  1181. ENGINE_OPTION_PREVENT_BAD_BEHAVIOUR = 22,
  1182. /*!
  1183. * Set background color used in the frontend, so backend can do the same for plugin UIs.
  1184. */
  1185. ENGINE_OPTION_FRONTEND_BACKGROUND_COLOR = 23,
  1186. /*!
  1187. * Set foreground color used in the frontend, so backend can do the same for plugin UIs.
  1188. */
  1189. ENGINE_OPTION_FRONTEND_FOREGROUND_COLOR = 24,
  1190. /*!
  1191. * Set UI scaling used in the frontend, so backend can do the same for plugin UIs.
  1192. */
  1193. ENGINE_OPTION_FRONTEND_UI_SCALE = 25,
  1194. /*!
  1195. * Set frontend winId, used to define as parent window for plugin UIs.
  1196. */
  1197. ENGINE_OPTION_FRONTEND_WIN_ID = 26,
  1198. #if !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH) && !defined(CARLA_OS_WIN)
  1199. /*!
  1200. * Set path to wine executable.
  1201. */
  1202. ENGINE_OPTION_WINE_EXECUTABLE = 27,
  1203. /*!
  1204. * Enable automatic wineprefix detection.
  1205. */
  1206. ENGINE_OPTION_WINE_AUTO_PREFIX = 28,
  1207. /*!
  1208. * Fallback wineprefix to use if automatic detection fails or is disabled, and WINEPREFIX is not set.
  1209. */
  1210. ENGINE_OPTION_WINE_FALLBACK_PREFIX = 29,
  1211. /*!
  1212. * Enable realtime priority for Wine application and server threads.
  1213. */
  1214. ENGINE_OPTION_WINE_RT_PRIO_ENABLED = 30,
  1215. /*!
  1216. * Base realtime priority for Wine threads.
  1217. */
  1218. ENGINE_OPTION_WINE_BASE_RT_PRIO = 31,
  1219. /*!
  1220. * Wine server realtime priority.
  1221. */
  1222. ENGINE_OPTION_WINE_SERVER_RT_PRIO = 32,
  1223. #endif
  1224. #ifndef BUILD_BRIDGE
  1225. /*!
  1226. * Capture console output into debug callbacks.
  1227. */
  1228. ENGINE_OPTION_DEBUG_CONSOLE_OUTPUT = 33,
  1229. #endif
  1230. /*!
  1231. * A prefix to give to all plugin clients created by Carla.
  1232. * Mostly useful for JACK multi-client mode.
  1233. * @note MUST include at least one "." (dot).
  1234. */
  1235. ENGINE_OPTION_CLIENT_NAME_PREFIX = 34,
  1236. /*!
  1237. * Treat loaded plugins as standalone (that is, there is no host UI to manage them)
  1238. */
  1239. ENGINE_OPTION_PLUGINS_ARE_STANDALONE = 35
  1240. } EngineOption;
  1241. /* ------------------------------------------------------------------------------------------------------------
  1242. * Engine Process Mode */
  1243. /*!
  1244. * Engine process mode.
  1245. * @see ENGINE_OPTION_PROCESS_MODE
  1246. */
  1247. typedef enum {
  1248. /*!
  1249. * Single client mode.
  1250. * Inputs and outputs are added dynamically as needed by plugins.
  1251. */
  1252. ENGINE_PROCESS_MODE_SINGLE_CLIENT = 0,
  1253. /*!
  1254. * Multiple client mode.
  1255. * It has 1 master client + 1 client per plugin.
  1256. */
  1257. ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS = 1,
  1258. /*!
  1259. * Single client, 'rack' mode.
  1260. * Processes plugins in order of Id, with forced stereo always on.
  1261. */
  1262. ENGINE_PROCESS_MODE_CONTINUOUS_RACK = 2,
  1263. /*!
  1264. * Single client, 'patchbay' mode.
  1265. */
  1266. ENGINE_PROCESS_MODE_PATCHBAY = 3,
  1267. /*!
  1268. * Special mode, used in plugin-bridges only.
  1269. */
  1270. ENGINE_PROCESS_MODE_BRIDGE = 4
  1271. } EngineProcessMode;
  1272. /* ------------------------------------------------------------------------------------------------------------
  1273. * Engine Transport Mode */
  1274. /*!
  1275. * Engine transport mode.
  1276. * @see ENGINE_OPTION_TRANSPORT_MODE
  1277. */
  1278. typedef enum {
  1279. /*!
  1280. * No transport.
  1281. */
  1282. ENGINE_TRANSPORT_MODE_DISABLED = 0,
  1283. /*!
  1284. * Internal transport mode.
  1285. */
  1286. ENGINE_TRANSPORT_MODE_INTERNAL = 1,
  1287. /*!
  1288. * Transport from JACK.
  1289. * Only available if driver name is "JACK".
  1290. */
  1291. ENGINE_TRANSPORT_MODE_JACK = 2,
  1292. /*!
  1293. * Transport from host, used when Carla is a plugin.
  1294. */
  1295. ENGINE_TRANSPORT_MODE_PLUGIN = 3,
  1296. /*!
  1297. * Special mode, used in plugin-bridges only.
  1298. */
  1299. ENGINE_TRANSPORT_MODE_BRIDGE = 4
  1300. } EngineTransportMode;
  1301. /* ------------------------------------------------------------------------------------------------------------
  1302. * File Callback Opcode */
  1303. /*!
  1304. * File callback opcodes.
  1305. * Front-ends must always block-wait for user input.
  1306. * @see FileCallbackFunc, CarlaEngine::setFileCallback() and carla_set_file_callback()
  1307. */
  1308. typedef enum {
  1309. /*!
  1310. * Debug.
  1311. * This opcode is undefined and used only for testing purposes.
  1312. */
  1313. FILE_CALLBACK_DEBUG = 0,
  1314. /*!
  1315. * Open file or folder.
  1316. */
  1317. FILE_CALLBACK_OPEN = 1,
  1318. /*!
  1319. * Save file or folder.
  1320. */
  1321. FILE_CALLBACK_SAVE = 2
  1322. } FileCallbackOpcode;
  1323. /* ------------------------------------------------------------------------------------------------------------
  1324. * Patchbay Icon */
  1325. /*!
  1326. * The icon of a patchbay client/group.
  1327. */
  1328. enum PatchbayIcon {
  1329. /*!
  1330. * Generic application icon.
  1331. * Used for all non-plugin clients that don't have a specific icon.
  1332. */
  1333. PATCHBAY_ICON_APPLICATION = 0,
  1334. /*!
  1335. * Plugin icon.
  1336. * Used for all plugin clients that don't have a specific icon.
  1337. */
  1338. PATCHBAY_ICON_PLUGIN = 1,
  1339. /*!
  1340. * Hardware icon.
  1341. * Used for hardware (audio or MIDI) clients.
  1342. */
  1343. PATCHBAY_ICON_HARDWARE = 2,
  1344. /*!
  1345. * Carla icon.
  1346. * Used for the main app.
  1347. */
  1348. PATCHBAY_ICON_CARLA = 3,
  1349. /*!
  1350. * DISTRHO icon.
  1351. * Used for DISTRHO based plugins.
  1352. */
  1353. PATCHBAY_ICON_DISTRHO = 4,
  1354. /*!
  1355. * File icon.
  1356. * Used for file type plugins (like SF2 snd SFZ).
  1357. */
  1358. PATCHBAY_ICON_FILE = 5
  1359. };
  1360. /* ------------------------------------------------------------------------------------------------------------
  1361. * Carla Backend API (C stuff) */
  1362. /*!
  1363. * Engine callback function.
  1364. * Front-ends must never block indefinitely during a callback.
  1365. * @see EngineCallbackOpcode, CarlaEngine::setCallback() and carla_set_engine_callback()
  1366. */
  1367. typedef void (*EngineCallbackFunc)(void* ptr, EngineCallbackOpcode action, uint pluginId,
  1368. int value1, int value2, int value3,
  1369. float valuef, const char* valueStr);
  1370. /*!
  1371. * File callback function.
  1372. * @see FileCallbackOpcode
  1373. */
  1374. typedef const char* (*FileCallbackFunc)(void* ptr, FileCallbackOpcode action, bool isDir, const char* title, const char* filter);
  1375. /*!
  1376. * Parameter data.
  1377. */
  1378. typedef struct {
  1379. /*!
  1380. * This parameter type.
  1381. */
  1382. ParameterType type;
  1383. /*!
  1384. * This parameter hints.
  1385. * @see ParameterHints
  1386. */
  1387. uint hints;
  1388. /*!
  1389. * Index as seen by Carla.
  1390. */
  1391. int32_t index;
  1392. /*!
  1393. * Real index as seen by plugins.
  1394. */
  1395. int32_t rindex;
  1396. /*!
  1397. * Currently mapped MIDI channel.
  1398. * Counts from 0 to 15.
  1399. */
  1400. uint8_t midiChannel;
  1401. /*!
  1402. * Currently mapped index.
  1403. * @see SpecialMappedControlIndex
  1404. */
  1405. int16_t mappedControlIndex;
  1406. /*!
  1407. * Minimum value that this parameter maps to.
  1408. */
  1409. float mappedMinimum;
  1410. /*!
  1411. * Maximum value that this parameter maps to.
  1412. */
  1413. float mappedMaximum;
  1414. /*!
  1415. * Flags related to the current mapping of this parameter.
  1416. * @see MappedParameterFlags
  1417. */
  1418. uint mappedFlags;
  1419. } ParameterData;
  1420. /*!
  1421. * Parameter ranges.
  1422. */
  1423. typedef struct _ParameterRanges {
  1424. /*!
  1425. * Default value.
  1426. */
  1427. float def;
  1428. /*!
  1429. * Minimum value.
  1430. */
  1431. float min;
  1432. /*!
  1433. * Maximum value.
  1434. */
  1435. float max;
  1436. /*!
  1437. * Regular, single step value.
  1438. */
  1439. float step;
  1440. /*!
  1441. * Small step value.
  1442. */
  1443. float stepSmall;
  1444. /*!
  1445. * Large step value.
  1446. */
  1447. float stepLarge;
  1448. #ifdef __cplusplus
  1449. /*!
  1450. * Fix the default value within range.
  1451. */
  1452. void fixDefault() noexcept
  1453. {
  1454. fixValue(def);
  1455. }
  1456. /*!
  1457. * Fix a value within range.
  1458. */
  1459. void fixValue(float& value) const noexcept
  1460. {
  1461. if (value < min)
  1462. value = min;
  1463. else if (value > max)
  1464. value = max;
  1465. }
  1466. /*!
  1467. * Get a fixed value within range.
  1468. */
  1469. const float& getFixedValue(const float& value) const noexcept
  1470. {
  1471. if (value <= min)
  1472. return min;
  1473. if (value >= max)
  1474. return max;
  1475. return value;
  1476. }
  1477. /*!
  1478. * Get a value normalized to 0.0<->1.0.
  1479. */
  1480. float getNormalizedValue(const float& value) const noexcept
  1481. {
  1482. const float normValue((value - min) / (max - min));
  1483. if (normValue <= 0.0f)
  1484. return 0.0f;
  1485. if (normValue >= 1.0f)
  1486. return 1.0f;
  1487. return normValue;
  1488. }
  1489. /*!
  1490. * Get a value normalized to 0.0<->1.0, fixed within range.
  1491. */
  1492. float getFixedAndNormalizedValue(const float& value) const noexcept
  1493. {
  1494. if (value <= min)
  1495. return 0.0f;
  1496. if (value >= max)
  1497. return 1.0f;
  1498. const float normValue((value - min) / (max - min));
  1499. if (normValue <= 0.0f)
  1500. return 0.0f;
  1501. if (normValue >= 1.0f)
  1502. return 1.0f;
  1503. return normValue;
  1504. }
  1505. /*!
  1506. * Get a proper value previously normalized to 0.0<->1.0.
  1507. */
  1508. float getUnnormalizedValue(const float& value) const noexcept
  1509. {
  1510. if (value <= 0.0f)
  1511. return min;
  1512. if (value >= 1.0f)
  1513. return max;
  1514. return value * (max - min) + min;
  1515. }
  1516. /*!
  1517. * Get a logarithmic value previously normalized to 0.0<->1.0.
  1518. */
  1519. float getUnnormalizedLogValue(const float& value) const noexcept
  1520. {
  1521. if (value <= 0.0f)
  1522. return min;
  1523. if (value >= 1.0f)
  1524. return max;
  1525. float rmin = min;
  1526. if (std::abs(min) < std::numeric_limits<float>::epsilon())
  1527. rmin = 0.00001f;
  1528. return rmin * std::pow(max/rmin, value);
  1529. }
  1530. #endif /* __cplusplus */
  1531. } ParameterRanges;
  1532. /*!
  1533. * MIDI Program data.
  1534. */
  1535. typedef struct {
  1536. /*!
  1537. * MIDI bank.
  1538. */
  1539. uint32_t bank;
  1540. /*!
  1541. * MIDI program.
  1542. */
  1543. uint32_t program;
  1544. /*!
  1545. * MIDI program name.
  1546. */
  1547. const char* name;
  1548. } MidiProgramData;
  1549. /*!
  1550. * Custom data, used for saving key:value 'dictionaries'.
  1551. */
  1552. typedef struct _CustomData {
  1553. /*!
  1554. * Value type, in URI form.
  1555. * @see CustomDataTypes
  1556. */
  1557. const char* type;
  1558. /*!
  1559. * Key.
  1560. * @see CustomDataKeys
  1561. */
  1562. const char* key;
  1563. /*!
  1564. * Value.
  1565. */
  1566. const char* value;
  1567. #ifdef __cplusplus
  1568. /*!
  1569. * Check if valid.
  1570. */
  1571. bool isValid() const noexcept
  1572. {
  1573. if (type == nullptr || type[0] == '\0') return false;
  1574. if (key == nullptr || key [0] == '\0') return false;
  1575. if (value == nullptr) return false;
  1576. return true;
  1577. }
  1578. #endif /* __cplusplus */
  1579. } CustomData;
  1580. /*!
  1581. * Engine driver device information.
  1582. */
  1583. typedef struct {
  1584. /*!
  1585. * This driver device hints.
  1586. * @see EngineDriverHints
  1587. */
  1588. uint hints;
  1589. /*!
  1590. * Available buffer sizes.
  1591. * Terminated with 0.
  1592. */
  1593. const uint32_t* bufferSizes;
  1594. /*!
  1595. * Available sample rates.
  1596. * Terminated with 0.0.
  1597. */
  1598. const double* sampleRates;
  1599. } EngineDriverDeviceInfo;
  1600. /** @} */
  1601. #ifdef __cplusplus
  1602. /* Forward declarations of commonly used Carla classes */
  1603. class CarlaEngine;
  1604. class CarlaEngineClient;
  1605. class CarlaEngineCVSourcePorts;
  1606. class CarlaPlugin;
  1607. /* End namespace */
  1608. CARLA_BACKEND_END_NAMESPACE
  1609. #endif
  1610. #endif /* CARLA_BACKEND_H_INCLUDED */