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.

760 lines
20KB

  1. /*
  2. * Carla Host API
  3. * Copyright (C) 2011-2013 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_HOST_H_INCLUDED
  18. #define CARLA_HOST_H_INCLUDED
  19. #include "CarlaBackend.h"
  20. #ifdef __cplusplus
  21. using CarlaBackend::BinaryType;
  22. using CarlaBackend::PluginType;
  23. using CarlaBackend::PluginCategory;
  24. using CarlaBackend::InternalParameterIndex;
  25. using CarlaBackend::EngineCallbackOpcode;
  26. using CarlaBackend::EngineOption;
  27. using CarlaBackend::EngineProcessMode;
  28. using CarlaBackend::EngineTransportMode;
  29. using CarlaBackend::EngineCallbackFunc;
  30. using CarlaBackend::ParameterData;
  31. using CarlaBackend::ParameterRanges;
  32. using CarlaBackend::MidiProgramData;
  33. using CarlaBackend::CustomData;
  34. using CarlaBackend::EngineDriverDeviceInfo;
  35. using CarlaBackend::CarlaEngine;
  36. #endif
  37. /*!
  38. * @defgroup CarlaHostAPI Carla Host API
  39. *
  40. * The Carla Host API.
  41. *
  42. * This API makes it possible to use the Carla Backend in a Host application.\n
  43. * All functions are C-compatible, making it possible to use this API in non-C++ hosts.
  44. *
  45. * None of the returned values in this API calls need to be deleted or free'd.\n
  46. * When a function fails (returns false or NULL), use carla_get_last_error() to find out what went wrong.
  47. *
  48. * @{
  49. */
  50. /*!
  51. * File callback opcodes.\n
  52. * Front-ends must always block-wait for user input.
  53. * @see FileCallbackFunc and carla_set_file_callback()
  54. */
  55. typedef enum {
  56. /*!
  57. * Debug.
  58. * This opcode is undefined and used only for testing purposes.
  59. */
  60. FILE_CALLBACK_DEBUG = 0,
  61. /*!
  62. * Open file or folder.
  63. */
  64. FILE_CALLBACK_OPEN = 1,
  65. /*!
  66. * Save file or folder.
  67. */
  68. FILE_CALLBACK_SAVE = 2
  69. } FileCallbackOpcode;
  70. /*!
  71. * File callback function.
  72. * @see FileCallbackOpcode
  73. */
  74. typedef const char* (*FileCallbackFunc)(void* ptr, FileCallbackOpcode action, bool isDir, const char* title, const char* filter);
  75. /*!
  76. * Plugin information.
  77. * @see carla_get_plugin_info()
  78. */
  79. typedef struct _CarlaPluginInfo {
  80. PluginType type;
  81. PluginCategory category;
  82. unsigned int hints;
  83. unsigned int optionsAvailable;
  84. unsigned int optionsEnabled;
  85. const char* binary;
  86. const char* name;
  87. const char* label;
  88. const char* maker;
  89. const char* copyright;
  90. const char* iconName;
  91. int patchbayClientId;
  92. long uniqueId;
  93. #ifdef __cplusplus
  94. _CarlaPluginInfo()
  95. : type(CarlaBackend::PLUGIN_NONE),
  96. category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  97. hints(0x0),
  98. optionsAvailable(0x0),
  99. optionsEnabled(0x0),
  100. binary(nullptr),
  101. name(nullptr),
  102. label(nullptr),
  103. maker(nullptr),
  104. copyright(nullptr),
  105. iconName(nullptr),
  106. patchbayClientId(0),
  107. uniqueId(0) {}
  108. ~_CarlaPluginInfo()
  109. {
  110. if (label != nullptr)
  111. {
  112. delete[] label;
  113. label = nullptr;
  114. }
  115. if (maker != nullptr)
  116. {
  117. delete[] maker;
  118. maker = nullptr;
  119. }
  120. if (copyright != nullptr)
  121. {
  122. delete[] copyright;
  123. copyright = nullptr;
  124. }
  125. }
  126. #endif
  127. } CarlaPluginInfo;
  128. /*!
  129. * Native plugin information.
  130. * @see carla_get_internal_plugin_info()
  131. */
  132. typedef struct _CarlaNativePluginInfo {
  133. PluginCategory category;
  134. unsigned int hints;
  135. uint32_t audioIns;
  136. uint32_t audioOuts;
  137. uint32_t midiIns;
  138. uint32_t midiOuts;
  139. uint32_t parameterIns;
  140. uint32_t parameterOuts;
  141. const char* name;
  142. const char* label;
  143. const char* maker;
  144. const char* copyright;
  145. #ifdef __cplusplus
  146. _CarlaNativePluginInfo()
  147. : category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  148. hints(0x0),
  149. audioIns(0),
  150. audioOuts(0),
  151. midiIns(0),
  152. midiOuts(0),
  153. parameterIns(0),
  154. parameterOuts(0),
  155. name(nullptr),
  156. label(nullptr),
  157. maker(nullptr),
  158. copyright(nullptr) {}
  159. #endif
  160. } CarlaNativePluginInfo;
  161. /*!
  162. * Port count information, used for Audio and MIDI ports and parameters.
  163. * @see carla_get_audio_port_count_info()
  164. * @see carla_get_midi_port_count_info()
  165. * @see carla_get_parameter_count_info()
  166. */
  167. typedef struct _CarlaPortCountInfo {
  168. uint32_t ins;
  169. uint32_t outs;
  170. uint32_t total;
  171. #ifdef __cplusplus
  172. _CarlaPortCountInfo()
  173. : ins(0),
  174. outs(0),
  175. total(0) {}
  176. #endif
  177. } CarlaPortCountInfo;
  178. /*!
  179. * Parameter information.
  180. * @see carla_get_parameter_info()
  181. */
  182. typedef struct _CarlaParameterInfo {
  183. const char* name;
  184. const char* symbol;
  185. const char* unit;
  186. uint32_t scalePointCount;
  187. #ifdef __cplusplus
  188. _CarlaParameterInfo()
  189. : name(nullptr),
  190. symbol(nullptr),
  191. unit(nullptr),
  192. scalePointCount(0) {}
  193. ~_CarlaParameterInfo()
  194. {
  195. if (name != nullptr)
  196. {
  197. delete[] name;
  198. name = nullptr;
  199. }
  200. if (symbol != nullptr)
  201. {
  202. delete[] symbol;
  203. symbol = nullptr;
  204. }
  205. if (unit != nullptr)
  206. {
  207. delete[] unit;
  208. unit = nullptr;
  209. }
  210. }
  211. #endif
  212. } CarlaParameterInfo;
  213. /*!
  214. * Parameter scale point information.
  215. * @see carla_get_parameter_scalepoint_info()
  216. */
  217. typedef struct _CarlaScalePointInfo {
  218. float value;
  219. const char* label;
  220. #ifdef __cplusplus
  221. _CarlaScalePointInfo()
  222. : value(0.0f),
  223. label(nullptr) {}
  224. ~_CarlaScalePointInfo()
  225. {
  226. if (label != nullptr)
  227. {
  228. delete[] label;
  229. label = nullptr;
  230. }
  231. }
  232. #endif
  233. } CarlaScalePointInfo;
  234. /*!
  235. * Transport information.
  236. * @see carla_get_transport_info()
  237. */
  238. typedef struct _CarlaTransportInfo {
  239. bool playing;
  240. uint64_t frame;
  241. int32_t bar;
  242. int32_t beat;
  243. int32_t tick;
  244. double bpm;
  245. #ifdef __cplusplus
  246. _CarlaTransportInfo()
  247. : playing(false),
  248. frame(0),
  249. bar(0),
  250. beat(0),
  251. tick(0),
  252. bpm(0.0) {}
  253. #endif
  254. } CarlaTransportInfo;
  255. /*!
  256. * Get the complete license text of used third-party code and features.\n
  257. * Returned string is in basic html format.
  258. */
  259. CARLA_EXPORT const char* carla_get_extended_license_text();
  260. /*!
  261. * Get the supported file types in carla_load_filename().\n
  262. * Returned string uses this syntax:
  263. * \code
  264. * "*.ext1;*.ext2;*.ext3"
  265. * \endcode
  266. */
  267. CARLA_EXPORT const char* carla_get_supported_file_types();
  268. /*!
  269. * Get how many engine drivers are available to use.
  270. */
  271. CARLA_EXPORT unsigned int carla_get_engine_driver_count();
  272. /*!
  273. * Get the engine driver info for \a index.
  274. */
  275. CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
  276. /*!
  277. * Get the device names of the engine driver at \a index.
  278. */
  279. CARLA_EXPORT const char* const* carla_get_engine_driver_device_names(unsigned int index);
  280. /*!
  281. * Get a device driver info.
  282. */
  283. CARLA_EXPORT const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(unsigned int index, const char* driverName);
  284. /*!
  285. * Get how many internal plugins are available to use.
  286. */
  287. CARLA_EXPORT unsigned int carla_get_internal_plugin_count();
  288. /*!
  289. * Get information about the internal plugin \a internalPluginId.
  290. */
  291. CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId);
  292. #ifdef __cplusplus
  293. /*!
  294. * TODO.
  295. */
  296. CARLA_EXPORT CarlaEngine* carla_get_standalone_engine();
  297. #endif
  298. /*!
  299. * Initialize the engine with driver \a driverName, using \a clientName for its internal name.\n
  300. * Make sure to call carla_engine_idle() at regular intervals afterwards.
  301. */
  302. CARLA_EXPORT bool carla_engine_init(const char* driverName, const char* clientName);
  303. #ifdef BUILD_BRIDGE
  304. /*!
  305. * Initialize the engine in bridged mode.
  306. */
  307. CARLA_EXPORT bool carla_engine_init_bridge(const char* audioBaseName, const char* controlBaseName, const char* clientName);
  308. #endif
  309. /*!
  310. * Close the running engine.\n
  311. * This function always closes the engine even if it returns false.\n
  312. * When false is returned, something went wrong when closing the engine, but it was still closed nonetheless.
  313. */
  314. CARLA_EXPORT bool carla_engine_close();
  315. /*!
  316. * Idle the running engine.\n
  317. * \note This should never be called if the engine is not running.
  318. */
  319. CARLA_EXPORT void carla_engine_idle();
  320. /*!
  321. * Check if the engine is running.
  322. */
  323. CARLA_EXPORT bool carla_is_engine_running();
  324. /*!
  325. * Tell the engine it's about to close.\n
  326. * This is used to prevent the engine thread(s) from reactivating.
  327. */
  328. CARLA_EXPORT void carla_set_engine_about_to_close();
  329. /*!
  330. * Set the engine callback function to \a func.
  331. * Use \a ptr to pass a custom pointer to the callback.
  332. */
  333. CARLA_EXPORT void carla_set_engine_callback(EngineCallbackFunc func, void* ptr);
  334. /*!
  335. * Set the engine option \a option.\n
  336. * With the exception of OPTION_PROCESS_NAME, OPTION_TRANSPORT_MODE and OPTION_PATH_*,
  337. * this function should not be called when the engine is running.
  338. */
  339. CARLA_EXPORT void carla_set_engine_option(EngineOption option, int value, const char* valueStr);
  340. /*!
  341. * Set the file callback function to \a func.
  342. * Use \a ptr to pass a custom pointer to the callback.
  343. */
  344. CARLA_EXPORT void carla_set_file_callback(FileCallbackFunc func, void* ptr);
  345. /*!
  346. * Load \a filename of any type.\n
  347. * This will try to load a generic file as a plugin,
  348. * either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI).
  349. * @see carla_get_supported_file_types()
  350. */
  351. CARLA_EXPORT bool carla_load_filename(const char* filename);
  352. /*!
  353. * Load \a filename project file.\n
  354. * (project files have *.carxp extension)
  355. * \note Already loaded plugins are not removed; call carla_remove_all_plugins() first if needed.
  356. */
  357. CARLA_EXPORT bool carla_load_project(const char* filename);
  358. /*!
  359. * Save current project to \a filename.\n
  360. * (project files have *.carxp extension)
  361. */
  362. CARLA_EXPORT bool carla_save_project(const char* filename);
  363. /*!
  364. * Connect patchbay ports \a portA and \a portB.
  365. */
  366. CARLA_EXPORT bool carla_patchbay_connect(int portA, int portB);
  367. /*!
  368. * Disconnect patchbay connection \a connectionId.
  369. */
  370. CARLA_EXPORT bool carla_patchbay_disconnect(int connectionId);
  371. /*!
  372. * Force the engine to resend all patchbay clients, ports and connections again.
  373. */
  374. CARLA_EXPORT bool carla_patchbay_refresh();
  375. /*!
  376. * Start playback of the engine transport.
  377. */
  378. CARLA_EXPORT void carla_transport_play();
  379. /*!
  380. * Pause the engine transport.
  381. */
  382. CARLA_EXPORT void carla_transport_pause();
  383. /*!
  384. * Relocate the engine transport to \a frames.
  385. */
  386. CARLA_EXPORT void carla_transport_relocate(uint32_t frames);
  387. /*!
  388. * Get the current transport frame.
  389. */
  390. CARLA_EXPORT uint64_t carla_get_current_transport_frame();
  391. /*!
  392. * Get the engine transport information.
  393. */
  394. CARLA_EXPORT const CarlaTransportInfo* carla_get_transport_info();
  395. /*!
  396. * Add new plugin.\n
  397. * If you don't know the binary type, use BINARY_NATIVE.
  398. */
  399. CARLA_EXPORT bool carla_add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, const void* extraPtr);
  400. /*!
  401. * Remove plugin with id \a pluginId.
  402. */
  403. CARLA_EXPORT bool carla_remove_plugin(unsigned int pluginId);
  404. /*!
  405. * Remove all plugins.
  406. */
  407. CARLA_EXPORT bool carla_remove_all_plugins();
  408. /*!
  409. * Rename plugin with id \a pluginId to \a newName. \n
  410. * Returns the new name, or NULL if the operation failed.
  411. */
  412. CARLA_EXPORT const char* carla_rename_plugin(unsigned int pluginId, const char* newName);
  413. /*!
  414. * Clone plugin with id \a pluginId.
  415. */
  416. CARLA_EXPORT bool carla_clone_plugin(unsigned int pluginId);
  417. /*!
  418. * Prepare replace of plugin with id \a pluginId. \n
  419. * The next call to carla_add_plugin() will use this id, replacing the current plugin.
  420. * \note This function requires carla_add_plugin() to be called afterwards as soon as possible.
  421. */
  422. CARLA_EXPORT bool carla_replace_plugin(unsigned int pluginId);
  423. /*!
  424. * Switch plugins with id \a pluginIdA and \a pluginIdB.
  425. */
  426. CARLA_EXPORT bool carla_switch_plugins(unsigned int pluginIdA, unsigned int pluginIdB);
  427. /*!
  428. * Load the plugin state at \a filename.\n
  429. * (Plugin states have *.carxs extension).
  430. * @see carla_save_plugin_state()
  431. */
  432. CARLA_EXPORT bool carla_load_plugin_state(unsigned int pluginId, const char* filename);
  433. /*!
  434. * Load the plugin state at \a filename.\n
  435. * (Plugin states have *.carxs extension).
  436. * @see carla_load_plugin_state()
  437. */
  438. CARLA_EXPORT bool carla_save_plugin_state(unsigned int pluginId, const char* filename);
  439. /*!
  440. * Get a plugin's information.
  441. */
  442. CARLA_EXPORT const CarlaPluginInfo* carla_get_plugin_info(unsigned int pluginId);
  443. /*!
  444. * Get a plugin's audio port count information.
  445. */
  446. CARLA_EXPORT const CarlaPortCountInfo* carla_get_audio_port_count_info(unsigned int pluginId);
  447. /*!
  448. * Get a plugin's midi port count information.
  449. */
  450. CARLA_EXPORT const CarlaPortCountInfo* carla_get_midi_port_count_info(unsigned int pluginId);
  451. /*!
  452. * Get a plugin's parameter count information.
  453. */
  454. CARLA_EXPORT const CarlaPortCountInfo* carla_get_parameter_count_info(unsigned int pluginId);
  455. /*!
  456. * * Get a plugin's parameter information.
  457. */
  458. CARLA_EXPORT const CarlaParameterInfo* carla_get_parameter_info(unsigned int pluginId, uint32_t parameterId);
  459. /*!
  460. * Get a plugin's parameter scale point information.
  461. */
  462. CARLA_EXPORT const CarlaScalePointInfo* carla_get_parameter_scalepoint_info(unsigned int pluginId, uint32_t parameterId, uint32_t scalePointId);
  463. /*!
  464. * Get a plugin's parameter data.
  465. */
  466. CARLA_EXPORT const ParameterData* carla_get_parameter_data(unsigned int pluginId, uint32_t parameterId);
  467. /*!
  468. * Get a plugin's parameter ranges.
  469. */
  470. CARLA_EXPORT const ParameterRanges* carla_get_parameter_ranges(unsigned int pluginId, uint32_t parameterId);
  471. /*!
  472. * Get a plugin's midi program data.
  473. */
  474. CARLA_EXPORT const MidiProgramData* carla_get_midi_program_data(unsigned int pluginId, uint32_t midiProgramId);
  475. /*!
  476. * Get a plugin's custom data.
  477. */
  478. CARLA_EXPORT const CustomData* carla_get_custom_data(unsigned int pluginId, uint32_t customDataId);
  479. /*!
  480. * Get a plugin's chunk data.
  481. */
  482. CARLA_EXPORT const char* carla_get_chunk_data(unsigned int pluginId);
  483. /*!
  484. * Get how many parameters a plugin has.
  485. */
  486. CARLA_EXPORT uint32_t carla_get_parameter_count(unsigned int pluginId);
  487. /*!
  488. * Get how many programs a plugin has.
  489. */
  490. CARLA_EXPORT uint32_t carla_get_program_count(unsigned int pluginId);
  491. /*!
  492. * Get how many midi programs a plugin has.
  493. */
  494. CARLA_EXPORT uint32_t carla_get_midi_program_count(unsigned int pluginId);
  495. /*!
  496. * Get how many custom data sets a plugin has.
  497. * @see carla_prepare_for_save()
  498. */
  499. CARLA_EXPORT uint32_t carla_get_custom_data_count(unsigned int pluginId);
  500. /*!
  501. * Get a plugin's custom parameter text display.
  502. * @see PARAMETER_USES_CUSTOM_TEXT
  503. */
  504. CARLA_EXPORT const char* carla_get_parameter_text(unsigned int pluginId, uint32_t parameterId);
  505. /*!
  506. * Get a plugin's program name.
  507. */
  508. CARLA_EXPORT const char* carla_get_program_name(unsigned int pluginId, uint32_t programId);
  509. /*!
  510. * Get a plugin's midi program name.
  511. */
  512. CARLA_EXPORT const char* carla_get_midi_program_name(unsigned int pluginId, uint32_t midiProgramId);
  513. /*!
  514. * Get the plugin's real name.\n
  515. * This is the name the plugin uses to identify itself; may not be unique.
  516. */
  517. CARLA_EXPORT const char* carla_get_real_plugin_name(unsigned int pluginId);
  518. /*!
  519. * Get the current plugin's program index.
  520. */
  521. CARLA_EXPORT int32_t carla_get_current_program_index(unsigned int pluginId);
  522. /*!
  523. * Get the current plugin's midi program index.
  524. */
  525. CARLA_EXPORT int32_t carla_get_current_midi_program_index(unsigned int pluginId);
  526. /*!
  527. * Get a plugin's default parameter value.
  528. */
  529. CARLA_EXPORT float carla_get_default_parameter_value(unsigned int pluginId, uint32_t parameterId);
  530. /*!
  531. * Get a plugin's current parameter value.
  532. */
  533. CARLA_EXPORT float carla_get_current_parameter_value(unsigned int pluginId, uint32_t parameterId);
  534. /*!
  535. * Get a plugin's input peak value.\n
  536. * \a portId must only be either 1 or 2
  537. */
  538. CARLA_EXPORT float carla_get_input_peak_value(unsigned int pluginId, unsigned short portId);
  539. /*!
  540. * Get a plugin's output peak value.\n
  541. * \a portId must only be either 1 or 2
  542. */
  543. CARLA_EXPORT float carla_get_output_peak_value(unsigned int pluginId, unsigned short portId);
  544. /*!
  545. * Enable a plugin's option.
  546. * @see PluginOptions
  547. */
  548. CARLA_EXPORT void carla_set_option(unsigned int pluginId, unsigned int option, bool yesNo);
  549. /*!
  550. * Enable or disable a plugin according to \a onOff.
  551. */
  552. CARLA_EXPORT void carla_set_active(unsigned int pluginId, bool onOff);
  553. #ifndef BUILD_BRIDGE
  554. /*!
  555. * Change a plugin's internal drywet value to \a value.
  556. */
  557. CARLA_EXPORT void carla_set_drywet(unsigned int pluginId, float value);
  558. /*!
  559. * Change a plugin's internal volume value to \a value.
  560. */
  561. CARLA_EXPORT void carla_set_volume(unsigned int pluginId, float value);
  562. /*!
  563. * Change a plugin's internal balance-left value to \a value.
  564. */
  565. CARLA_EXPORT void carla_set_balance_left(unsigned int pluginId, float value);
  566. /*!
  567. * Change a plugin's internal balance-right value to \a value.
  568. */
  569. CARLA_EXPORT void carla_set_balance_right(unsigned int pluginId, float value);
  570. /*!
  571. * Change a plugin's internal panning value to \a value.
  572. */
  573. CARLA_EXPORT void carla_set_panning(unsigned int pluginId, float value);
  574. #endif
  575. /*!
  576. * Change a plugin's internal control channel to \a channel.
  577. */
  578. CARLA_EXPORT void carla_set_ctrl_channel(unsigned int pluginId, int8_t channel);
  579. /*!
  580. * Set the plugin's parameter \a parameterId to \a value.
  581. */
  582. CARLA_EXPORT void carla_set_parameter_value(unsigned int pluginId, uint32_t parameterId, float value);
  583. #ifndef BUILD_BRIDGE
  584. /*!
  585. * Set the plugin's parameter \a parameterId midi channel to \a channel.
  586. */
  587. CARLA_EXPORT void carla_set_parameter_midi_channel(unsigned int pluginId, uint32_t parameterId, uint8_t channel);
  588. /*!
  589. * Set the plugin's parameter \a parameterId midi cc to \a cc.
  590. */
  591. CARLA_EXPORT void carla_set_parameter_midi_cc(unsigned int pluginId, uint32_t parameterId, int16_t cc);
  592. #endif
  593. /*!
  594. * Change a plugin's program to \a programId.
  595. */
  596. CARLA_EXPORT void carla_set_program(unsigned int pluginId, uint32_t programId);
  597. /*!
  598. * Change a plugin's midi program to \a midiProgramId.
  599. */
  600. CARLA_EXPORT void carla_set_midi_program(unsigned int pluginId, uint32_t midiProgramId);
  601. /*!
  602. * Set a plugin's custom data set.
  603. */
  604. CARLA_EXPORT void carla_set_custom_data(unsigned int pluginId, const char* type, const char* key, const char* value);
  605. /*!
  606. * Set a plugin's chunk data.
  607. */
  608. CARLA_EXPORT void carla_set_chunk_data(unsigned int pluginId, const char* chunkData);
  609. /*!
  610. * Tell a plugin to prepare for save.\n
  611. * This should be called before carla_get_custom_data_count().
  612. */
  613. CARLA_EXPORT void carla_prepare_for_save(unsigned int pluginId);
  614. #ifndef BUILD_BRIDGE
  615. /*!
  616. * Send a single note of a plugin.\n
  617. * If \a note if 0, note-off is sent; note-on otherwise.
  618. */
  619. CARLA_EXPORT void carla_send_midi_note(unsigned int pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  620. #endif
  621. /*!
  622. * Tell a plugin to show its own custom UI.
  623. * @see PLUGIN_HAS_CUSTOM_UI
  624. */
  625. CARLA_EXPORT void carla_show_custom_ui(unsigned int pluginId, bool yesNo);
  626. /*!
  627. * Get the current engine buffer size.
  628. */
  629. CARLA_EXPORT uint32_t carla_get_buffer_size();
  630. /*!
  631. * Get the current engine sample rate.
  632. */
  633. CARLA_EXPORT double carla_get_sample_rate();
  634. /*!
  635. * Get the last error.
  636. */
  637. CARLA_EXPORT const char* carla_get_last_error();
  638. /*!
  639. * Get the current engine OSC URL (TCP).
  640. */
  641. CARLA_EXPORT const char* carla_get_host_osc_url_tcp();
  642. /*!
  643. * Get the current engine OSC URL (UDP).
  644. */
  645. CARLA_EXPORT const char* carla_get_host_osc_url_udp();
  646. /** @} */
  647. #endif // CARLA_HOST_H_INCLUDED