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.

182 lines
6.6KB

  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. CARLA_BACKEND_START_NAMESPACE
  23. /*!
  24. * @defgroup CarlaBackendStandalone Carla Backend Standalone
  25. *
  26. * The Carla Backend Standalone API
  27. *
  28. * @{
  29. */
  30. #if 0
  31. struct PluginInfo {
  32. PluginType type;
  33. PluginCategory 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. PluginInfo()
  42. : type(PLUGIN_NONE),
  43. category(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 PortCountInfo {
  53. uint32_t ins;
  54. uint32_t outs;
  55. uint32_t total;
  56. PortCountInfo()
  57. : ins(0),
  58. outs(0),
  59. total(0) {}
  60. };
  61. struct ParameterInfo {
  62. const char* name;
  63. const char* symbol;
  64. const char* unit;
  65. uint32_t scalePointCount;
  66. ParameterInfo()
  67. : name(nullptr),
  68. symbol(nullptr),
  69. unit(nullptr),
  70. scalePointCount(0) {}
  71. };
  72. struct ScalePointInfo {
  73. double value;
  74. const char* label;
  75. ScalePointInfo()
  76. : value(0.0),
  77. label(nullptr) {}
  78. };
  79. #endif
  80. CARLA_EXPORT const char* carla_get_extended_license_text();
  81. CARLA_EXPORT unsigned int carla_get_engine_driver_count();
  82. CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);
  83. #if 0
  84. CARLA_EXPORT unsigned int get_internal_plugin_count();
  85. CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int pluginId);
  86. CARLA_EXPORT bool engine_init(const char* driverName, const char* clientName);
  87. CARLA_EXPORT bool engine_close();
  88. CARLA_EXPORT bool is_engine_running();
  89. CARLA_EXPORT int add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extraPtr);
  90. CARLA_EXPORT bool remove_plugin(unsigned int pluginId);
  91. CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned int pluginId);
  92. CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned int pluginId);
  93. CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned int pluginId);
  94. CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned int pluginId);
  95. CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameterId);
  96. CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned int pluginId, uint32_t parameterId, uint32_t scalePointId);
  97. CARLA_EXPORT const ParameterData* get_parameter_data(unsigned int pluginId, uint32_t parameterId);
  98. CARLA_EXPORT const ParameterRanges* get_parameter_ranges(unsigned int pluginId, uint32_t parameterId);
  99. CARLA_EXPORT const MidiProgramData* get_midi_program_data(unsigned int pluginId, uint32_t midiProgramId);
  100. CARLA_EXPORT const CustomData* get_custom_data(unsigned int pluginId, uint32_t customDataId);
  101. CARLA_EXPORT const char* get_chunk_data(unsigned int pluginId);
  102. CARLA_EXPORT uint32_t get_parameter_count(unsigned int pluginId);
  103. CARLA_EXPORT uint32_t get_program_count(unsigned int pluginId);
  104. CARLA_EXPORT uint32_t get_midi_program_count(unsigned int pluginId);
  105. CARLA_EXPORT uint32_t get_custom_data_count(unsigned int pluginId);
  106. CARLA_EXPORT const char* get_parameter_text(unsigned int pluginId, uint32_t parameterId);
  107. CARLA_EXPORT const char* get_program_name(unsigned int pluginId, uint32_t programId);
  108. CARLA_EXPORT const char* get_midi_program_name(unsigned int pluginId, uint32_t midiProgramId);
  109. CARLA_EXPORT const char* get_real_plugin_name(unsigned int pluginId);
  110. CARLA_EXPORT int32_t get_current_program_index(unsigned int pluginId);
  111. CARLA_EXPORT int32_t get_current_midi_program_index(unsigned int pluginId);
  112. CARLA_EXPORT double get_default_parameter_value(unsigned int pluginId, uint32_t parameterId);
  113. CARLA_EXPORT double get_current_parameter_value(unsigned int pluginId, uint32_t parameterId);
  114. CARLA_EXPORT double get_input_peak_value(unsigned int pluginId, unsigned short portId);
  115. CARLA_EXPORT double get_output_peak_value(unsigned int pluginId, unsigned short portId);
  116. CARLA_EXPORT void set_active(unsigned int pluginId, bool onOff);
  117. CARLA_EXPORT void set_drywet(unsigned int pluginId, double value);
  118. CARLA_EXPORT void set_volume(unsigned int pluginId, double value);
  119. CARLA_EXPORT void set_balance_left(unsigned int pluginId, double value);
  120. CARLA_EXPORT void set_balance_right(unsigned int pluginId, double value);
  121. CARLA_EXPORT void set_parameter_value(unsigned int pluginId, uint32_t parameterId, double value);
  122. CARLA_EXPORT void set_parameter_midi_channel(unsigned int pluginId, uint32_t parameterId, uint8_t channel);
  123. CARLA_EXPORT void set_parameter_midi_cc(unsigned int pluginId, uint32_t parameterId, int16_t cc);
  124. CARLA_EXPORT void set_program(unsigned int pluginId, uint32_t programId);
  125. CARLA_EXPORT void set_midi_program(unsigned int pluginId, uint32_t midiProgramId);
  126. CARLA_EXPORT void set_custom_data(unsigned int pluginId, const char* type, const char* key, const char* value);
  127. CARLA_EXPORT void set_chunk_data(unsigned int pluginId, const char* chunkData);
  128. CARLA_EXPORT void show_gui(unsigned int pluginId, bool yesNo);
  129. CARLA_EXPORT void idle_guis();
  130. CARLA_EXPORT void send_midi_note(unsigned int pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  131. CARLA_EXPORT void prepare_for_save(unsigned int pluginId);
  132. CARLA_EXPORT uint32_t get_buffer_size();
  133. CARLA_EXPORT double get_sample_rate();
  134. CARLA_EXPORT const char* get_last_error();
  135. CARLA_EXPORT const char* get_host_osc_url();
  136. CARLA_EXPORT void set_callback_function(CallbackFunc func);
  137. CARLA_EXPORT void set_option(OptionsType option, int value, const char* valueStr);
  138. CARLA_EXPORT void nsm_announce(const char* url, int pid);
  139. CARLA_EXPORT void nsm_reply_open();
  140. CARLA_EXPORT void nsm_reply_save();
  141. #endif
  142. /**@}*/
  143. CARLA_BACKEND_END_NAMESPACE
  144. #endif // __CARLA_STANDALONE_HPP__