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