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.

930 lines
24KB

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