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.

CarlaStandalone.hpp 19KB

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