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.

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