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.

959 lines
23KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2014 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::FileCallbackOpcode;
  30. using CarlaBackend::EngineCallbackFunc;
  31. using CarlaBackend::FileCallbackFunc;
  32. using CarlaBackend::ParameterData;
  33. using CarlaBackend::ParameterRanges;
  34. using CarlaBackend::MidiProgramData;
  35. using CarlaBackend::CustomData;
  36. using CarlaBackend::EngineDriverDeviceInfo;
  37. using CarlaBackend::CarlaEngine;
  38. using CarlaBackend::CarlaPlugin;
  39. #endif
  40. /*!
  41. * @defgroup CarlaHostAPI Carla Host API
  42. *
  43. * The Carla Host API.
  44. *
  45. * This API makes it possible to use the Carla Backend in a standalone host application..
  46. *
  47. * None of the returned values in this API calls need to be deleted or free'd.\n
  48. * When a function fails (returns false or NULL), use carla_get_last_error() to find out what went wrong.
  49. * @{
  50. */
  51. /* ------------------------------------------------------------------------------------------------------------
  52. * Carla Host API (C stuff) */
  53. /*!
  54. * Information about a loaded plugin.
  55. * @see carla_get_plugin_info()
  56. */
  57. typedef struct _CarlaPluginInfo {
  58. /*!
  59. * Plugin type.
  60. */
  61. PluginType type;
  62. /*!
  63. * Plugin category.
  64. */
  65. PluginCategory category;
  66. /*!
  67. * Plugin hints.
  68. * @see PluginHints
  69. */
  70. unsigned int hints;
  71. /*!
  72. * Plugin options available for the user to change.
  73. * @see PluginOptions
  74. */
  75. unsigned int optionsAvailable;
  76. /*!
  77. * Plugin options currently enabled.\n
  78. * Some options are enabled but not available, which means they will always be on.
  79. * @see PluginOptions
  80. */
  81. unsigned int optionsEnabled;
  82. /*!
  83. * Plugin filename.\n
  84. * This can be the plugin binary or resource file.
  85. */
  86. const char* filename;
  87. /*!
  88. * Plugin name.\n
  89. * This name is unique within a Carla instance.
  90. * @see carla_get_real_plugin_name()
  91. */
  92. const char* name;
  93. /*!
  94. * Plugin label or URI.
  95. */
  96. const char* label;
  97. /*!
  98. * Plugin author/maker.
  99. */
  100. const char* maker;
  101. /*!
  102. * Plugin copyright/license.
  103. */
  104. const char* copyright;
  105. /*!
  106. * Icon name for this plugin, in lowercase.\n
  107. * Default is "plugin".
  108. */
  109. const char* iconName;
  110. /*!
  111. * Plugin unique Id.\n
  112. * This Id is dependant on the plugin type and may sometimes be 0.
  113. */
  114. int64_t uniqueId;
  115. #ifdef __cplusplus
  116. /*!
  117. * C++ constructor.
  118. */
  119. _CarlaPluginInfo() noexcept;
  120. ~_CarlaPluginInfo() noexcept;
  121. #endif
  122. } CarlaPluginInfo;
  123. /*!
  124. * Information about an internal Carla plugin.
  125. * @see carla_get_internal_plugin_info()
  126. */
  127. typedef struct _CarlaNativePluginInfo {
  128. /*!
  129. * Plugin category.
  130. */
  131. PluginCategory category;
  132. /*!
  133. * Plugin hints.
  134. * @see PluginHints
  135. */
  136. unsigned int hints;
  137. /*!
  138. * Number of audio inputs.
  139. */
  140. uint32_t audioIns;
  141. /*!
  142. * Number of audio outputs.
  143. */
  144. uint32_t audioOuts;
  145. /*!
  146. * Number of MIDI inputs.
  147. */
  148. uint32_t midiIns;
  149. /*!
  150. * Number of MIDI outputs.
  151. */
  152. uint32_t midiOuts;
  153. /*!
  154. * Number of input parameters.
  155. */
  156. uint32_t parameterIns;
  157. /*!
  158. * Number of output parameters.
  159. */
  160. uint32_t parameterOuts;
  161. /*!
  162. * Plugin name.
  163. */
  164. const char* name;
  165. /*!
  166. * Plugin label.
  167. */
  168. const char* label;
  169. /*!
  170. * Plugin author/maker.
  171. */
  172. const char* maker;
  173. /*!
  174. * Plugin copyright/license.
  175. */
  176. const char* copyright;
  177. #ifdef __cplusplus
  178. /*!
  179. * C++ constructor.
  180. */
  181. _CarlaNativePluginInfo() noexcept;
  182. #endif
  183. } CarlaNativePluginInfo;
  184. /*!
  185. * Port count information, used for Audio and MIDI ports and parameters.
  186. * @see carla_get_audio_port_count_info()
  187. * @see carla_get_midi_port_count_info()
  188. * @see carla_get_parameter_count_info()
  189. */
  190. typedef struct _CarlaPortCountInfo {
  191. /*!
  192. * Number of inputs.
  193. */
  194. uint32_t ins;
  195. /*!
  196. * Number of outputs.
  197. */
  198. uint32_t outs;
  199. } CarlaPortCountInfo;
  200. /*!
  201. * Parameter information.
  202. * @see carla_get_parameter_info()
  203. */
  204. typedef struct _CarlaParameterInfo {
  205. /*!
  206. * Parameter name.
  207. */
  208. const char* name;
  209. /*!
  210. * Parameter symbol.
  211. */
  212. const char* symbol;
  213. /*!
  214. * Parameter unit.
  215. */
  216. const char* unit;
  217. /*!
  218. * Number of scale points.
  219. * @see CarlaScalePointInfo
  220. */
  221. uint32_t scalePointCount;
  222. #ifdef __cplusplus
  223. /*!
  224. * C++ constructor.
  225. */
  226. _CarlaParameterInfo() noexcept;
  227. ~_CarlaParameterInfo() noexcept;
  228. #endif
  229. } CarlaParameterInfo;
  230. /*!
  231. * Parameter scale point information.
  232. * @see carla_get_parameter_scalepoint_info()
  233. */
  234. typedef struct _CarlaScalePointInfo {
  235. /*!
  236. * Scale point value.
  237. */
  238. float value;
  239. /*!
  240. * Scale point label.
  241. */
  242. const char* label;
  243. #ifdef __cplusplus
  244. /*!
  245. * C++ constructor.
  246. */
  247. _CarlaScalePointInfo() noexcept;
  248. ~_CarlaScalePointInfo() noexcept;
  249. #endif
  250. } CarlaScalePointInfo;
  251. /*!
  252. * Transport information.
  253. * @see carla_get_transport_info()
  254. */
  255. typedef struct _CarlaTransportInfo {
  256. /*!
  257. * Wherever transport is playing.
  258. */
  259. bool playing;
  260. /*!
  261. * Current transport frame.
  262. */
  263. uint64_t frame;
  264. /*!
  265. * Bar.
  266. */
  267. int32_t bar;
  268. /*!
  269. * Beat.
  270. */
  271. int32_t beat;
  272. /*!
  273. * Tick.
  274. */
  275. int32_t tick;
  276. /*!
  277. * Beats per minute.
  278. */
  279. double bpm;
  280. #ifdef __cplusplus
  281. /*!
  282. * C++ constructor.
  283. */
  284. _CarlaTransportInfo() noexcept;
  285. #endif
  286. } CarlaTransportInfo;
  287. /* ------------------------------------------------------------------------------------------------------------
  288. * Carla Host API (C functions) */
  289. /*!
  290. * Get the complete license text of used third-party code and features.\n
  291. * Returned string is in basic html format.
  292. */
  293. CARLA_EXPORT const char* carla_get_complete_license_text();
  294. /*!
  295. * Get all the supported file extensions in carla_load_file().\n
  296. * Returned string uses this syntax:
  297. * @code
  298. * "*.ext1;*.ext2;*.ext3"
  299. * @endcode
  300. */
  301. CARLA_EXPORT const char* carla_get_supported_file_extensions();
  302. /*!
  303. * Get how many engine drivers are available.
  304. */
  305. CARLA_EXPORT unsigned int carla_get_engine_driver_count();
  306. /*!
  307. * Get an engine driver name.
  308. * @param index Driver index
  309. */
  310. CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
  311. /*!
  312. * Get the device names of an engine driver.
  313. * @param index Driver index
  314. */
  315. CARLA_EXPORT const char* const* carla_get_engine_driver_device_names(unsigned int index);
  316. /*!
  317. * Get information about a device driver.
  318. * @param index Driver index
  319. * @param name Device name
  320. */
  321. CARLA_EXPORT const EngineDriverDeviceInfo* carla_get_engine_driver_device_info(unsigned int index, const char* name);
  322. /*!
  323. * Get how many internal plugins are available.
  324. */
  325. CARLA_EXPORT unsigned int carla_get_internal_plugin_count();
  326. /*!
  327. * Get information about an internal plugin.
  328. * @param index Internal plugin Id
  329. */
  330. CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int index);
  331. #ifdef __cplusplus
  332. /*!
  333. * Get the currently used engine, maybe be NULL.
  334. * @note C++ only
  335. */
  336. CARLA_EXPORT const CarlaEngine* carla_get_engine();
  337. #endif
  338. /*!
  339. * Initialize the engine.\n
  340. * Make sure to call carla_engine_idle() at regular intervals afterwards.
  341. * @param driverName Driver to use
  342. * @param clientName Engine master client name
  343. */
  344. CARLA_EXPORT bool carla_engine_init(const char* driverName, const char* clientName);
  345. #ifdef BUILD_BRIDGE
  346. /*!
  347. * Initialize the engine in bridged mode.
  348. * @param audioBaseName Shared memory key for audio pool
  349. * @param controlBaseName Shared memory key for control messages
  350. * @param timeBaseName Shared memory key for time info
  351. * @param clientName Engine master client name
  352. */
  353. CARLA_EXPORT bool carla_engine_init_bridge(const char audioBaseName[6+1], const char controlBaseName[6+1], const char timeBaseName[6+1], const char* clientName);
  354. #endif
  355. /*!
  356. * Close the engine.\n
  357. * This function always closes the engine even if it returns false.\n
  358. * In other words, even when something goes wrong when closing the engine it still be closed nonetheless.
  359. */
  360. CARLA_EXPORT bool carla_engine_close();
  361. /*!
  362. * Idle the engine.\n
  363. * Do not call this if the engine is not running.
  364. */
  365. CARLA_EXPORT void carla_engine_idle();
  366. /*!
  367. * Check if the engine is running.
  368. */
  369. CARLA_EXPORT bool carla_is_engine_running();
  370. /*!
  371. * Tell the engine it's about to close.\n
  372. * This is used to prevent the engine thread(s) from reactivating.
  373. */
  374. CARLA_EXPORT void carla_set_engine_about_to_close();
  375. /*!
  376. * Set the engine callback function.
  377. * @param func Callback function
  378. * @param ptr Callback pointer
  379. */
  380. CARLA_EXPORT void carla_set_engine_callback(EngineCallbackFunc func, void* ptr);
  381. #ifndef BUILD_BRIDGE
  382. /*!
  383. * Set an engine option.
  384. * @param option Option
  385. * @param value Value as number
  386. * @param valueStr Value as string
  387. */
  388. CARLA_EXPORT void carla_set_engine_option(EngineOption option, int value, const char* valueStr);
  389. #endif
  390. /*!
  391. * Set the file callback function.
  392. * @param func Callback function
  393. * @param ptr Callback pointer
  394. */
  395. CARLA_EXPORT void carla_set_file_callback(FileCallbackFunc func, void* ptr);
  396. /*!
  397. * Load a file of any type.\n
  398. * This will try to load a generic file as a plugin,
  399. * either by direct handling (Csound, GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI).
  400. * @param Filename Filename
  401. * @see carla_get_supported_file_extensions()
  402. */
  403. CARLA_EXPORT bool carla_load_file(const char* filename);
  404. /*!
  405. * Load a Carla project file.
  406. * @param Filename Filename
  407. * @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed.
  408. */
  409. CARLA_EXPORT bool carla_load_project(const char* filename);
  410. /*!
  411. * Save current project to a file.
  412. * @param Filename Filename
  413. */
  414. CARLA_EXPORT bool carla_save_project(const char* filename);
  415. #ifndef BUILD_BRIDGE
  416. /*!
  417. * Connect two patchbay ports.
  418. * @param portIdA Output port
  419. * @param portIdB Input port
  420. * @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED
  421. */
  422. CARLA_EXPORT bool carla_patchbay_connect(int portIdA, int portIdB);
  423. /*!
  424. * Disconnect two patchbay ports.
  425. * @param connectionId Connection Id
  426. * @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED
  427. */
  428. CARLA_EXPORT bool carla_patchbay_disconnect(uint connectionId);
  429. /*!
  430. * Force the engine to resend all patchbay clients, ports and connections again.
  431. */
  432. CARLA_EXPORT bool carla_patchbay_refresh();
  433. #endif
  434. /*!
  435. * Start playback of the engine transport.
  436. */
  437. CARLA_EXPORT void carla_transport_play();
  438. /*!
  439. * Pause the engine transport.
  440. */
  441. CARLA_EXPORT void carla_transport_pause();
  442. /*!
  443. * Relocate the engine transport to a specific frame.
  444. * @param frames Frame to relocate to.
  445. */
  446. CARLA_EXPORT void carla_transport_relocate(uint64_t frame);
  447. /*!
  448. * Get the current transport frame.
  449. */
  450. CARLA_EXPORT uint64_t carla_get_current_transport_frame();
  451. /*!
  452. * Get the engine transport information.
  453. */
  454. CARLA_EXPORT const CarlaTransportInfo* carla_get_transport_info();
  455. /*!
  456. * Add a new plugin.\n
  457. * If you don't know the binary type use the BINARY_NATIVE macro.
  458. * @param btype Binary type
  459. * @param ptype Plugin type
  460. * @param filename Filename, if applicable
  461. * @param name Name of the plugin, can be NULL
  462. * @param label Plugin label, if applicable
  463. * @param uniqueId Plugin unique Id, if applicable
  464. * @param extraPtr Extra pointer, defined per plugin type
  465. */
  466. CARLA_EXPORT bool carla_add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, int64_t uniqueId, const void* extraPtr);
  467. /*!
  468. * Remove one plugin.
  469. * @param pluginId Plugin to remove.
  470. */
  471. CARLA_EXPORT bool carla_remove_plugin(uint pluginId);
  472. /*!
  473. * Remove all plugins.
  474. */
  475. CARLA_EXPORT bool carla_remove_all_plugins();
  476. /*!
  477. * Rename a plugin.\n
  478. * Returns the new name, or NULL if the operation failed.
  479. * @param pluginId Plugin to rename
  480. * @param newName New plugin name
  481. */
  482. CARLA_EXPORT const char* carla_rename_plugin(uint pluginId, const char* newName);
  483. /*!
  484. * Clone a plugin.
  485. * @param pluginId Plugin to clone
  486. */
  487. CARLA_EXPORT bool carla_clone_plugin(uint pluginId);
  488. /*!
  489. * Prepare replace of a plugin.\n
  490. * The next call to carla_add_plugin() will use this id, replacing the current plugin.
  491. * @param pluginId Plugin to replace
  492. * @note This function requires carla_add_plugin() to be called afterwards *as soon as possible*.
  493. */
  494. CARLA_EXPORT bool carla_replace_plugin(uint pluginId);
  495. /*!
  496. * Switch two plugins positions.
  497. * @param pluginIdA Plugin A
  498. * @param pluginIdB Plugin B
  499. */
  500. CARLA_EXPORT bool carla_switch_plugins(uint pluginIdA, uint pluginIdB);
  501. /*!
  502. * Load a plugin state.
  503. * @param pluginId Plugin
  504. * @param filename Path to plugin state
  505. * @see carla_save_plugin_state()
  506. */
  507. CARLA_EXPORT bool carla_load_plugin_state(uint pluginId, const char* filename);
  508. /*!
  509. * Save a plugin state.
  510. * @param pluginId Plugin
  511. * @param filename Path to plugin state
  512. * @see carla_load_plugin_state()
  513. */
  514. CARLA_EXPORT bool carla_save_plugin_state(uint pluginId, const char* filename);
  515. /*!
  516. * Get information from a plugin.
  517. * @param pluginId Plugin
  518. */
  519. CARLA_EXPORT const CarlaPluginInfo* carla_get_plugin_info(uint pluginId);
  520. /*!
  521. * Get audio port count information from a plugin.
  522. * @param pluginId Plugin
  523. */
  524. CARLA_EXPORT const CarlaPortCountInfo* carla_get_audio_port_count_info(uint pluginId);
  525. /*!
  526. * Get MIDI port count information from a plugin.
  527. * @param pluginId Plugin
  528. */
  529. CARLA_EXPORT const CarlaPortCountInfo* carla_get_midi_port_count_info(uint pluginId);
  530. /*!
  531. * Get parameter count information from a plugin.
  532. * @param pluginId Plugin
  533. */
  534. CARLA_EXPORT const CarlaPortCountInfo* carla_get_parameter_count_info(uint pluginId);
  535. /*!
  536. * Get parameter information from a plugin.
  537. * @param pluginId Plugin
  538. * @param parameterId Parameter index
  539. * @see carla_get_parameter_count()
  540. */
  541. CARLA_EXPORT const CarlaParameterInfo* carla_get_parameter_info(uint pluginId, uint32_t parameterId);
  542. /*!
  543. * Get parameter scale point information from a plugin.
  544. * @param pluginId Plugin
  545. * @param parameterId Parameter index
  546. * @param scalePointId Parameter scale-point index
  547. * @see CarlaParameterInfo::scalePointCount
  548. */
  549. CARLA_EXPORT const CarlaScalePointInfo* carla_get_parameter_scalepoint_info(uint pluginId, uint32_t parameterId, uint32_t scalePointId);
  550. /*!
  551. * Get a plugin's parameter data.
  552. * @param pluginId Plugin
  553. * @param parameterId Parameter index
  554. * @see carla_get_parameter_count()
  555. */
  556. CARLA_EXPORT const ParameterData* carla_get_parameter_data(uint pluginId, uint32_t parameterId);
  557. /*!
  558. * Get a plugin's parameter ranges.
  559. * @param pluginId Plugin
  560. * @param parameterId Parameter index
  561. * @see carla_get_parameter_count()
  562. */
  563. CARLA_EXPORT const ParameterRanges* carla_get_parameter_ranges(uint pluginId, uint32_t parameterId);
  564. /*!
  565. * Get a plugin's MIDI program data.
  566. * @param pluginId Plugin
  567. * @param midiProgramId MIDI Program index
  568. * @see carla_get_midi_program_count()
  569. */
  570. CARLA_EXPORT const MidiProgramData* carla_get_midi_program_data(uint pluginId, uint32_t midiProgramId);
  571. /*!
  572. * Get a plugin's custom data.
  573. * @param pluginId Plugin
  574. * @param customDataId Custom data index
  575. * @see carla_get_custom_data_count()
  576. */
  577. CARLA_EXPORT const CustomData* carla_get_custom_data(uint pluginId, uint32_t customDataId);
  578. /*!
  579. * Get a plugin's chunk data.
  580. * @param pluginId Plugin
  581. * @see PLUGIN_OPTION_USE_CHUNKS and carla_set_chunk_data()
  582. */
  583. CARLA_EXPORT const char* carla_get_chunk_data(uint pluginId);
  584. /*!
  585. * Get how many parameters a plugin has.
  586. * @param pluginId Plugin
  587. */
  588. CARLA_EXPORT uint32_t carla_get_parameter_count(uint pluginId);
  589. /*!
  590. * Get how many programs a plugin has.
  591. * @param pluginId Plugin
  592. * @see carla_get_program_name()
  593. */
  594. CARLA_EXPORT uint32_t carla_get_program_count(uint pluginId);
  595. /*!
  596. * Get how many MIDI programs a plugin has.
  597. * @param pluginId Plugin
  598. * @see carla_get_midi_program_name() and carla_get_midi_program_data()
  599. */
  600. CARLA_EXPORT uint32_t carla_get_midi_program_count(uint pluginId);
  601. /*!
  602. * Get how many custom data sets a plugin has.
  603. * @param pluginId Plugin
  604. * @see carla_get_custom_data()
  605. */
  606. CARLA_EXPORT uint32_t carla_get_custom_data_count(uint pluginId);
  607. /*!
  608. * Get a plugin's parameter text (custom display of internal values).
  609. * @param pluginId Plugin
  610. * @param parameterId Parameter index
  611. * @see PARAMETER_USES_CUSTOM_TEXT
  612. */
  613. CARLA_EXPORT const char* carla_get_parameter_text(uint pluginId, uint32_t parameterId);
  614. /*!
  615. * Get a plugin's program name.
  616. * @param pluginId Plugin
  617. * @param programId Program index
  618. * @see carla_get_program_count()
  619. */
  620. CARLA_EXPORT const char* carla_get_program_name(uint pluginId, uint32_t programId);
  621. /*!
  622. * Get a plugin's MIDI program name.
  623. * @param pluginId Plugin
  624. * @param midiProgramId MIDI Program index
  625. * @see carla_get_midi_program_count()
  626. */
  627. CARLA_EXPORT const char* carla_get_midi_program_name(uint pluginId, uint32_t midiProgramId);
  628. /*!
  629. * Get a plugin's real name.\n
  630. * This is the name the plugin uses to identify itself; may not be unique.
  631. * @param pluginId Plugin
  632. */
  633. CARLA_EXPORT const char* carla_get_real_plugin_name(uint pluginId);
  634. /*!
  635. * Get a plugin's program index.
  636. * @param pluginId Plugin
  637. */
  638. CARLA_EXPORT int32_t carla_get_current_program_index(uint pluginId);
  639. /*!
  640. * Get a plugin's midi program index.
  641. * @param pluginId Plugin
  642. */
  643. CARLA_EXPORT int32_t carla_get_current_midi_program_index(uint pluginId);
  644. /*!
  645. * Get a plugin's default parameter value.
  646. * @param pluginId Plugin
  647. * @param parameterId Parameter index
  648. */
  649. CARLA_EXPORT float carla_get_default_parameter_value(uint pluginId, uint32_t parameterId);
  650. /*!
  651. * Get a plugin's current parameter value.
  652. * @param pluginId Plugin
  653. * @param parameterId Parameter index
  654. */
  655. CARLA_EXPORT float carla_get_current_parameter_value(uint pluginId, uint32_t parameterId);
  656. /*!
  657. * Get a plugin's input peak value.
  658. * @param pluginId Plugin
  659. * @param isLeft Wherever to get the left/mono value, otherwise right.
  660. */
  661. CARLA_EXPORT float carla_get_input_peak_value(uint pluginId, bool isLeft);
  662. /*!
  663. * Get a plugin's output peak value.
  664. * @param pluginId Plugin
  665. * @param isLeft Wherever to get the left/mono value, otherwise right.
  666. */
  667. CARLA_EXPORT float carla_get_output_peak_value(uint pluginId, bool isLeft);
  668. /*!
  669. * Enable a plugin's option.
  670. * @param pluginId Plugin
  671. * @param option An option from PluginOptions
  672. * @param yesNo New enabled state
  673. */
  674. CARLA_EXPORT void carla_set_option(uint pluginId, uint option, bool yesNo);
  675. /*!
  676. * Enable or disable a plugin.
  677. * @param pluginId Plugin
  678. * @param onOff New active state
  679. */
  680. CARLA_EXPORT void carla_set_active(uint pluginId, bool onOff);
  681. #ifndef BUILD_BRIDGE
  682. /*!
  683. * Change a plugin's internal dry/wet.
  684. * @param pluginId Plugin
  685. * @param value New dry/wet value
  686. */
  687. CARLA_EXPORT void carla_set_drywet(uint pluginId, float value);
  688. /*!
  689. * Change a plugin's internal volume.
  690. * @param pluginId Plugin
  691. * @param value New volume
  692. */
  693. CARLA_EXPORT void carla_set_volume(uint pluginId, float value);
  694. /*!
  695. * Change a plugin's internal stereo balance, left channel.
  696. * @param pluginId Plugin
  697. * @param value New value
  698. */
  699. CARLA_EXPORT void carla_set_balance_left(uint pluginId, float value);
  700. /*!
  701. * Change a plugin's internal stereo balance, right channel.
  702. * @param pluginId Plugin
  703. * @param value New value
  704. */
  705. CARLA_EXPORT void carla_set_balance_right(uint pluginId, float value);
  706. /*!
  707. * Change a plugin's internal mono panning value.
  708. * @param pluginId Plugin
  709. * @param value New value
  710. */
  711. CARLA_EXPORT void carla_set_panning(uint pluginId, float value);
  712. #endif
  713. /*!
  714. * Change a plugin's internal control channel.
  715. * @param pluginId Plugin
  716. * @param channel New channel
  717. */
  718. CARLA_EXPORT void carla_set_ctrl_channel(uint pluginId, int8_t channel);
  719. /*!
  720. * Change a plugin's parameter value.
  721. * @param pluginId Plugin
  722. * @param parameterId Parameter index
  723. * @param value New value
  724. */
  725. CARLA_EXPORT void carla_set_parameter_value(uint pluginId, uint32_t parameterId, float value);
  726. #ifndef BUILD_BRIDGE
  727. /*!
  728. * Change a plugin's parameter MIDI channel.
  729. * @param pluginId Plugin
  730. * @param parameterId Parameter index
  731. * @param channel New MIDI channel
  732. */
  733. CARLA_EXPORT void carla_set_parameter_midi_channel(uint pluginId, uint32_t parameterId, uint8_t channel);
  734. /*!
  735. * Change a plugin's parameter MIDI cc.
  736. * @param pluginId Plugin
  737. * @param parameterId Parameter index
  738. * @param cc New MIDI cc
  739. */
  740. CARLA_EXPORT void carla_set_parameter_midi_cc(uint pluginId, uint32_t parameterId, int16_t cc);
  741. #endif
  742. /*!
  743. * Change a plugin's current program.
  744. * @param pluginId Plugin
  745. * @param programId New program
  746. */
  747. CARLA_EXPORT void carla_set_program(uint pluginId, uint32_t programId);
  748. /*!
  749. * Change a plugin's current MIDI program.
  750. * @param pluginId Plugin
  751. * @param midiProgramId New value
  752. */
  753. CARLA_EXPORT void carla_set_midi_program(uint pluginId, uint32_t midiProgramId);
  754. /*!
  755. * Set a plugin's custom data set.
  756. * @param pluginId Plugin
  757. * @param type Type
  758. * @param key Key
  759. * @param value New value
  760. * @see CustomDataTypes and CustomDataKeys
  761. */
  762. CARLA_EXPORT void carla_set_custom_data(uint pluginId, const char* type, const char* key, const char* value);
  763. /*!
  764. * Set a plugin's chunk data.
  765. * @param pluginId Plugin
  766. * @param value New value
  767. * @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data()
  768. */
  769. CARLA_EXPORT void carla_set_chunk_data(uint pluginId, const char* chunkData);
  770. /*!
  771. * Tell a plugin to prepare for save.\n
  772. * This should be called before saving custom data sets.
  773. * @param pluginId Plugin
  774. */
  775. CARLA_EXPORT void carla_prepare_for_save(uint pluginId);
  776. #ifndef BUILD_BRIDGE
  777. /*!
  778. * Send a single note of a plugin.\n
  779. * If velocity is 0, note-off is sent; note-on otherwise.
  780. * @param pluginId Plugin
  781. * @param channel Note channel
  782. * @param note Note pitch
  783. * @param velocity Note velocity
  784. */
  785. CARLA_EXPORT void carla_send_midi_note(uint pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  786. #endif
  787. /*!
  788. * Tell a plugin to show its own custom UI.
  789. * @param pluginId Plugin
  790. * @param yesNo New UI state, visible or not
  791. * @see PLUGIN_HAS_CUSTOM_UI
  792. */
  793. CARLA_EXPORT void carla_show_custom_ui(uint pluginId, bool yesNo);
  794. /*!
  795. * Get the current engine buffer size.
  796. */
  797. CARLA_EXPORT uint32_t carla_get_buffer_size();
  798. /*!
  799. * Get the current engine sample rate.
  800. */
  801. CARLA_EXPORT double carla_get_sample_rate();
  802. /*!
  803. * Get the last error.
  804. */
  805. CARLA_EXPORT const char* carla_get_last_error();
  806. /*!
  807. * Get the current engine OSC URL (TCP).
  808. */
  809. CARLA_EXPORT const char* carla_get_host_osc_url_tcp();
  810. /*!
  811. * Get the current engine OSC URL (UDP).
  812. */
  813. CARLA_EXPORT const char* carla_get_host_osc_url_udp();
  814. /** @} */
  815. #endif /* CARLA_HOST_H_INCLUDED */