Collection of tools useful for audio production
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.

184 lines
7.0KB

  1. /*
  2. * Carla Backend
  3. * Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * 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 COPYING file
  16. */
  17. #ifndef CARLA_BACKEND_STANDALONE_H
  18. #define CARLA_BACKEND_STANDALONE_H
  19. #include <cstdint>
  20. #include "carla_backend.h"
  21. /*!
  22. * @defgroup CarlaBackendStandalone Carla Backend Standalone
  23. *
  24. * The Carla Backend Standalone API
  25. *
  26. * @{
  27. */
  28. struct PluginInfo {
  29. CarlaBackend::PluginType type;
  30. CarlaBackend::PluginCategory category;
  31. unsigned int hints;
  32. const char* binary;
  33. const char* name;
  34. const char* label;
  35. const char* maker;
  36. const char* copyright;
  37. long uniqueId;
  38. PluginInfo()
  39. : type(CarlaBackend::PLUGIN_NONE),
  40. category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  41. hints(0x0),
  42. binary(nullptr),
  43. name(nullptr),
  44. label(nullptr),
  45. maker(nullptr),
  46. copyright(nullptr),
  47. uniqueId(0) {}
  48. };
  49. struct PortCountInfo {
  50. uint32_t ins;
  51. uint32_t outs;
  52. uint32_t total;
  53. PortCountInfo()
  54. : ins(0),
  55. outs(0),
  56. total(0) {}
  57. };
  58. struct ParameterInfo {
  59. const char* name;
  60. const char* symbol;
  61. const char* unit;
  62. uint32_t scalePointCount;
  63. ParameterInfo()
  64. : name(nullptr),
  65. symbol(nullptr),
  66. unit(nullptr),
  67. scalePointCount(0) {}
  68. };
  69. struct ScalePointInfo {
  70. double value;
  71. const char* label;
  72. ScalePointInfo()
  73. : value(0.0),
  74. label(nullptr) {}
  75. };
  76. struct GuiInfo {
  77. CarlaBackend::GuiType type;
  78. bool resizable;
  79. GuiInfo()
  80. : type(CarlaBackend::GUI_NONE),
  81. resizable(false) {}
  82. };
  83. CARLA_EXPORT const char* get_extended_license_text();
  84. CARLA_EXPORT unsigned int get_engine_driver_count();
  85. CARLA_EXPORT const char* get_engine_driver_name(unsigned int index);
  86. CARLA_EXPORT unsigned int get_internal_plugin_count();
  87. CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int plugin_id);
  88. CARLA_EXPORT bool engine_init(const char* driver_name, const char* client_name);
  89. CARLA_EXPORT bool engine_close();
  90. CARLA_EXPORT bool is_engine_running();
  91. CARLA_EXPORT short add_plugin(CarlaBackend::BinaryType btype, CarlaBackend::PluginType ptype, const char* filename, const char* name, const char* label, void* extra_stuff);
  92. CARLA_EXPORT bool remove_plugin(unsigned short plugin_id);
  93. CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned short plugin_id);
  94. CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned short plugin_id);
  95. CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned short plugin_id);
  96. CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned short plugin_id);
  97. CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameter_id);
  98. CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned short plugin_id, uint32_t parameter_id, uint32_t scalepoint_id);
  99. CARLA_EXPORT const GuiInfo* get_gui_info(unsigned short plugin_id);
  100. CARLA_EXPORT const CarlaBackend::ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t parameter_id);
  101. CARLA_EXPORT const CarlaBackend::ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t parameter_id);
  102. CARLA_EXPORT const CarlaBackend::MidiProgramData* get_midi_program_data(unsigned short plugin_id, uint32_t midi_program_id);
  103. CARLA_EXPORT const CarlaBackend::CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data_id);
  104. CARLA_EXPORT const char* get_chunk_data(unsigned short plugin_id);
  105. CARLA_EXPORT uint32_t get_parameter_count(unsigned short plugin_id);
  106. CARLA_EXPORT uint32_t get_program_count(unsigned short plugin_id);
  107. CARLA_EXPORT uint32_t get_midi_program_count(unsigned short plugin_id);
  108. CARLA_EXPORT uint32_t get_custom_data_count(unsigned short plugin_id);
  109. CARLA_EXPORT const char* get_parameter_text(unsigned short plugin_id, uint32_t parameter_id);
  110. CARLA_EXPORT const char* get_program_name(unsigned short plugin_id, uint32_t program_id);
  111. CARLA_EXPORT const char* get_midi_program_name(unsigned short plugin_id, uint32_t midi_program_id);
  112. CARLA_EXPORT const char* get_real_plugin_name(unsigned short plugin_id);
  113. CARLA_EXPORT int32_t get_current_program_index(unsigned short plugin_id);
  114. CARLA_EXPORT int32_t get_current_midi_program_index(unsigned short plugin_id);
  115. CARLA_EXPORT double get_default_parameter_value(unsigned short plugin_id, uint32_t parameter_id);
  116. CARLA_EXPORT double get_current_parameter_value(unsigned short plugin_id, uint32_t parameter_id);
  117. CARLA_EXPORT double get_input_peak_value(unsigned short plugin_id, unsigned short port_id);
  118. CARLA_EXPORT double get_output_peak_value(unsigned short plugin_id, unsigned short port_id);
  119. CARLA_EXPORT void set_active(unsigned short plugin_id, bool onoff);
  120. CARLA_EXPORT void set_drywet(unsigned short plugin_id, double value);
  121. CARLA_EXPORT void set_volume(unsigned short plugin_id, double value);
  122. CARLA_EXPORT void set_balance_left(unsigned short plugin_id, double value);
  123. CARLA_EXPORT void set_balance_right(unsigned short plugin_id, double value);
  124. CARLA_EXPORT void set_parameter_value(unsigned short plugin_id, uint32_t parameter_id, double value);
  125. CARLA_EXPORT void set_parameter_midi_channel(unsigned short plugin_id, uint32_t parameter_id, uint8_t channel);
  126. CARLA_EXPORT void set_parameter_midi_cc(unsigned short plugin_id, uint32_t parameter_id, int16_t cc);
  127. CARLA_EXPORT void set_program(unsigned short plugin_id, uint32_t program_id);
  128. CARLA_EXPORT void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id);
  129. CARLA_EXPORT void set_custom_data(unsigned short plugin_id, CarlaBackend::CustomDataType dtype, const char* key, const char* value);
  130. CARLA_EXPORT void set_chunk_data(unsigned short plugin_id, const char* chunk_data);
  131. CARLA_EXPORT void set_gui_container(unsigned short plugin_id, uintptr_t gui_addr);
  132. CARLA_EXPORT void show_gui(unsigned short plugin_id, bool yesno);
  133. CARLA_EXPORT void idle_guis();
  134. CARLA_EXPORT void send_midi_note(unsigned short plugin_id, uint8_t channel, uint8_t note, uint8_t velocity);
  135. CARLA_EXPORT void prepare_for_save(unsigned short plugin_id);
  136. CARLA_EXPORT uint32_t get_buffer_size();
  137. CARLA_EXPORT double get_sample_rate();
  138. CARLA_EXPORT const char* get_last_error();
  139. CARLA_EXPORT const char* get_host_osc_url();
  140. CARLA_EXPORT void set_callback_function(CarlaBackend::CallbackFunc func);
  141. CARLA_EXPORT void set_option(CarlaBackend::OptionsType option, int value, const char* value_str);
  142. CARLA_EXPORT void nsm_announce(const char* url, int pid);
  143. CARLA_EXPORT void nsm_reply_open();
  144. CARLA_EXPORT void nsm_reply_save();
  145. /**@}*/
  146. #endif // CARLA_BACKEND_STANDALONE_H