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.

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