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.

957 lines
23KB

  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 types in carla_load_filename().\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. #ifndef 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, something went wrong when closing the engine but it was still 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 to \a func.
  495. * Use \a ptr to pass a custom pointer to the callback.
  496. */
  497. CARLA_EXPORT void carla_set_engine_callback(EngineCallbackFunc func, void* ptr);
  498. /*!
  499. * Set the engine option \a option.\n
  500. * With the exception of OPTION_PROCESS_NAME, OPTION_TRANSPORT_MODE and OPTION_PATH_*,
  501. * this function should not be called when the engine is running.
  502. */
  503. CARLA_EXPORT void carla_set_engine_option(EngineOption option, int value, const char* valueStr);
  504. /*!
  505. * Set the file callback function to \a func.
  506. * Use \a ptr to pass a custom pointer to the callback.
  507. */
  508. CARLA_EXPORT void carla_set_file_callback(FileCallbackFunc func, void* ptr);
  509. /*!
  510. * Load \a filename of any type.\n
  511. * This will try to load a generic file as a plugin,
  512. * either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI).
  513. * @see carla_get_supported_file_types()
  514. */
  515. CARLA_EXPORT bool carla_load_filename(const char* filename);
  516. /*!
  517. * Load \a filename project file.\n
  518. * (project files have *.carxp extension)
  519. * \note Already loaded plugins are not removed; call carla_remove_all_plugins() first if needed.
  520. */
  521. CARLA_EXPORT bool carla_load_project(const char* filename);
  522. /*!
  523. * Save current project to \a filename.\n
  524. * (project files have *.carxp extension)
  525. */
  526. CARLA_EXPORT bool carla_save_project(const char* filename);
  527. /*!
  528. * Connect patchbay ports \a portA and \a portB.
  529. */
  530. CARLA_EXPORT bool carla_patchbay_connect(int portA, int portB);
  531. /*!
  532. * Disconnect patchbay connection \a connectionId.
  533. */
  534. CARLA_EXPORT bool carla_patchbay_disconnect(int connectionId);
  535. /*!
  536. * Force the engine to resend all patchbay clients, ports and connections again.
  537. */
  538. CARLA_EXPORT bool carla_patchbay_refresh();
  539. /*!
  540. * Start playback of the engine transport.
  541. */
  542. CARLA_EXPORT void carla_transport_play();
  543. /*!
  544. * Pause the engine transport.
  545. */
  546. CARLA_EXPORT void carla_transport_pause();
  547. /*!
  548. * Relocate the engine transport to \a frames.
  549. */
  550. CARLA_EXPORT void carla_transport_relocate(uint32_t frames);
  551. /*!
  552. * Get the current transport frame.
  553. */
  554. CARLA_EXPORT uint64_t carla_get_current_transport_frame();
  555. /*!
  556. * Get the engine transport information.
  557. */
  558. CARLA_EXPORT const CarlaTransportInfo* carla_get_transport_info();
  559. /*!
  560. * Add new plugin.\n
  561. * If you don't know the binary type, use BINARY_NATIVE.
  562. */
  563. CARLA_EXPORT bool carla_add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, const void* extraPtr);
  564. /*!
  565. * Remove plugin with id \a pluginId.
  566. */
  567. CARLA_EXPORT bool carla_remove_plugin(unsigned int pluginId);
  568. /*!
  569. * Remove all plugins.
  570. */
  571. CARLA_EXPORT bool carla_remove_all_plugins();
  572. /*!
  573. * Rename plugin with id \a pluginId to \a newName. \n
  574. * Returns the new name, or NULL if the operation failed.
  575. */
  576. CARLA_EXPORT const char* carla_rename_plugin(unsigned int pluginId, const char* newName);
  577. /*!
  578. * Clone plugin with id \a pluginId.
  579. */
  580. CARLA_EXPORT bool carla_clone_plugin(unsigned int pluginId);
  581. /*!
  582. * Prepare replace of plugin with id \a pluginId. \n
  583. * The next call to carla_add_plugin() will use this id, replacing the current plugin.
  584. * \note This function requires carla_add_plugin() to be called afterwards as soon as possible.
  585. */
  586. CARLA_EXPORT bool carla_replace_plugin(unsigned int pluginId);
  587. /*!
  588. * Switch plugins with id \a pluginIdA and \a pluginIdB.
  589. */
  590. CARLA_EXPORT bool carla_switch_plugins(unsigned int pluginIdA, unsigned int pluginIdB);
  591. /*!
  592. * Load the plugin state at \a filename.\n
  593. * (Plugin states have *.carxs extension).
  594. * @see carla_save_plugin_state()
  595. */
  596. CARLA_EXPORT bool carla_load_plugin_state(unsigned int pluginId, const char* filename);
  597. /*!
  598. * Load the plugin state at \a filename.\n
  599. * (Plugin states have *.carxs extension).
  600. * @see carla_load_plugin_state()
  601. */
  602. CARLA_EXPORT bool carla_save_plugin_state(unsigned int pluginId, const char* filename);
  603. /*!
  604. * Get a plugin's information.
  605. */
  606. CARLA_EXPORT const CarlaPluginInfo* carla_get_plugin_info(unsigned int pluginId);
  607. /*!
  608. * Get a plugin's audio port count information.
  609. */
  610. CARLA_EXPORT const CarlaPortCountInfo* carla_get_audio_port_count_info(unsigned int pluginId);
  611. /*!
  612. * Get a plugin's midi port count information.
  613. */
  614. CARLA_EXPORT const CarlaPortCountInfo* carla_get_midi_port_count_info(unsigned int pluginId);
  615. /*!
  616. * Get a plugin's parameter count information.
  617. */
  618. CARLA_EXPORT const CarlaPortCountInfo* carla_get_parameter_count_info(unsigned int pluginId);
  619. /*!
  620. * * Get a plugin's parameter information.
  621. */
  622. CARLA_EXPORT const CarlaParameterInfo* carla_get_parameter_info(unsigned int pluginId, uint32_t parameterId);
  623. /*!
  624. * Get a plugin's parameter scale point information.
  625. */
  626. CARLA_EXPORT const CarlaScalePointInfo* carla_get_parameter_scalepoint_info(unsigned int pluginId, uint32_t parameterId, uint32_t scalePointId);
  627. /*!
  628. * Get a plugin's parameter data.
  629. */
  630. CARLA_EXPORT const ParameterData* carla_get_parameter_data(unsigned int pluginId, uint32_t parameterId);
  631. /*!
  632. * Get a plugin's parameter ranges.
  633. */
  634. CARLA_EXPORT const ParameterRanges* carla_get_parameter_ranges(unsigned int pluginId, uint32_t parameterId);
  635. /*!
  636. * Get a plugin's midi program data.
  637. */
  638. CARLA_EXPORT const MidiProgramData* carla_get_midi_program_data(unsigned int pluginId, uint32_t midiProgramId);
  639. /*!
  640. * Get a plugin's custom data.
  641. */
  642. CARLA_EXPORT const CustomData* carla_get_custom_data(unsigned int pluginId, uint32_t customDataId);
  643. /*!
  644. * Get a plugin's chunk data.
  645. */
  646. CARLA_EXPORT const char* carla_get_chunk_data(unsigned int pluginId);
  647. /*!
  648. * Get how many parameters a plugin has.
  649. */
  650. CARLA_EXPORT uint32_t carla_get_parameter_count(unsigned int pluginId);
  651. /*!
  652. * Get how many programs a plugin has.
  653. */
  654. CARLA_EXPORT uint32_t carla_get_program_count(unsigned int pluginId);
  655. /*!
  656. * Get how many midi programs a plugin has.
  657. */
  658. CARLA_EXPORT uint32_t carla_get_midi_program_count(unsigned int pluginId);
  659. /*!
  660. * Get how many custom data sets a plugin has.
  661. * @see carla_prepare_for_save()
  662. */
  663. CARLA_EXPORT uint32_t carla_get_custom_data_count(unsigned int pluginId);
  664. /*!
  665. * Get a plugin's custom parameter text display.
  666. * @see PARAMETER_USES_CUSTOM_TEXT
  667. */
  668. CARLA_EXPORT const char* carla_get_parameter_text(unsigned int pluginId, uint32_t parameterId);
  669. /*!
  670. * Get a plugin's program name.
  671. */
  672. CARLA_EXPORT const char* carla_get_program_name(unsigned int pluginId, uint32_t programId);
  673. /*!
  674. * Get a plugin's midi program name.
  675. */
  676. CARLA_EXPORT const char* carla_get_midi_program_name(unsigned int pluginId, uint32_t midiProgramId);
  677. /*!
  678. * Get the plugin's real name.\n
  679. * This is the name the plugin uses to identify itself; may not be unique.
  680. */
  681. CARLA_EXPORT const char* carla_get_real_plugin_name(unsigned int pluginId);
  682. /*!
  683. * Get the current plugin's program index.
  684. */
  685. CARLA_EXPORT int32_t carla_get_current_program_index(unsigned int pluginId);
  686. /*!
  687. * Get the current plugin's midi program index.
  688. */
  689. CARLA_EXPORT int32_t carla_get_current_midi_program_index(unsigned int pluginId);
  690. /*!
  691. * Get a plugin's default parameter value.
  692. */
  693. CARLA_EXPORT float carla_get_default_parameter_value(unsigned int pluginId, uint32_t parameterId);
  694. /*!
  695. * Get a plugin's current parameter value.
  696. */
  697. CARLA_EXPORT float carla_get_current_parameter_value(unsigned int pluginId, uint32_t parameterId);
  698. /*!
  699. * Get a plugin's input peak value.\n
  700. * \a portId must only be either 1 or 2
  701. */
  702. CARLA_EXPORT float carla_get_input_peak_value(unsigned int pluginId, unsigned short portId);
  703. /*!
  704. * Get a plugin's output peak value.\n
  705. * \a portId must only be either 1 or 2
  706. */
  707. CARLA_EXPORT float carla_get_output_peak_value(unsigned int pluginId, unsigned short portId);
  708. /*!
  709. * Enable a plugin's option.
  710. * @see PluginOptions
  711. */
  712. CARLA_EXPORT void carla_set_option(unsigned int pluginId, unsigned int option, bool yesNo);
  713. /*!
  714. * Enable or disable a plugin according to \a onOff.
  715. */
  716. CARLA_EXPORT void carla_set_active(unsigned int pluginId, bool onOff);
  717. #ifndef BUILD_BRIDGE
  718. /*!
  719. * Change a plugin's internal drywet value to \a value.
  720. */
  721. CARLA_EXPORT void carla_set_drywet(unsigned int pluginId, float value);
  722. /*!
  723. * Change a plugin's internal volume value to \a value.
  724. */
  725. CARLA_EXPORT void carla_set_volume(unsigned int pluginId, float value);
  726. /*!
  727. * Change a plugin's internal balance-left value to \a value.
  728. */
  729. CARLA_EXPORT void carla_set_balance_left(unsigned int pluginId, float value);
  730. /*!
  731. * Change a plugin's internal balance-right value to \a value.
  732. */
  733. CARLA_EXPORT void carla_set_balance_right(unsigned int pluginId, float value);
  734. /*!
  735. * Change a plugin's internal panning value to \a value.
  736. */
  737. CARLA_EXPORT void carla_set_panning(unsigned int pluginId, float value);
  738. #endif
  739. /*!
  740. * Change a plugin's internal control channel to \a channel.
  741. */
  742. CARLA_EXPORT void carla_set_ctrl_channel(unsigned int pluginId, int8_t channel);
  743. /*!
  744. * Set the plugin's parameter \a parameterId to \a value.
  745. */
  746. CARLA_EXPORT void carla_set_parameter_value(unsigned int pluginId, uint32_t parameterId, float value);
  747. #ifndef BUILD_BRIDGE
  748. /*!
  749. * Set the plugin's parameter \a parameterId midi channel to \a channel.
  750. */
  751. CARLA_EXPORT void carla_set_parameter_midi_channel(unsigned int pluginId, uint32_t parameterId, uint8_t channel);
  752. /*!
  753. * Set the plugin's parameter \a parameterId midi cc to \a cc.
  754. */
  755. CARLA_EXPORT void carla_set_parameter_midi_cc(unsigned int pluginId, uint32_t parameterId, int16_t cc);
  756. #endif
  757. /*!
  758. * Change a plugin's program to \a programId.
  759. */
  760. CARLA_EXPORT void carla_set_program(unsigned int pluginId, uint32_t programId);
  761. /*!
  762. * Change a plugin's midi program to \a midiProgramId.
  763. */
  764. CARLA_EXPORT void carla_set_midi_program(unsigned int pluginId, uint32_t midiProgramId);
  765. /*!
  766. * Set a plugin's custom data set.
  767. */
  768. CARLA_EXPORT void carla_set_custom_data(unsigned int pluginId, const char* type, const char* key, const char* value);
  769. /*!
  770. * Set a plugin's chunk data.
  771. */
  772. CARLA_EXPORT void carla_set_chunk_data(unsigned int pluginId, const char* chunkData);
  773. /*!
  774. * Tell a plugin to prepare for save.\n
  775. * This should be called before carla_get_custom_data_count().
  776. */
  777. CARLA_EXPORT void carla_prepare_for_save(unsigned int pluginId);
  778. #ifndef BUILD_BRIDGE
  779. /*!
  780. * Send a single note of a plugin.\n
  781. * If \a note if 0, note-off is sent; note-on otherwise.
  782. */
  783. CARLA_EXPORT void carla_send_midi_note(unsigned int pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  784. #endif
  785. /*!
  786. * Tell a plugin to show its own custom UI.
  787. * @see PLUGIN_HAS_CUSTOM_UI
  788. */
  789. CARLA_EXPORT void carla_show_custom_ui(unsigned int pluginId, bool yesNo);
  790. /*!
  791. * Get the current engine buffer size.
  792. */
  793. CARLA_EXPORT uint32_t carla_get_buffer_size();
  794. /*!
  795. * Get the current engine sample rate.
  796. */
  797. CARLA_EXPORT double carla_get_sample_rate();
  798. /*!
  799. * Get the last error.
  800. */
  801. CARLA_EXPORT const char* carla_get_last_error();
  802. /*!
  803. * Get the current engine OSC URL (TCP).
  804. */
  805. CARLA_EXPORT const char* carla_get_host_osc_url_tcp();
  806. /*!
  807. * Get the current engine OSC URL (UDP).
  808. */
  809. CARLA_EXPORT const char* carla_get_host_osc_url_udp();
  810. /** @} */
  811. #endif /* CARLA_HOST_H_INCLUDED */