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.

963 lines
22KB

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