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.

208 lines
7.4KB

  1. /*
  2. * Carla Standalone 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 GPL.txt file
  16. */
  17. #ifndef __CARLA_STANDALONE_HPP__
  18. #define __CARLA_STANDALONE_HPP__
  19. #include "carla_backend.hpp"
  20. // TODO - create struct for internal plugin info
  21. // TODO - dont strdup() on const-char* returns, use static char[STR_MAX]
  22. /*!
  23. * @defgroup CarlaBackendStandalone Carla Backend Standalone
  24. *
  25. * The Carla Backend Standalone API
  26. *
  27. * @{
  28. */
  29. typedef CarlaBackend::PluginType CarlaPluginType;
  30. typedef CarlaBackend::PluginCategory CarlaPluginCategory;
  31. struct CarlaPluginInfo {
  32. CarlaPluginType type;
  33. CarlaPluginCategory category;
  34. unsigned int hints;
  35. const char* binary;
  36. const char* name;
  37. const char* label;
  38. const char* maker;
  39. const char* copyright;
  40. long uniqueId;
  41. CarlaPluginInfo()
  42. : type(CarlaBackend::PLUGIN_NONE),
  43. category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  44. hints(0x0),
  45. binary(nullptr),
  46. name(nullptr),
  47. label(nullptr),
  48. maker(nullptr),
  49. copyright(nullptr),
  50. uniqueId(0) {}
  51. };
  52. struct CarlaNativePluginInfo {
  53. CarlaPluginCategory category;
  54. unsigned int hints;
  55. uint32_t audioIns;
  56. uint32_t audioOuts;
  57. uint32_t midiIns;
  58. uint32_t midiOuts;
  59. uint32_t parameterIns;
  60. uint32_t parameterOuts;
  61. const char* name;
  62. const char* label;
  63. const char* maker;
  64. const char* copyright;
  65. CarlaNativePluginInfo()
  66. : category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  67. hints(0x0),
  68. audioIns(0),
  69. audioOuts(0),
  70. midiIns(0),
  71. midiOuts(0),
  72. parameterIns(0),
  73. parameterOuts(0),
  74. name(nullptr),
  75. label(nullptr),
  76. maker(nullptr),
  77. copyright(nullptr) {}
  78. };
  79. struct CarlaPortCountInfo {
  80. uint32_t ins;
  81. uint32_t outs;
  82. uint32_t total;
  83. CarlaPortCountInfo()
  84. : ins(0),
  85. outs(0),
  86. total(0) {}
  87. };
  88. struct CarlaParameterInfo {
  89. const char* name;
  90. const char* symbol;
  91. const char* unit;
  92. uint32_t scalePointCount;
  93. CarlaParameterInfo()
  94. : name(nullptr),
  95. symbol(nullptr),
  96. unit(nullptr),
  97. scalePointCount(0) {}
  98. };
  99. struct CarlaScalePointInfo {
  100. double value;
  101. const char* label;
  102. CarlaScalePointInfo()
  103. : value(0.0),
  104. label(nullptr) {}
  105. };
  106. CARLA_EXPORT const char* carla_get_extended_license_text();
  107. CARLA_EXPORT unsigned int carla_get_engine_driver_count();
  108. CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
  109. CARLA_EXPORT unsigned int carla_get_internal_plugin_count();
  110. CARLA_EXPORT const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId);
  111. CARLA_EXPORT bool carla_engine_init(const char* driverName, const char* clientName);
  112. CARLA_EXPORT bool carla_engine_close();
  113. CARLA_EXPORT bool carla_is_engine_running();
  114. #if 0
  115. CARLA_EXPORT int add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extraPtr);
  116. CARLA_EXPORT bool remove_plugin(unsigned int pluginId);
  117. CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned int pluginId);
  118. CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned int pluginId);
  119. CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned int pluginId);
  120. CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned int pluginId);
  121. CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameterId);
  122. CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned int pluginId, uint32_t parameterId, uint32_t scalePointId);
  123. CARLA_EXPORT const ParameterData* get_parameter_data(unsigned int pluginId, uint32_t parameterId);
  124. CARLA_EXPORT const ParameterRanges* get_parameter_ranges(unsigned int pluginId, uint32_t parameterId);
  125. CARLA_EXPORT const MidiProgramData* get_midi_program_data(unsigned int pluginId, uint32_t midiProgramId);
  126. CARLA_EXPORT const CustomData* get_custom_data(unsigned int pluginId, uint32_t customDataId);
  127. CARLA_EXPORT const char* get_chunk_data(unsigned int pluginId);
  128. CARLA_EXPORT uint32_t get_parameter_count(unsigned int pluginId);
  129. CARLA_EXPORT uint32_t get_program_count(unsigned int pluginId);
  130. CARLA_EXPORT uint32_t get_midi_program_count(unsigned int pluginId);
  131. CARLA_EXPORT uint32_t get_custom_data_count(unsigned int pluginId);
  132. CARLA_EXPORT const char* get_parameter_text(unsigned int pluginId, uint32_t parameterId);
  133. CARLA_EXPORT const char* get_program_name(unsigned int pluginId, uint32_t programId);
  134. CARLA_EXPORT const char* get_midi_program_name(unsigned int pluginId, uint32_t midiProgramId);
  135. CARLA_EXPORT const char* get_real_plugin_name(unsigned int pluginId);
  136. CARLA_EXPORT int32_t get_current_program_index(unsigned int pluginId);
  137. CARLA_EXPORT int32_t get_current_midi_program_index(unsigned int pluginId);
  138. CARLA_EXPORT double get_default_parameter_value(unsigned int pluginId, uint32_t parameterId);
  139. CARLA_EXPORT double get_current_parameter_value(unsigned int pluginId, uint32_t parameterId);
  140. CARLA_EXPORT double get_input_peak_value(unsigned int pluginId, unsigned short portId);
  141. CARLA_EXPORT double get_output_peak_value(unsigned int pluginId, unsigned short portId);
  142. CARLA_EXPORT void set_active(unsigned int pluginId, bool onOff);
  143. CARLA_EXPORT void set_drywet(unsigned int pluginId, double value);
  144. CARLA_EXPORT void set_volume(unsigned int pluginId, double value);
  145. CARLA_EXPORT void set_balance_left(unsigned int pluginId, double value);
  146. CARLA_EXPORT void set_balance_right(unsigned int pluginId, double value);
  147. CARLA_EXPORT void set_parameter_value(unsigned int pluginId, uint32_t parameterId, double value);
  148. CARLA_EXPORT void set_parameter_midi_channel(unsigned int pluginId, uint32_t parameterId, uint8_t channel);
  149. CARLA_EXPORT void set_parameter_midi_cc(unsigned int pluginId, uint32_t parameterId, int16_t cc);
  150. CARLA_EXPORT void set_program(unsigned int pluginId, uint32_t programId);
  151. CARLA_EXPORT void set_midi_program(unsigned int pluginId, uint32_t midiProgramId);
  152. CARLA_EXPORT void set_custom_data(unsigned int pluginId, const char* type, const char* key, const char* value);
  153. CARLA_EXPORT void set_chunk_data(unsigned int pluginId, const char* chunkData);
  154. CARLA_EXPORT void show_gui(unsigned int pluginId, bool yesNo);
  155. CARLA_EXPORT void idle_guis();
  156. CARLA_EXPORT void send_midi_note(unsigned int pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  157. CARLA_EXPORT void prepare_for_save(unsigned int pluginId);
  158. CARLA_EXPORT uint32_t get_buffer_size();
  159. CARLA_EXPORT double get_sample_rate();
  160. CARLA_EXPORT const char* get_last_error();
  161. CARLA_EXPORT const char* get_host_osc_url();
  162. CARLA_EXPORT void set_callback_function(CallbackFunc func);
  163. CARLA_EXPORT void set_option(OptionsType option, int value, const char* valueStr);
  164. CARLA_EXPORT void nsm_announce(const char* url, int pid);
  165. CARLA_EXPORT void nsm_reply_open();
  166. CARLA_EXPORT void nsm_reply_save();
  167. #endif
  168. /**@}*/
  169. #endif // __CARLA_STANDALONE_HPP__