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.

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