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.

1941 lines
61KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code
  4. # Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the doc/GPL.txt file.
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Global)
  19. from ctypes import *
  20. from platform import architecture
  21. from sys import platform, maxsize
  22. # ------------------------------------------------------------------------------------------------------------
  23. # 64bit check
  24. kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32)
  25. # ------------------------------------------------------------------------------------------------------------
  26. # Define enum type (integer)
  27. c_enum = c_int
  28. # ------------------------------------------------------------------------------------------------------------
  29. # Set Platform
  30. if platform == "darwin":
  31. HAIKU = False
  32. LINUX = False
  33. MACOS = True
  34. WINDOWS = False
  35. elif "haiku" in platform:
  36. HAIKU = True
  37. LINUX = False
  38. MACOS = False
  39. WINDOWS = False
  40. elif "linux" in platform:
  41. HAIKU = False
  42. LINUX = True
  43. MACOS = False
  44. WINDOWS = False
  45. elif platform in ("win32", "win64", "cygwin"):
  46. HAIKU = False
  47. LINUX = False
  48. MACOS = False
  49. WINDOWS = True
  50. else:
  51. HAIKU = False
  52. LINUX = False
  53. MACOS = False
  54. WINDOWS = False
  55. # ------------------------------------------------------------------------------------------------------------
  56. # Convert a ctypes c_char_p into a python string
  57. def charPtrToString(value):
  58. if not value:
  59. return ""
  60. if isinstance(value, str):
  61. return value
  62. return value.decode("utf-8", errors="ignore")
  63. # ------------------------------------------------------------------------------------------------------------
  64. # Convert a ctypes POINTER(c_char_p) into a python string list
  65. def charPtrPtrToStringList(charPtrPtr):
  66. if not charPtrPtr:
  67. return []
  68. i = 0
  69. charPtr = charPtrPtr[0]
  70. strList = []
  71. while charPtr:
  72. strList.append(charPtr.decode("utf-8", errors="ignore"))
  73. i += 1
  74. charPtr = charPtrPtr[i]
  75. return strList
  76. # ------------------------------------------------------------------------------------------------------------
  77. # Convert a ctypes POINTER(c_<num>) into a python number list
  78. def numPtrToList(numPtr):
  79. if not numPtr:
  80. return []
  81. i = 0
  82. num = numPtr[0] #.value
  83. numList = []
  84. while num not in (0, 0.0):
  85. numList.append(num)
  86. i += 1
  87. num = numPtr[i] #.value
  88. return numList
  89. # ------------------------------------------------------------------------------------------------------------
  90. # Convert a ctypes struct into a python dict
  91. def structToDict(struct):
  92. return dict((attr, getattr(struct, attr)) for attr, value in struct._fields_)
  93. # ------------------------------------------------------------------------------------------------------------
  94. # Carla Backend API (base definitions)
  95. # Maximum default number of loadable plugins.
  96. MAX_DEFAULT_PLUGINS = 99
  97. # Maximum number of loadable plugins in rack mode.
  98. MAX_RACK_PLUGINS = 16
  99. # Maximum number of loadable plugins in patchbay mode.
  100. MAX_PATCHBAY_PLUGINS = 255
  101. # Maximum default number of parameters allowed.
  102. # @see ENGINE_OPTION_MAX_PARAMETERS
  103. MAX_DEFAULT_PARAMETERS = 200
  104. # ------------------------------------------------------------------------------------------------------------
  105. # Engine Driver Device Hints
  106. # Various engine driver device hints.
  107. # @see carla_get_engine_driver_device_info()
  108. # Engine driver device has custom control-panel.
  109. ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1
  110. # Engine driver device can change buffer-size on the fly.
  111. # @see ENGINE_OPTION_AUDIO_BUFFER_SIZE
  112. ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x2
  113. # Engine driver device can change sample-rate on the fly.
  114. # @see ENGINE_OPTION_AUDIO_SAMPLE_RATE
  115. ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4
  116. # ------------------------------------------------------------------------------------------------------------
  117. # Plugin Hints
  118. # Various plugin hints.
  119. # @see carla_get_plugin_info()
  120. # Plugin is a bridge.
  121. # This hint is required because "bridge" itself is not a plugin type.
  122. PLUGIN_IS_BRIDGE = 0x001
  123. # Plugin is hard real-time safe.
  124. PLUGIN_IS_RTSAFE = 0x002
  125. # Plugin is a synth (produces sound).
  126. PLUGIN_IS_SYNTH = 0x004
  127. # Plugin has its own custom UI.
  128. # @see carla_show_custom_ui()
  129. PLUGIN_HAS_CUSTOM_UI = 0x008
  130. # Plugin can use internal Dry/Wet control.
  131. PLUGIN_CAN_DRYWET = 0x010
  132. # Plugin can use internal Volume control.
  133. PLUGIN_CAN_VOLUME = 0x020
  134. # Plugin can use internal (Stereo) Balance controls.
  135. PLUGIN_CAN_BALANCE = 0x040
  136. # Plugin can use internal (Mono) Panning control.
  137. PLUGIN_CAN_PANNING = 0x080
  138. # Plugin needs a constant, fixed-size audio buffer.
  139. PLUGIN_NEEDS_FIXED_BUFFERS = 0x100
  140. # Plugin needs all UI events in a single/main thread.
  141. PLUGIN_NEEDS_SINGLE_THREAD = 0x200
  142. # ------------------------------------------------------------------------------------------------------------
  143. # Plugin Options
  144. # Various plugin options.
  145. # @see carla_get_plugin_info() and carla_set_option()
  146. # Use constant/fixed-size audio buffers.
  147. PLUGIN_OPTION_FIXED_BUFFERS = 0x001
  148. # Force mono plugin as stereo.
  149. PLUGIN_OPTION_FORCE_STEREO = 0x002
  150. # Map MIDI programs to plugin programs.
  151. PLUGIN_OPTION_MAP_PROGRAM_CHANGES = 0x004
  152. # Use chunks to save and restore data.
  153. PLUGIN_OPTION_USE_CHUNKS = 0x008
  154. # Send MIDI control change events.
  155. PLUGIN_OPTION_SEND_CONTROL_CHANGES = 0x010
  156. # Send MIDI channel pressure events.
  157. PLUGIN_OPTION_SEND_CHANNEL_PRESSURE = 0x020
  158. # Send MIDI note after-touch events.
  159. PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040
  160. # Send MIDI pitch-bend events.
  161. PLUGIN_OPTION_SEND_PITCHBEND = 0x080
  162. # Send MIDI all-sounds/notes-off events, single note-offs otherwise.
  163. PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100
  164. # ------------------------------------------------------------------------------------------------------------
  165. # Parameter Hints
  166. # Various parameter hints.
  167. # @see CarlaPlugin::getParameterData() and carla_get_parameter_data()
  168. # Parameter value is boolean.
  169. PARAMETER_IS_BOOLEAN = 0x001
  170. # Parameter value is integer.
  171. PARAMETER_IS_INTEGER = 0x002
  172. # Parameter value is logarithmic.
  173. PARAMETER_IS_LOGARITHMIC = 0x004
  174. # Parameter is enabled.
  175. # It can be viewed, changed and stored.
  176. PARAMETER_IS_ENABLED = 0x010
  177. # Parameter is automable (real-time safe).
  178. PARAMETER_IS_AUTOMABLE = 0x020
  179. # Parameter is read-only.
  180. # It cannot be changed.
  181. PARAMETER_IS_READ_ONLY = 0x040
  182. # Parameter needs sample rate to work.
  183. # Value and ranges are multiplied by sample rate on usage and divided by sample rate on save.
  184. PARAMETER_USES_SAMPLERATE = 0x100
  185. # Parameter uses scale points to define internal values in a meaningful way.
  186. PARAMETER_USES_SCALEPOINTS = 0x200
  187. # Parameter uses custom text for displaying its value.
  188. # @see carla_get_parameter_text()
  189. PARAMETER_USES_CUSTOM_TEXT = 0x400
  190. # ------------------------------------------------------------------------------------------------------------
  191. # Patchbay Port Hints
  192. # Various patchbay port hints.
  193. # Patchbay port is input.
  194. # When this hint is not set, port is assumed to be output.
  195. PATCHBAY_PORT_IS_INPUT = 0x1
  196. # Patchbay port is of Audio type.
  197. PATCHBAY_PORT_TYPE_AUDIO = 0x2
  198. # Patchbay port is of CV type (Control Voltage).
  199. PATCHBAY_PORT_TYPE_CV = 0x4
  200. # Patchbay port is of MIDI type.
  201. PATCHBAY_PORT_TYPE_MIDI = 0x8
  202. # ------------------------------------------------------------------------------------------------------------
  203. # Custom Data Types
  204. # These types define how the value in the CustomData struct is stored.
  205. # @see CustomData.type
  206. # Boolean string type URI.
  207. # Only "true" and "false" are valid values.
  208. CUSTOM_DATA_TYPE_BOOLEAN = "http://kxstudio.sf.net/ns/carla/boolean"
  209. # Chunk type URI.
  210. CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"
  211. # String type URI.
  212. CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"
  213. # ------------------------------------------------------------------------------------------------------------
  214. # Custom Data Keys
  215. # Pre-defined keys used internally in Carla.
  216. # @see CustomData.key
  217. # Plugin options key.
  218. CUSTOM_DATA_KEY_PLUGIN_OPTIONS = "CarlaPluginOptions"
  219. # UI position key.
  220. CUSTOM_DATA_KEY_UI_POSITION = "CarlaUiPosition"
  221. # UI size key.
  222. CUSTOM_DATA_KEY_UI_SIZE = "CarlaUiSize"
  223. # UI visible key.
  224. CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUiVisible"
  225. # ------------------------------------------------------------------------------------------------------------
  226. # Binary Type
  227. # The binary type of a plugin.
  228. # Null binary type.
  229. BINARY_NONE = 0
  230. # POSIX 32bit binary.
  231. BINARY_POSIX32 = 1
  232. # POSIX 64bit binary.
  233. BINARY_POSIX64 = 2
  234. # Windows 32bit binary.
  235. BINARY_WIN32 = 3
  236. # Windows 64bit binary.
  237. BINARY_WIN64 = 4
  238. # Other binary type.
  239. BINARY_OTHER = 5
  240. # ------------------------------------------------------------------------------------------------------------
  241. # Plugin Type
  242. # Plugin type.
  243. # Some files are handled as if they were plugins.
  244. # Null plugin type.
  245. PLUGIN_NONE = 0
  246. # Internal plugin.
  247. PLUGIN_INTERNAL = 1
  248. # LADSPA plugin.
  249. PLUGIN_LADSPA = 2
  250. # DSSI plugin.
  251. PLUGIN_DSSI = 3
  252. # LV2 plugin.
  253. PLUGIN_LV2 = 4
  254. # VST plugin.
  255. PLUGIN_VST = 5
  256. # AU plugin.
  257. # @note MacOS only
  258. PLUGIN_AU = 6
  259. # Single CSD file (Csound).
  260. PLUGIN_FILE_CSD = 7
  261. # Single GIG file.
  262. PLUGIN_FILE_GIG = 8
  263. # Single SF2 file (SoundFont).
  264. PLUGIN_FILE_SF2 = 9
  265. # Single SFZ file.
  266. PLUGIN_FILE_SFZ = 10
  267. # ------------------------------------------------------------------------------------------------------------
  268. # Plugin Category
  269. # Plugin category, which describes the functionality of a plugin.
  270. # Null plugin category.
  271. PLUGIN_CATEGORY_NONE = 0
  272. # A synthesizer or generator.
  273. PLUGIN_CATEGORY_SYNTH = 1
  274. # A delay or reverb.
  275. PLUGIN_CATEGORY_DELAY = 2
  276. # An equalizer.
  277. PLUGIN_CATEGORY_EQ = 3
  278. # A filter.
  279. PLUGIN_CATEGORY_FILTER = 4
  280. # A distortion plugin.
  281. PLUGIN_CATEGORY_DISTORTION = 5
  282. # A 'dynamic' plugin (amplifier, compressor, gate, etc).
  283. PLUGIN_CATEGORY_DYNAMICS = 6
  284. # A 'modulator' plugin (chorus, flanger, phaser, etc).
  285. PLUGIN_CATEGORY_MODULATOR = 7
  286. # An 'utility' plugin (analyzer, converter, mixer, etc).
  287. PLUGIN_CATEGORY_UTILITY = 8
  288. # Miscellaneous plugin (used to check if the plugin has a category).
  289. PLUGIN_CATEGORY_OTHER = 9
  290. # ------------------------------------------------------------------------------------------------------------
  291. # Parameter Type
  292. # Plugin parameter type.
  293. # Null parameter type.
  294. PARAMETER_UNKNOWN = 0
  295. # Input parameter.
  296. PARAMETER_INPUT = 1
  297. # Ouput parameter.
  298. PARAMETER_OUTPUT = 2
  299. # Special (hidden) parameter.
  300. PARAMETER_SPECIAL = 3
  301. # ------------------------------------------------------------------------------------------------------------
  302. # Internal Parameter Index
  303. # Special parameters used internally in Carla.
  304. # Plugins do not know about their existence.
  305. # Null parameter.
  306. PARAMETER_NULL = -1
  307. # Active parameter, boolean type.
  308. # Default is 'false'.
  309. PARAMETER_ACTIVE = -2
  310. # Dry/Wet parameter.
  311. # Range 0.0...1.0; default is 1.0.
  312. PARAMETER_DRYWET = -3
  313. # Volume parameter.
  314. # Range 0.0...1.27; default is 1.0.
  315. PARAMETER_VOLUME = -4
  316. # Stereo Balance-Left parameter.
  317. # Range -1.0...1.0; default is -1.0.
  318. PARAMETER_BALANCE_LEFT = -5
  319. # Stereo Balance-Right parameter.
  320. # Range -1.0...1.0; default is 1.0.
  321. PARAMETER_BALANCE_RIGHT = -6
  322. # Mono Panning parameter.
  323. # Range -1.0...1.0; default is 0.0.
  324. PARAMETER_PANNING = -7
  325. # MIDI Control channel, integer type.
  326. # Range -1...15 (-1 = off).
  327. PARAMETER_CTRL_CHANNEL = -8
  328. # Max value, defined only for convenience.
  329. PARAMETER_MAX = -9
  330. # ------------------------------------------------------------------------------------------------------------
  331. # Engine Callback Opcode
  332. # Engine callback opcodes.
  333. # Front-ends must never block indefinitely during a callback.
  334. # @see EngineCallbackFunc and carla_set_engine_callback()
  335. # Debug.
  336. # This opcode is undefined and used only for testing purposes.
  337. ENGINE_CALLBACK_DEBUG = 0
  338. # A plugin has been added.
  339. # @param pluginId Plugin Id
  340. # @param valueStr Plugin name
  341. ENGINE_CALLBACK_PLUGIN_ADDED = 1
  342. # A plugin has been removed.
  343. # @param pluginId Plugin Id
  344. ENGINE_CALLBACK_PLUGIN_REMOVED = 2
  345. # A plugin has been renamed.
  346. # @param pluginId Plugin Id
  347. # @param valueStr New plugin name
  348. ENGINE_CALLBACK_PLUGIN_RENAMED = 3
  349. # A plugin has become unavailable.
  350. # @param pluginId Plugin Id
  351. # @param valueStr Related error string
  352. ENGINE_CALLBACK_PLUGIN_UNAVAILABLE = 4
  353. # A parameter value has changed.
  354. # @param pluginId Plugin Id
  355. # @param value1 Parameter index
  356. # @param value3 New parameter value
  357. ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED = 5
  358. # A parameter default has changed.
  359. # @param pluginId Plugin Id
  360. # @param value1 Parameter index
  361. # @param value3 New default value
  362. ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED = 6
  363. # A parameter's MIDI CC has changed.
  364. # @param pluginId Plugin Id
  365. # @param value1 Parameter index
  366. # @param value2 New MIDI CC
  367. ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED = 7
  368. # A parameter's MIDI channel has changed.
  369. # @param pluginId Plugin Id
  370. # @param value1 Parameter index
  371. # @param value2 New MIDI channel
  372. ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED = 8
  373. # The current program of a plugin has changed.
  374. # @param pluginId Plugin Id
  375. # @param value1 New program index
  376. ENGINE_CALLBACK_PROGRAM_CHANGED = 9
  377. # The current MIDI program of a plugin has changed.
  378. # @param pluginId Plugin Id
  379. # @param value1 New MIDI program index
  380. ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED = 10
  381. # A plugin's custom UI state has changed.
  382. # @param pluginId Plugin Id
  383. # @param value1 New state, as follows:
  384. # 0: UI is now hidden
  385. # 1: UI is now visible
  386. # -1: UI has crashed and should not be shown again
  387. ENGINE_CALLBACK_UI_STATE_CHANGED = 11
  388. # A note has been pressed.
  389. # @param pluginId Plugin Id
  390. # @param value1 Channel
  391. # @param value2 Note
  392. # @param value3 Velocity
  393. ENGINE_CALLBACK_NOTE_ON = 12
  394. # A note has been released.
  395. # @param pluginId Plugin Id
  396. # @param value1 Channel
  397. # @param value2 Note
  398. ENGINE_CALLBACK_NOTE_OFF = 13
  399. # A plugin needs update.
  400. # @param pluginId Plugin Id
  401. ENGINE_CALLBACK_UPDATE = 14
  402. # A plugin's data/information has changed.
  403. # @param pluginId Plugin Id
  404. ENGINE_CALLBACK_RELOAD_INFO = 15
  405. # A plugin's parameters have changed.
  406. # @param pluginId Plugin Id
  407. ENGINE_CALLBACK_RELOAD_PARAMETERS = 16
  408. # A plugin's programs have changed.
  409. # @param pluginId Plugin Id
  410. ENGINE_CALLBACK_RELOAD_PROGRAMS = 17
  411. # A plugin state has changed.
  412. # @param pluginId Plugin Id
  413. ENGINE_CALLBACK_RELOAD_ALL = 18
  414. # A patchbay client has been added.
  415. # @param pluginId Client Id
  416. # @param value1 Client icon
  417. # @param value2 Plugin Id (-1 if not a plugin)
  418. # @param valueStr Client name
  419. # @see PatchbayIcon
  420. ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 19
  421. # A patchbay client has been removed.
  422. # @param pluginId Client Id
  423. ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 20
  424. # A patchbay client has been renamed.
  425. # @param pluginId Client Id
  426. # @param valueStr New client name
  427. ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 21
  428. # A patchbay client data has changed.
  429. # @param pluginId Client Id
  430. # @param value1 New icon
  431. # @param value2 New plugin Id (-1 if not a plugin)
  432. # @see PatchbayIcon
  433. ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 22
  434. # A patchbay port has been added.
  435. # @param pluginId Client Id
  436. # @param value1 Port Id
  437. # @param value2 Port hints
  438. # @param valueStr Port name
  439. # @see PatchbayPortHints
  440. ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 23
  441. # A patchbay port has been removed.
  442. # @param pluginId Client Id
  443. # @param value1 Port Id
  444. ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 24
  445. # A patchbay port has been renamed.
  446. # @param pluginId Client Id
  447. # @param value1 Port Id
  448. # @param valueStr New port name
  449. ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 25
  450. # A patchbay connection has been added.
  451. # @param pluginId Connection Id
  452. # @param value1 Output port Id
  453. # @param value2 Input port Id
  454. ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 26
  455. # A patchbay connection has been removed.
  456. # @param pluginId Connection Id
  457. # @param value1 Output port Id
  458. # @param value2 Input port Id
  459. ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 27
  460. # Engine started.
  461. # @param value1 Process mode
  462. # @param value2 Transport mode
  463. # @param valuestr Engine driver
  464. # @see EngineProcessMode
  465. # @see EngineTransportMode
  466. ENGINE_CALLBACK_ENGINE_STARTED = 28
  467. # Engine stopped.
  468. ENGINE_CALLBACK_ENGINE_STOPPED = 29
  469. # Engine process mode has changed.
  470. # @param value1 New process mode
  471. # @see EngineProcessMode
  472. ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 30
  473. # Engine transport mode has changed.
  474. # @param value1 New transport mode
  475. # @see EngineTransportMode
  476. ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 31
  477. # Engine buffer-size changed.
  478. # @param value1 New buffer size
  479. ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 32
  480. # Engine sample-rate changed.
  481. # @param value3 New sample rate
  482. ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 33
  483. # Show a message as information.
  484. # @param valueStr The message
  485. ENGINE_CALLBACK_INFO = 34
  486. # Show a message as an error.
  487. # @param valueStr The message
  488. ENGINE_CALLBACK_ERROR = 35
  489. # The engine has crashed or malfunctioned and will no longer work.
  490. ENGINE_CALLBACK_QUIT = 36
  491. # ------------------------------------------------------------------------------------------------------------
  492. # Engine Option
  493. # Engine options.
  494. # @see carla_set_engine_option()
  495. # Debug.
  496. # This option is undefined and used only for testing purposes.
  497. ENGINE_OPTION_DEBUG = 0
  498. # Set the engine processing mode.
  499. # Default is ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS on Linux and ENGINE_PROCESS_MODE_CONTINUOUS_RACK for all other OSes.
  500. # @see EngineProcessMode
  501. ENGINE_OPTION_PROCESS_MODE = 1
  502. # Set the engine transport mode.
  503. # Default is ENGINE_TRANSPORT_MODE_JACK on Linux and ENGINE_TRANSPORT_MODE_INTERNAL for all other OSes.
  504. # @see EngineTransportMode
  505. ENGINE_OPTION_TRANSPORT_MODE = 2
  506. # Force mono plugins as stereo, by running 2 instances at the same time.
  507. # Default is false, but always true when process mode is ENGINE_PROCESS_MODE_CONTINUOUS_RACK.
  508. # @note Not supported by all plugins
  509. # @see PLUGIN_OPTION_FORCE_STEREO
  510. ENGINE_OPTION_FORCE_STEREO = 3
  511. # Use plugin bridges whenever possible.
  512. # Default is no, EXPERIMENTAL.
  513. ENGINE_OPTION_PREFER_PLUGIN_BRIDGES = 4
  514. # Use UI bridges whenever possible, otherwise UIs will be directly handled in the main backend thread.
  515. # Default is yes.
  516. ENGINE_OPTION_PREFER_UI_BRIDGES = 5
  517. # Make custom plugin UIs always-on-top.
  518. # Default is yes.
  519. ENGINE_OPTION_UIS_ALWAYS_ON_TOP = 6
  520. # Maximum number of parameters allowed.
  521. # Default is MAX_DEFAULT_PARAMETERS.
  522. ENGINE_OPTION_MAX_PARAMETERS = 7
  523. # Timeout value for how much to wait for UI bridges to respond, in milliseconds.
  524. # Default is 4000 (4 seconds).
  525. ENGINE_OPTION_UI_BRIDGES_TIMEOUT = 8
  526. # Audio number of periods.
  527. # Default is 2.
  528. ENGINE_OPTION_AUDIO_NUM_PERIODS = 9
  529. # Audio buffer size.
  530. # Default is 512.
  531. ENGINE_OPTION_AUDIO_BUFFER_SIZE = 10
  532. # Audio sample rate.
  533. # Default is 44100.
  534. ENGINE_OPTION_AUDIO_SAMPLE_RATE = 11
  535. # Audio device (within a driver).
  536. # Default unset.
  537. ENGINE_OPTION_AUDIO_DEVICE = 12
  538. # Set path to the binary files.
  539. # Default unset.
  540. # @note Must be set for plugin and UI bridges to work
  541. ENGINE_OPTION_PATH_BINARIES = 13
  542. # Set path to the resource files.
  543. # Default unset.
  544. # @note Must be set for some internal plugins to work
  545. ENGINE_OPTION_PATH_RESOURCES = 14
  546. # ------------------------------------------------------------------------------------------------------------
  547. # Engine Process Mode
  548. # Engine process mode.
  549. # @see ENGINE_OPTION_PROCESS_MODE
  550. # Single client mode.
  551. # Inputs and outputs are added dynamically as needed by plugins.
  552. ENGINE_PROCESS_MODE_SINGLE_CLIENT = 0
  553. # Multiple client mode.
  554. # It has 1 master client + 1 client per plugin.
  555. ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS = 1
  556. # Single client, 'rack' mode.
  557. # Processes plugins in order of Id, with forced stereo always on.
  558. ENGINE_PROCESS_MODE_CONTINUOUS_RACK = 2
  559. # Single client, 'patchbay' mode.
  560. ENGINE_PROCESS_MODE_PATCHBAY = 3
  561. # Special mode, used in plugin-bridges only.
  562. ENGINE_PROCESS_MODE_BRIDGE = 4
  563. # ------------------------------------------------------------------------------------------------------------
  564. # Engine Transport Mode
  565. # Engine transport mode.
  566. # @see ENGINE_OPTION_TRANSPORT_MODE
  567. # Internal transport mode.
  568. ENGINE_TRANSPORT_MODE_INTERNAL = 0
  569. # Transport from JACK.
  570. # Only available if driver name is "JACK".
  571. ENGINE_TRANSPORT_MODE_JACK = 1
  572. # Transport from host, used when Carla is a plugin.
  573. ENGINE_TRANSPORT_MODE_PLUGIN = 2
  574. # Special mode, used in plugin-bridges only.
  575. ENGINE_TRANSPORT_MODE_BRIDGE = 3
  576. # ------------------------------------------------------------------------------------------------------------
  577. # Patchbay Icon
  578. # The icon of a patchbay client/group.
  579. # Generic application icon.
  580. # Used for all non-plugin clients that don't have a specific icon.
  581. PATCHBAY_ICON_APPLICATION = 0
  582. # Plugin icon.
  583. # Used for all plugin clients that don't have a specific icon.
  584. PATCHBAY_ICON_PLUGIN = 1
  585. # Hardware icon.
  586. # Used for hardware (audio or MIDI) clients.
  587. PATCHBAY_ICON_HARDWARE = 2
  588. # Carla icon.
  589. # Used for the main app.
  590. PATCHBAY_ICON_CARLA = 3
  591. # DISTRHO icon.
  592. # Used for DISTRHO based plugins.
  593. PATCHBAY_ICON_DISTRHO = 4
  594. # File icon.
  595. # Used for file type plugins (like GIG and SF2).
  596. PATCHBAY_ICON_FILE = 5
  597. # ------------------------------------------------------------------------------------------------------------
  598. # Carla Backend API (C stuff)
  599. # Engine callback function.
  600. # Front-ends must never block indefinitely during a callback.
  601. # @see EngineCallbackOpcode and carla_set_engine_callback()
  602. EngineCallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_uint, c_int, c_int, c_float, c_char_p)
  603. # Parameter data.
  604. class ParameterData(Structure):
  605. _fields_ = [
  606. # This parameter type.
  607. ("type", c_enum),
  608. # This parameter hints.
  609. # @see ParameterHints
  610. ("hints", c_uint),
  611. # Index as seen by Carla.
  612. ("index", c_int32),
  613. # Real index as seen by plugins.
  614. ("rindex", c_int32),
  615. # Currently mapped MIDI CC.
  616. # A value lower than 0 means invalid or unused.
  617. # Maximum allowed value is 95 (0x5F).
  618. ("midiCC", c_int16),
  619. # Currently mapped MIDI channel.
  620. # Counts from 0 to 15.
  621. ("midiChannel", c_uint8)
  622. ]
  623. # Parameter ranges.
  624. class ParameterRanges(Structure):
  625. _fields_ = [
  626. # Default value.
  627. ("def", c_float),
  628. # Minimum value.
  629. ("min", c_float),
  630. # Maximum value.
  631. ("max", c_float),
  632. # Regular, single step value.
  633. ("step", c_float),
  634. # Small step value.
  635. ("stepSmall", c_float),
  636. # Large step value.
  637. ("stepLarge", c_float)
  638. ]
  639. # MIDI Program data.
  640. class MidiProgramData(Structure):
  641. _fields_ = [
  642. # MIDI bank.
  643. ("bank", c_uint32),
  644. # MIDI program.
  645. ("program", c_uint32),
  646. # MIDI program name.
  647. ("name", c_char_p)
  648. ]
  649. # Custom data, used for saving key:value 'dictionaries'.
  650. class CustomData(Structure):
  651. _fields_ = [
  652. # Value type, in URI form.
  653. # @see CustomDataTypes
  654. ("type", c_char_p),
  655. # Key.
  656. # @see CustomDataKeys
  657. ("key", c_char_p),
  658. # Value.
  659. ("value", c_char_p)
  660. ]
  661. # Engine driver device information.
  662. class EngineDriverDeviceInfo(Structure):
  663. _fields_ = [
  664. # This driver device hints.
  665. # @see EngineDriverHints
  666. ("hints", c_uint),
  667. # Available buffer sizes.
  668. # Terminated with 0.
  669. ("bufferSizes", POINTER(c_uint32)),
  670. # Available sample rates.
  671. # Terminated with 0.0.
  672. ("sampleRates", POINTER(c_double))
  673. ]
  674. # ------------------------------------------------------------------------------------------------------------
  675. # Carla Backend API (Python compatible stuff)
  676. # @see ParameterData
  677. PyParameterData = {
  678. 'type': PARAMETER_UNKNOWN,
  679. 'hints': 0x0,
  680. 'index': PARAMETER_NULL,
  681. 'rindex': -1,
  682. 'midiCC': -1,
  683. 'midiChannel': 0
  684. }
  685. # @see ParameterRanges
  686. PyParameterRanges = {
  687. 'def': 0.0,
  688. 'min': 0.0,
  689. 'max': 1.0,
  690. 'step': 0.01,
  691. 'stepSmall': 0.0001,
  692. 'stepLarge': 0.1
  693. }
  694. # @see MidiProgramData
  695. PyMidiProgramData = {
  696. 'bank': 0,
  697. 'program': 0,
  698. 'name': None
  699. }
  700. # @see CustomData
  701. PyCustomData = {
  702. 'type': None,
  703. 'key': None,
  704. 'value': None
  705. }
  706. # @see EngineDriverDeviceInfo
  707. PyEngineDriverDeviceInfo = {
  708. 'hints': 0x0,
  709. 'bufferSizes': [],
  710. 'sampleRates': []
  711. }
  712. # ------------------------------------------------------------------------------------------------------------
  713. # File Callback Opcode
  714. # File callback opcodes.
  715. # Front-ends must always block-wait for user input.
  716. # @see FileCallbackFunc and carla_set_file_callback()
  717. # Debug.
  718. # This opcode is undefined and used only for testing purposes.
  719. FILE_CALLBACK_DEBUG = 0
  720. # Open file or folder.
  721. FILE_CALLBACK_OPEN = 1
  722. # Save file or folder.
  723. FILE_CALLBACK_SAVE = 2
  724. # ------------------------------------------------------------------------------------------------------------
  725. # Carla Host API (C stuff)
  726. # File callback function.
  727. # @see FileCallbackOpcode
  728. FileCallbackFunc = CFUNCTYPE(c_char_p, c_void_p, c_enum, c_bool, c_char_p, c_char_p)
  729. # Information about a loaded plugin.
  730. # @see carla_get_plugin_info()
  731. class CarlaPluginInfo(Structure):
  732. _fields_ = [
  733. # Plugin type.
  734. ("type", c_enum),
  735. # Plugin category.
  736. ("category", c_enum),
  737. # Plugin hints.
  738. # @see PluginHints
  739. ("hints", c_uint),
  740. # Plugin options available for the user to change.
  741. # @see PluginOptions
  742. ("optionsAvailable", c_uint),
  743. # Plugin options currently enabled.
  744. # Some options are enabled but not available, which means they will always be on.
  745. # @see PluginOptions
  746. ("optionsEnabled", c_uint),
  747. # Plugin filename.
  748. # This can be the plugin binary or resource file.
  749. ("filename", c_char_p),
  750. # Plugin name.
  751. # This name is unique within a Carla instance.
  752. # @see carla_get_real_plugin_name()
  753. ("name", c_char_p),
  754. # Plugin label or URI.
  755. ("label", c_char_p),
  756. # Plugin author/maker.
  757. ("maker", c_char_p),
  758. # Plugin copyright/license.
  759. ("copyright", c_char_p),
  760. # Icon name for this plugin, in lowercase.
  761. # Default is "plugin".
  762. ("iconName", c_char_p),
  763. # Plugin unique Id.
  764. # This Id is dependant on the plugin type and may sometimes be 0.
  765. ("uniqueId", c_long)
  766. ]
  767. # Information about an internal Carla plugin.
  768. # @see carla_get_internal_plugin_info()
  769. class CarlaNativePluginInfo(Structure):
  770. _fields_ = [
  771. # Plugin category.
  772. ("category", c_enum),
  773. # Plugin hints.
  774. # @see PluginHints
  775. ("hints", c_uint),
  776. # Number of audio inputs.
  777. ("audioIns", c_uint32),
  778. # Number of audio outputs.
  779. ("audioOuts", c_uint32),
  780. # Number of MIDI inputs.
  781. ("midiIns", c_uint32),
  782. # Number of MIDI outputs.
  783. ("midiOuts", c_uint32),
  784. # Number of input parameters.
  785. ("parameterIns", c_uint32),
  786. # Number of output parameters.
  787. ("parameterOuts", c_uint32),
  788. # Plugin name.
  789. ("name", c_char_p),
  790. # Plugin label.
  791. ("label", c_char_p),
  792. # Plugin author/maker.
  793. ("maker", c_char_p),
  794. # Plugin copyright/license.
  795. ("copyright", c_char_p)
  796. ]
  797. # Port count information, used for Audio and MIDI ports and parameters.
  798. # @see carla_get_audio_port_count_info()
  799. # @see carla_get_midi_port_count_info()
  800. # @see carla_get_parameter_count_info()
  801. class CarlaPortCountInfo(Structure):
  802. _fields_ = [
  803. # Number of inputs.
  804. ("ins", c_uint32),
  805. # Number of outputs.
  806. ("outs", c_uint32)
  807. ]
  808. # Parameter information.
  809. # @see carla_get_parameter_info()
  810. class CarlaParameterInfo(Structure):
  811. _fields_ = [
  812. # Parameter name.
  813. ("name", c_char_p),
  814. # Parameter symbol.
  815. ("symbol", c_char_p),
  816. # Parameter unit.
  817. ("unit", c_char_p),
  818. # Number of scale points.
  819. # @see CarlaScalePointInfo
  820. ("scalePointCount", c_uint32)
  821. ]
  822. # Parameter scale point information.
  823. # @see carla_get_parameter_scalepoint_info()
  824. class CarlaScalePointInfo(Structure):
  825. _fields_ = [
  826. # Scale point value.
  827. ("value", c_float),
  828. # Scale point label.
  829. ("label", c_char_p)
  830. ]
  831. # Transport information.
  832. # @see carla_get_transport_info()
  833. class CarlaTransportInfo(Structure):
  834. _fields_ = [
  835. # Wherever transport is playing.
  836. ("playing", c_bool),
  837. # Current transport frame.
  838. ("frame", c_uint64),
  839. # Bar
  840. ("bar", c_int32),
  841. # Beat
  842. ("beat", c_int32),
  843. # Tick
  844. ("tick", c_int32),
  845. # Beats per minute.
  846. ("bpm", c_double)
  847. ]
  848. # ------------------------------------------------------------------------------------------------------------
  849. # Carla Host API (Python compatible stuff)
  850. # @see CarlaPluginInfo
  851. PyCarlaPluginInfo = {
  852. 'type': PLUGIN_NONE,
  853. 'category': PLUGIN_CATEGORY_NONE,
  854. 'hints': 0x0,
  855. 'optionsAvailable': 0x0,
  856. 'optionsEnabled': 0x0,
  857. 'filename': None,
  858. 'name': None,
  859. 'label': None,
  860. 'maker': None,
  861. 'copyright': None,
  862. 'iconName': None,
  863. 'uniqueId': 0
  864. }
  865. # @see CarlaPortCountInfo
  866. PyCarlaPortCountInfo = {
  867. 'ins': 0,
  868. 'outs': 0
  869. }
  870. # @see CarlaParameterInfo
  871. PyCarlaParameterInfo = {
  872. 'name': None,
  873. 'symbol': None,
  874. 'unit': None,
  875. 'scalePointCount': 0,
  876. }
  877. # @see CarlaScalePointInfo
  878. PyCarlaScalePointInfo = {
  879. 'value': 0.0,
  880. 'label': None
  881. }
  882. # @see CarlaTransportInfo
  883. PyCarlaTransportInfo = {
  884. "playing": False,
  885. "frame": 0,
  886. "bar": 0,
  887. "beat": 0,
  888. "tick": 0,
  889. "bpm": 0.0
  890. }
  891. # ------------------------------------------------------------------------------------------------------------
  892. # Set BINARY_NATIVE
  893. if HAIKU or LINUX or MACOS:
  894. BINARY_NATIVE = BINARY_POSIX64 if kIs64bit else BINARY_POSIX32
  895. elif WINDOWS:
  896. BINARY_NATIVE = BINARY_WIN64 if kIs64bit else BINARY_WIN32
  897. else:
  898. BINARY_NATIVE = BINARY_OTHER
  899. # ------------------------------------------------------------------------------------------------------------
  900. # Python Host object (Control/Standalone)
  901. class Host(object):
  902. def __init__(self, libName):
  903. object.__init__(self)
  904. self._init(libName)
  905. # Get the complete license text of used third-party code and features.
  906. # Returned string is in basic html format.
  907. def get_complete_license_text(self):
  908. return charPtrToString(self.lib.carla_get_complete_license_text())
  909. # Get all the supported file extensions in carla_load_file().
  910. # Returned string uses this syntax:
  911. # @code
  912. # "*.ext1;*.ext2;*.ext3"
  913. # @endcode
  914. def get_supported_file_extensions(self):
  915. return charPtrToString(self.lib.carla_get_supported_file_extensions())
  916. # Get how many engine drivers are available.
  917. def get_engine_driver_count(self):
  918. return int(self.lib.carla_get_engine_driver_count())
  919. # Get an engine driver name.
  920. # @param index Driver index
  921. def get_engine_driver_name(self, index):
  922. return charPtrToString(self.lib.carla_get_engine_driver_name(index))
  923. # Get the device names of an engine driver.
  924. # @param index Driver index
  925. def get_engine_driver_device_names(self, index):
  926. return charPtrPtrToStringList(self.lib.carla_get_engine_driver_device_names(index))
  927. # Get information about a device driver.
  928. # @param index Driver index
  929. # @param name Device name
  930. def get_engine_driver_device_info(self, index, name):
  931. return structToDict(self.lib.carla_get_engine_driver_device_info(index, name.encode("utf-8")).contents)
  932. # Get how many internal plugins are available.
  933. def get_internal_plugin_count(self):
  934. return int(self.lib.carla_get_internal_plugin_count())
  935. # Get information about an internal plugin.
  936. # @param index Internal plugin Id
  937. def get_internal_plugin_info(self, index):
  938. return structToDict(self.lib.carla_get_internal_plugin_info(index).contents)
  939. # Initialize the engine.
  940. # Make sure to call carla_engine_idle() at regular intervals afterwards.
  941. # @param driverName Driver to use
  942. # @param clientName Engine master client name
  943. def engine_init(self, driverName, clientName):
  944. return bool(self.lib.carla_engine_init(driverName.encode("utf-8"), clientName.encode("utf-8")))
  945. # Close the engine.
  946. # This function always closes the engine even if it returns false.
  947. # In other words, even when something goes wrong when closing the engine it still be closed nonetheless.
  948. def engine_close(self):
  949. return bool(self.lib.carla_engine_close())
  950. # Idle the engine.
  951. # Do not call this if the engine is not running.
  952. def engine_idle(self):
  953. self.lib.carla_engine_idle()
  954. # Check if the engine is running.
  955. def is_engine_running(self):
  956. return bool(self.lib.carla_is_engine_running())
  957. # Tell the engine it's about to close.
  958. # This is used to prevent the engine thread(s) from reactivating.
  959. def set_engine_about_to_close(self):
  960. self.lib.carla_set_engine_about_to_close()
  961. # Set the engine callback function.
  962. # @param func Callback function
  963. def set_engine_callback(self, func):
  964. self._engineCallback = EngineCallbackFunc(func)
  965. self.lib.carla_set_engine_callback(self._engineCallback, None)
  966. # Set an engine option.
  967. # @param option Option
  968. # @param value Value as number
  969. # @param valueStr Value as string
  970. def set_engine_option(self, option, value, valueStr):
  971. self.lib.carla_set_engine_option(option, value, valueStr.encode("utf-8"))
  972. # Set the file callback function.
  973. # @param func Callback function
  974. # @param ptr Callback pointer
  975. def set_file_callback(self, func):
  976. self._fileCallback = FileCallbackFunc(func)
  977. self.lib.carla_set_file_callback(self._fileCallback, None)
  978. # Load a file of any type.\n
  979. # This will try to load a generic file as a plugin,
  980. # either by direct handling (Csound, GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI).
  981. # @param Filename Filename
  982. # @see carla_get_supported_file_extensions()
  983. def load_file(self, filename):
  984. return bool(self.lib.carla_load_file(filename.encode("utf-8")))
  985. # Load a Carla project file.
  986. # @param Filename Filename
  987. # @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed.
  988. def load_project(self, filename):
  989. return bool(self.lib.carla_load_project(filename.encode("utf-8")))
  990. # Save current project to a file.
  991. # @param Filename Filename
  992. def save_project(self, filename):
  993. return bool(self.lib.carla_save_project(filename.encode("utf-8")))
  994. # Connect two patchbay ports.
  995. # @param portIdA Output port
  996. # @param portIdB Input port
  997. # @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED
  998. def patchbay_connect(self, portIdA, portIdB):
  999. return bool(self.lib.carla_patchbay_connect(portIdA, portIdB))
  1000. # Disconnect two patchbay ports.
  1001. # @param connectionId Connection Id
  1002. # @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED
  1003. def patchbay_disconnect(self, connectionId):
  1004. return bool(self.lib.carla_patchbay_disconnect(connectionId))
  1005. # Force the engine to resend all patchbay clients, ports and connections again.
  1006. def patchbay_refresh(self):
  1007. return bool(self.lib.carla_patchbay_refresh())
  1008. # Start playback of the engine transport.
  1009. def transport_play(self):
  1010. self.lib.carla_transport_play()
  1011. # Pause the engine transport.
  1012. def transport_pause(self):
  1013. self.lib.carla_transport_pause()
  1014. # Relocate the engine transport to a specific frame.
  1015. # @param frames Frame to relocate to.
  1016. def transport_relocate(self, frame):
  1017. self.lib.carla_transport_relocate(frame)
  1018. # Get the current transport frame.
  1019. def get_current_transport_frame(self):
  1020. return bool(self.lib.carla_get_current_transport_frame())
  1021. # Get the engine transport information.
  1022. def get_transport_info(self):
  1023. return structToDict(self.lib.carla_get_transport_info().contents)
  1024. # Add a new plugin.
  1025. # If you don't know the binary type use the BINARY_NATIVE macro.
  1026. # @param btype Binary type
  1027. # @param ptype Plugin type
  1028. # @param filename Filename, if applicable
  1029. # @param name Name of the plugin, can be NULL
  1030. # @param label Plugin label, if applicable
  1031. # @param extraPtr Extra pointer, defined per plugin type
  1032. def add_plugin(self, btype, ptype, filename, name, label, extraPtr):
  1033. cfilename = filename.encode("utf-8") if filename else None
  1034. cname = name.encode("utf-8") if name else None
  1035. clabel = label.encode("utf-8") if label else None
  1036. return bool(self.lib.carla_add_plugin(btype, ptype, cfilename, cname, clabel, cast(extraPtr, c_void_p)))
  1037. # Remove a plugin.
  1038. # @param pluginId Plugin to remove.
  1039. def remove_plugin(self, pluginId):
  1040. return bool(self.lib.carla_remove_plugin(pluginId))
  1041. # Remove all plugins.
  1042. def remove_all_plugins(self):
  1043. return bool(self.lib.carla_remove_all_plugins())
  1044. # Rename a plugin.\n
  1045. # Returns the new name, or NULL if the operation failed.
  1046. # @param pluginId Plugin to rename
  1047. # @param newName New plugin name
  1048. def rename_plugin(self, pluginId, newName):
  1049. return charPtrToString(self.lib.carla_rename_plugin(pluginId, newName.encode("utf-8")))
  1050. # Clone a plugin.
  1051. # @param pluginId Plugin to clone
  1052. def clone_plugin(self, pluginId):
  1053. return bool(self.lib.carla_clone_plugin(pluginId))
  1054. # Prepare replace of a plugin.\n
  1055. # The next call to carla_add_plugin() will use this id, replacing the current plugin.
  1056. # @param pluginId Plugin to replace
  1057. # @note This function requires carla_add_plugin() to be called afterwards *as soon as possible*.
  1058. def replace_plugin(self, pluginId):
  1059. return bool(self.lib.carla_replace_plugin(pluginId))
  1060. # Switch two plugins positions.
  1061. # @param pluginIdA Plugin A
  1062. # @param pluginIdB Plugin B
  1063. def switch_plugins(self, pluginIdA, pluginIdB):
  1064. return bool(self.lib.carla_switch_plugins(pluginIdA, pluginIdB))
  1065. # Load a plugin state.
  1066. # @param pluginId Plugin
  1067. # @param filename Path to plugin state
  1068. # @see carla_save_plugin_state()
  1069. def load_plugin_state(self, pluginId, filename):
  1070. return bool(self.lib.carla_load_plugin_state(pluginId, filename.encode("utf-8")))
  1071. # Save a plugin state.
  1072. # @param pluginId Plugin
  1073. # @param filename Path to plugin state
  1074. # @see carla_load_plugin_state()
  1075. def save_plugin_state(self, pluginId, filename):
  1076. return bool(self.lib.carla_save_plugin_state(pluginId, filename.encode("utf-8")))
  1077. # Get information from a plugin.
  1078. # @param pluginId Plugin
  1079. def get_plugin_info(self, pluginId):
  1080. return structToDict(self.lib.carla_get_plugin_info(pluginId).contents)
  1081. # Get audio port count information from a plugin.
  1082. # @param pluginId Plugin
  1083. def get_audio_port_count_info(self, pluginId):
  1084. return structToDict(self.lib.carla_get_audio_port_count_info(pluginId).contents)
  1085. # Get MIDI port count information from a plugin.
  1086. # @param pluginId Plugin
  1087. def get_midi_port_count_info(self, pluginId):
  1088. return structToDict(self.lib.carla_get_midi_port_count_info(pluginId).contents)
  1089. # Get parameter count information from a plugin.
  1090. # @param pluginId Plugin
  1091. def get_parameter_count_info(self, pluginId):
  1092. return structToDict(self.lib.carla_get_parameter_count_info(pluginId).contents)
  1093. # Get parameter information from a plugin.
  1094. # @param pluginId Plugin
  1095. # @param parameterId Parameter index
  1096. # @see carla_get_parameter_count()
  1097. def get_parameter_info(self, pluginId, parameterId):
  1098. return structToDict(self.lib.carla_get_parameter_info(pluginId, parameterId).contents)
  1099. # Get parameter scale point information from a plugin.
  1100. # @param pluginId Plugin
  1101. # @param parameterId Parameter index
  1102. # @param scalePointId Parameter scale-point index
  1103. # @see CarlaParameterInfo::scalePointCount
  1104. def get_parameter_scalepoint_info(self, pluginId, parameterId, scalePointId):
  1105. return structToDict(self.lib.carla_get_parameter_scalepoint_info(pluginId, parameterId, scalePointId).contents)
  1106. # Get a plugin's parameter data.
  1107. # @param pluginId Plugin
  1108. # @param parameterId Parameter index
  1109. # @see carla_get_parameter_count()
  1110. def get_parameter_data(self, pluginId, parameterId):
  1111. return structToDict(self.lib.carla_get_parameter_data(pluginId, parameterId).contents)
  1112. # Get a plugin's parameter ranges.
  1113. # @param pluginId Plugin
  1114. # @param parameterId Parameter index
  1115. # @see carla_get_parameter_count()
  1116. def get_parameter_ranges(self, pluginId, parameterId):
  1117. return structToDict(self.lib.carla_get_parameter_ranges(pluginId, parameterId).contents)
  1118. # Get a plugin's MIDI program data.
  1119. # @param pluginId Plugin
  1120. # @param midiProgramId MIDI Program index
  1121. # @see carla_get_midi_program_count()
  1122. def get_midi_program_data(self, pluginId, midiProgramId):
  1123. return structToDict(self.lib.carla_get_midi_program_data(pluginId, midiProgramId).contents)
  1124. # Get a plugin's custom data.
  1125. # @param pluginId Plugin
  1126. # @param customDataId Custom data index
  1127. # @see carla_get_custom_data_count()
  1128. def get_custom_data(self, pluginId, customDataId):
  1129. return structToDict(self.lib.carla_get_custom_data(pluginId, customDataId).contents)
  1130. # Get a plugin's chunk data.
  1131. # @param pluginId Plugin
  1132. # @see PLUGIN_OPTION_USE_CHUNKS
  1133. def get_chunk_data(self, pluginId):
  1134. return charPtrToString(self.lib.carla_get_chunk_data(pluginId))
  1135. # Get how many parameters a plugin has.
  1136. # @param pluginId Plugin
  1137. def get_parameter_count(self, pluginId):
  1138. return int(self.lib.carla_get_parameter_count(pluginId))
  1139. # Get how many programs a plugin has.
  1140. # @param pluginId Plugin
  1141. # @see carla_get_program_name()
  1142. def get_program_count(self, pluginId):
  1143. return int(self.lib.carla_get_program_count(pluginId))
  1144. # Get how many MIDI programs a plugin has.
  1145. # @param pluginId Plugin
  1146. # @see carla_get_midi_program_name() and carla_get_midi_program_data()
  1147. def get_midi_program_count(self, pluginId):
  1148. return int(self.lib.carla_get_midi_program_count(pluginId))
  1149. # Get how many custom data sets a plugin has.
  1150. # @param pluginId Plugin
  1151. # @see carla_get_custom_data()
  1152. def get_custom_data_count(self, pluginId):
  1153. return int(self.lib.carla_get_custom_data_count(pluginId))
  1154. # Get a plugin's parameter text (custom display of internal values).
  1155. # @param pluginId Plugin
  1156. # @param parameterId Parameter index
  1157. # @param value Parameter value
  1158. # @see PARAMETER_USES_CUSTOM_TEXT
  1159. def get_parameter_text(self, pluginId, parameterId, value):
  1160. return charPtrToString(self.lib.carla_get_parameter_text(pluginId, parameterId, value))
  1161. # Get a plugin's program name.
  1162. # @param pluginId Plugin
  1163. # @param programId Program index
  1164. # @see carla_get_program_count()
  1165. def get_program_name(self, pluginId, programId):
  1166. return charPtrToString(self.lib.carla_get_program_name(pluginId, programId))
  1167. # Get a plugin's MIDI program name.
  1168. # @param pluginId Plugin
  1169. # @param midiProgramId MIDI Program index
  1170. # @see carla_get_midi_program_count()
  1171. def get_midi_program_name(self, pluginId, midiProgramId):
  1172. return charPtrToString(self.lib.carla_get_midi_program_name(pluginId, midiProgramId))
  1173. # Get a plugin's real name.\n
  1174. # This is the name the plugin uses to identify itself; may not be unique.
  1175. # @param pluginId Plugin
  1176. def get_real_plugin_name(self, pluginId):
  1177. return charPtrToString(self.lib.carla_get_real_plugin_name(pluginId))
  1178. # Get a plugin's program index.
  1179. # @param pluginId Plugin
  1180. def get_current_program_index(self, pluginId):
  1181. return int(self.lib.carla_get_current_program_index(pluginId))
  1182. # Get a plugin's midi program index.
  1183. # @param pluginId Plugin
  1184. def get_current_midi_program_index(self, pluginId):
  1185. return int(self.lib.carla_get_current_midi_program_index(pluginId))
  1186. # Get a plugin's default parameter value.
  1187. # @param pluginId Plugin
  1188. # @param parameterId Parameter index
  1189. def get_default_parameter_value(self, pluginId, parameterId):
  1190. return float(self.lib.carla_get_default_parameter_value(pluginId, parameterId))
  1191. # Get a plugin's current parameter value.
  1192. # @param pluginId Plugin
  1193. # @param parameterId Parameter index
  1194. def get_current_parameter_value(self, pluginId, parameterId):
  1195. return float(self.lib.carla_get_current_parameter_value(pluginId, parameterId))
  1196. # Get a plugin's input peak value.
  1197. # @param pluginId Plugin
  1198. # @param isLeft Wherever to get the left/mono value, otherwise right.
  1199. def get_input_peak_value(self, pluginId, isLeft):
  1200. return float(self.lib.carla_get_input_peak_value(pluginId, isLeft))
  1201. # Get a plugin's output peak value.
  1202. # @param pluginId Plugin
  1203. # @param isLeft Wherever to get the left/mono value, otherwise right.
  1204. def get_output_peak_value(self, pluginId, isLeft):
  1205. return float(self.lib.carla_get_output_peak_value(pluginId, isLeft))
  1206. # Enable a plugin's option.
  1207. # @param pluginId Plugin
  1208. # @param option An option from PluginOptions
  1209. # @param yesNo New enabled state
  1210. def set_option(self, pluginId, option, yesNo):
  1211. self.lib.carla_set_option(pluginId, option, yesNo)
  1212. # Enable or disable a plugin.
  1213. # @param pluginId Plugin
  1214. # @param onOff New active state
  1215. def set_active(self, pluginId, onOff):
  1216. self.lib.carla_set_active(pluginId, onOff)
  1217. # Change a plugin's internal dry/wet.
  1218. # @param pluginId Plugin
  1219. # @param value New dry/wet value
  1220. def set_drywet(self, pluginId, value):
  1221. self.lib.carla_set_drywet(pluginId, value)
  1222. # Change a plugin's internal volume.
  1223. # @param pluginId Plugin
  1224. # @param value New volume
  1225. def set_volume(self, pluginId, value):
  1226. self.lib.carla_set_volume(pluginId, value)
  1227. # Change a plugin's internal stereo balance, left channel.
  1228. # @param pluginId Plugin
  1229. # @param value New value
  1230. def set_balance_left(self, pluginId, value):
  1231. self.lib.carla_set_balance_left(pluginId, value)
  1232. # Change a plugin's internal stereo balance, right channel.
  1233. # @param pluginId Plugin
  1234. # @param value New value
  1235. def set_balance_right(self, pluginId, value):
  1236. self.lib.carla_set_balance_right(pluginId, value)
  1237. # Change a plugin's internal mono panning value.
  1238. # @param pluginId Plugin
  1239. # @param value New value
  1240. def set_panning(self, pluginId, value):
  1241. self.lib.carla_set_panning(pluginId, value)
  1242. # Change a plugin's internal control channel.
  1243. # @param pluginId Plugin
  1244. # @param channel New channel
  1245. def set_ctrl_channel(self, pluginId, channel):
  1246. self.lib.carla_set_ctrl_channel(pluginId, channel)
  1247. # Change a plugin's parameter value.
  1248. # @param pluginId Plugin
  1249. # @param parameterId Parameter index
  1250. # @param value New value
  1251. def set_parameter_value(self, pluginId, parameterId, value):
  1252. self.lib.carla_set_parameter_value(pluginId, parameterId, value)
  1253. # Change a plugin's parameter MIDI cc.
  1254. # @param pluginId Plugin
  1255. # @param parameterId Parameter index
  1256. # @param cc New MIDI cc
  1257. def set_parameter_midi_channel(self, pluginId, parameterId, channel):
  1258. self.lib.carla_set_parameter_midi_channel(pluginId, parameterId, channel)
  1259. # Change a plugin's parameter MIDI channel.
  1260. # @param pluginId Plugin
  1261. # @param parameterId Parameter index
  1262. # @param channel New MIDI channel
  1263. def set_parameter_midi_cc(self, pluginId, parameterId, cc):
  1264. self.lib.carla_set_parameter_midi_cc(pluginId, parameterId, cc)
  1265. # Change a plugin's current program.
  1266. # @param pluginId Plugin
  1267. # @param programId New program
  1268. def set_program(self, pluginId, programId):
  1269. self.lib.carla_set_program(pluginId, programId)
  1270. # Change a plugin's current MIDI program.
  1271. # @param pluginId Plugin
  1272. # @param midiProgramId New value
  1273. def set_midi_program(self, pluginId, midiProgramId):
  1274. self.lib.carla_set_midi_program(pluginId, midiProgramId)
  1275. # Set a plugin's custom data set.
  1276. # @param pluginId Plugin
  1277. # @param type Type
  1278. # @param key Key
  1279. # @param value New value
  1280. # @see CustomDataTypes and CustomDataKeys
  1281. def set_custom_data(self, pluginId, type_, key, value):
  1282. self.lib.carla_set_custom_data(pluginId, type_.encode("utf-8"), key.encode("utf-8"), value.encode("utf-8"))
  1283. # Set a plugin's chunk data.
  1284. # @param pluginId Plugin
  1285. # @param value New value
  1286. # @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data()
  1287. def set_chunk_data(self, pluginId, chunkData):
  1288. self.lib.carla_set_chunk_data(pluginId, chunkData.encode("utf-8"))
  1289. # Tell a plugin to prepare for save.\n
  1290. # This should be called before saving custom data sets.
  1291. # @param pluginId Plugin
  1292. def prepare_for_save(self, pluginId):
  1293. self.lib.carla_prepare_for_save(pluginId)
  1294. # Send a single note of a plugin.\n
  1295. # If velocity is 0, note-off is sent; note-on otherwise.
  1296. # @param pluginId Plugin
  1297. # @param channel Note channel
  1298. # @param note Note pitch
  1299. # @param velocity Note velocity
  1300. def send_midi_note(self, pluginId, channel, note, velocity):
  1301. self.lib.carla_send_midi_note(pluginId, channel, note, velocity)
  1302. # Tell a plugin to show its own custom UI.
  1303. # @param pluginId Plugin
  1304. # @param yesNo New UI state, visible or not
  1305. # @see PLUGIN_HAS_CUSTOM_UI
  1306. def show_custom_ui(self, pluginId, yesNo):
  1307. self.lib.carla_show_custom_ui(pluginId, yesNo)
  1308. # Get the current engine buffer size.
  1309. def get_buffer_size(self):
  1310. return int(self.lib.carla_get_buffer_size())
  1311. # Get the current engine sample rate.
  1312. def get_sample_rate(self):
  1313. return float(self.lib.carla_get_sample_rate())
  1314. # Get the last error.
  1315. def get_last_error(self):
  1316. return charPtrToString(self.lib.carla_get_last_error())
  1317. # Get the current engine OSC URL (TCP).
  1318. def get_host_osc_url_tcp(self):
  1319. return charPtrToString(self.lib.carla_get_host_osc_url_tcp())
  1320. # Get the current engine OSC URL (UDP).
  1321. def get_host_osc_url_udp(self):
  1322. return charPtrToString(self.lib.carla_get_host_osc_url_udp())
  1323. def _init(self, libName):
  1324. self.lib = cdll.LoadLibrary(libName)
  1325. self.lib.carla_get_complete_license_text.argtypes = None
  1326. self.lib.carla_get_complete_license_text.restype = c_char_p
  1327. self.lib.carla_get_supported_file_extensions.argtypes = None
  1328. self.lib.carla_get_supported_file_extensions.restype = c_char_p
  1329. self.lib.carla_get_engine_driver_count.argtypes = None
  1330. self.lib.carla_get_engine_driver_count.restype = c_uint
  1331. self.lib.carla_get_engine_driver_name.argtypes = [c_uint]
  1332. self.lib.carla_get_engine_driver_name.restype = c_char_p
  1333. self.lib.carla_get_engine_driver_device_names.argtypes = [c_uint]
  1334. self.lib.carla_get_engine_driver_device_names.restype = POINTER(c_char_p)
  1335. self.lib.carla_get_engine_driver_device_info.argtypes = [c_uint, c_char_p]
  1336. self.lib.carla_get_engine_driver_device_info.restype = POINTER(EngineDriverDeviceInfo)
  1337. self.lib.carla_get_internal_plugin_count.argtypes = None
  1338. self.lib.carla_get_internal_plugin_count.restype = c_uint
  1339. self.lib.carla_get_internal_plugin_info.argtypes = [c_uint]
  1340. self.lib.carla_get_internal_plugin_info.restype = POINTER(CarlaNativePluginInfo)
  1341. self.lib.carla_engine_init.argtypes = [c_char_p, c_char_p]
  1342. self.lib.carla_engine_init.restype = c_bool
  1343. self.lib.carla_engine_close.argtypes = None
  1344. self.lib.carla_engine_close.restype = c_bool
  1345. self.lib.carla_engine_idle.argtypes = None
  1346. self.lib.carla_engine_idle.restype = None
  1347. self.lib.carla_is_engine_running.argtypes = None
  1348. self.lib.carla_is_engine_running.restype = c_bool
  1349. self.lib.carla_set_engine_about_to_close.argtypes = None
  1350. self.lib.carla_set_engine_about_to_close.restype = None
  1351. self.lib.carla_set_engine_callback.argtypes = [EngineCallbackFunc, c_void_p]
  1352. self.lib.carla_set_engine_callback.restype = None
  1353. self.lib.carla_set_engine_option.argtypes = [c_enum, c_int, c_char_p]
  1354. self.lib.carla_set_engine_option.restype = None
  1355. self.lib.carla_set_file_callback.argtypes = [FileCallbackFunc, c_void_p]
  1356. self.lib.carla_set_file_callback.restype = None
  1357. self.lib.carla_load_file.argtypes = [c_char_p]
  1358. self.lib.carla_load_file.restype = c_bool
  1359. self.lib.carla_load_project.argtypes = [c_char_p]
  1360. self.lib.carla_load_project.restype = c_bool
  1361. self.lib.carla_save_project.argtypes = [c_char_p]
  1362. self.lib.carla_save_project.restype = c_bool
  1363. self.lib.carla_patchbay_connect.argtypes = [c_int, c_int]
  1364. self.lib.carla_patchbay_connect.restype = c_bool
  1365. self.lib.carla_patchbay_disconnect.argtypes = [c_uint]
  1366. self.lib.carla_patchbay_disconnect.restype = c_bool
  1367. self.lib.carla_patchbay_refresh.argtypes = None
  1368. self.lib.carla_patchbay_refresh.restype = c_bool
  1369. self.lib.carla_transport_play.argtypes = None
  1370. self.lib.carla_transport_play.restype = None
  1371. self.lib.carla_transport_pause.argtypes = None
  1372. self.lib.carla_transport_pause.restype = None
  1373. self.lib.carla_transport_relocate.argtypes = [c_uint64]
  1374. self.lib.carla_transport_relocate.restype = None
  1375. self.lib.carla_get_current_transport_frame.argtypes = None
  1376. self.lib.carla_get_current_transport_frame.restype = c_uint64
  1377. self.lib.carla_get_transport_info.argtypes = None
  1378. self.lib.carla_get_transport_info.restype = POINTER(CarlaTransportInfo)
  1379. self.lib.carla_add_plugin.argtypes = [c_enum, c_enum, c_char_p, c_char_p, c_char_p, c_void_p]
  1380. self.lib.carla_add_plugin.restype = c_bool
  1381. self.lib.carla_remove_plugin.argtypes = [c_uint]
  1382. self.lib.carla_remove_plugin.restype = c_bool
  1383. self.lib.carla_remove_all_plugins.argtypes = None
  1384. self.lib.carla_remove_all_plugins.restype = c_bool
  1385. self.lib.carla_rename_plugin.argtypes = [c_uint, c_char_p]
  1386. self.lib.carla_rename_plugin.restype = c_char_p
  1387. self.lib.carla_clone_plugin.argtypes = [c_uint]
  1388. self.lib.carla_clone_plugin.restype = c_bool
  1389. self.lib.carla_replace_plugin.argtypes = [c_uint]
  1390. self.lib.carla_replace_plugin.restype = c_bool
  1391. self.lib.carla_switch_plugins.argtypes = [c_uint, c_uint]
  1392. self.lib.carla_switch_plugins.restype = c_bool
  1393. self.lib.carla_load_plugin_state.argtypes = [c_uint, c_char_p]
  1394. self.lib.carla_load_plugin_state.restype = c_bool
  1395. self.lib.carla_save_plugin_state.argtypes = [c_uint, c_char_p]
  1396. self.lib.carla_save_plugin_state.restype = c_bool
  1397. self.lib.carla_get_plugin_info.argtypes = [c_uint]
  1398. self.lib.carla_get_plugin_info.restype = POINTER(CarlaPluginInfo)
  1399. self.lib.carla_get_audio_port_count_info.argtypes = [c_uint]
  1400. self.lib.carla_get_audio_port_count_info.restype = POINTER(CarlaPortCountInfo)
  1401. self.lib.carla_get_midi_port_count_info.argtypes = [c_uint]
  1402. self.lib.carla_get_midi_port_count_info.restype = POINTER(CarlaPortCountInfo)
  1403. self.lib.carla_get_parameter_count_info.argtypes = [c_uint]
  1404. self.lib.carla_get_parameter_count_info.restype = POINTER(CarlaPortCountInfo)
  1405. self.lib.carla_get_parameter_info.argtypes = [c_uint, c_uint32]
  1406. self.lib.carla_get_parameter_info.restype = POINTER(CarlaParameterInfo)
  1407. self.lib.carla_get_parameter_scalepoint_info.argtypes = [c_uint, c_uint32, c_uint32]
  1408. self.lib.carla_get_parameter_scalepoint_info.restype = POINTER(CarlaScalePointInfo)
  1409. self.lib.carla_get_parameter_data.argtypes = [c_uint, c_uint32]
  1410. self.lib.carla_get_parameter_data.restype = POINTER(ParameterData)
  1411. self.lib.carla_get_parameter_ranges.argtypes = [c_uint, c_uint32]
  1412. self.lib.carla_get_parameter_ranges.restype = POINTER(ParameterRanges)
  1413. self.lib.carla_get_midi_program_data.argtypes = [c_uint, c_uint32]
  1414. self.lib.carla_get_midi_program_data.restype = POINTER(MidiProgramData)
  1415. self.lib.carla_get_custom_data.argtypes = [c_uint, c_uint32]
  1416. self.lib.carla_get_custom_data.restype = POINTER(CustomData)
  1417. self.lib.carla_get_chunk_data.argtypes = [c_uint]
  1418. self.lib.carla_get_chunk_data.restype = c_char_p
  1419. self.lib.carla_get_parameter_count.argtypes = [c_uint]
  1420. self.lib.carla_get_parameter_count.restype = c_uint32
  1421. self.lib.carla_get_program_count.argtypes = [c_uint]
  1422. self.lib.carla_get_program_count.restype = c_uint32
  1423. self.lib.carla_get_midi_program_count.argtypes = [c_uint]
  1424. self.lib.carla_get_midi_program_count.restype = c_uint32
  1425. self.lib.carla_get_custom_data_count.argtypes = [c_uint]
  1426. self.lib.carla_get_custom_data_count.restype = c_uint32
  1427. self.lib.carla_get_parameter_text.argtypes = [c_uint, c_uint32, c_float]
  1428. self.lib.carla_get_parameter_text.restype = c_char_p
  1429. self.lib.carla_get_program_name.argtypes = [c_uint, c_uint32]
  1430. self.lib.carla_get_program_name.restype = c_char_p
  1431. self.lib.carla_get_midi_program_name.argtypes = [c_uint, c_uint32]
  1432. self.lib.carla_get_midi_program_name.restype = c_char_p
  1433. self.lib.carla_get_real_plugin_name.argtypes = [c_uint]
  1434. self.lib.carla_get_real_plugin_name.restype = c_char_p
  1435. self.lib.carla_get_current_program_index.argtypes = [c_uint]
  1436. self.lib.carla_get_current_program_index.restype = c_int32
  1437. self.lib.carla_get_current_midi_program_index.argtypes = [c_uint]
  1438. self.lib.carla_get_current_midi_program_index.restype = c_int32
  1439. self.lib.carla_get_default_parameter_value.argtypes = [c_uint, c_uint32]
  1440. self.lib.carla_get_default_parameter_value.restype = c_float
  1441. self.lib.carla_get_current_parameter_value.argtypes = [c_uint, c_uint32]
  1442. self.lib.carla_get_current_parameter_value.restype = c_float
  1443. self.lib.carla_get_input_peak_value.argtypes = [c_uint, c_bool]
  1444. self.lib.carla_get_input_peak_value.restype = c_float
  1445. self.lib.carla_get_output_peak_value.argtypes = [c_uint, c_bool]
  1446. self.lib.carla_get_output_peak_value.restype = c_float
  1447. self.lib.carla_set_option.argtypes = [c_uint, c_uint, c_bool]
  1448. self.lib.carla_set_option.restype = None
  1449. self.lib.carla_set_active.argtypes = [c_uint, c_bool]
  1450. self.lib.carla_set_active.restype = None
  1451. self.lib.carla_set_drywet.argtypes = [c_uint, c_float]
  1452. self.lib.carla_set_drywet.restype = None
  1453. self.lib.carla_set_volume.argtypes = [c_uint, c_float]
  1454. self.lib.carla_set_volume.restype = None
  1455. self.lib.carla_set_balance_left.argtypes = [c_uint, c_float]
  1456. self.lib.carla_set_balance_left.restype = None
  1457. self.lib.carla_set_balance_right.argtypes = [c_uint, c_float]
  1458. self.lib.carla_set_balance_right.restype = None
  1459. self.lib.carla_set_panning.argtypes = [c_uint, c_float]
  1460. self.lib.carla_set_panning.restype = None
  1461. self.lib.carla_set_ctrl_channel.argtypes = [c_uint, c_int8]
  1462. self.lib.carla_set_ctrl_channel.restype = None
  1463. self.lib.carla_set_parameter_value.argtypes = [c_uint, c_uint32, c_float]
  1464. self.lib.carla_set_parameter_value.restype = None
  1465. self.lib.carla_set_parameter_midi_channel.argtypes = [c_uint, c_uint32, c_uint8]
  1466. self.lib.carla_set_parameter_midi_channel.restype = None
  1467. self.lib.carla_set_parameter_midi_cc.argtypes = [c_uint, c_uint32, c_int16]
  1468. self.lib.carla_set_parameter_midi_cc.restype = None
  1469. self.lib.carla_set_program.argtypes = [c_uint, c_uint32]
  1470. self.lib.carla_set_program.restype = None
  1471. self.lib.carla_set_midi_program.argtypes = [c_uint, c_uint32]
  1472. self.lib.carla_set_midi_program.restype = None
  1473. self.lib.carla_set_custom_data.argtypes = [c_uint, c_char_p, c_char_p, c_char_p]
  1474. self.lib.carla_set_custom_data.restype = None
  1475. self.lib.carla_set_chunk_data.argtypes = [c_uint, c_char_p]
  1476. self.lib.carla_set_chunk_data.restype = None
  1477. self.lib.carla_prepare_for_save.argtypes = [c_uint]
  1478. self.lib.carla_prepare_for_save.restype = None
  1479. self.lib.carla_send_midi_note.argtypes = [c_uint, c_uint8, c_uint8, c_uint8]
  1480. self.lib.carla_send_midi_note.restype = None
  1481. self.lib.carla_show_custom_ui.argtypes = [c_uint, c_bool]
  1482. self.lib.carla_show_custom_ui.restype = None
  1483. self.lib.carla_get_buffer_size.argtypes = None
  1484. self.lib.carla_get_buffer_size.restype = c_uint32
  1485. self.lib.carla_get_sample_rate.argtypes = None
  1486. self.lib.carla_get_sample_rate.restype = c_double
  1487. self.lib.carla_get_last_error.argtypes = None
  1488. self.lib.carla_get_last_error.restype = c_char_p
  1489. self.lib.carla_get_host_osc_url_tcp.argtypes = None
  1490. self.lib.carla_get_host_osc_url_tcp.restype = c_char_p
  1491. self.lib.carla_get_host_osc_url_udp.argtypes = None
  1492. self.lib.carla_get_host_osc_url_udp.restype = c_char_p