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.

187 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.hpp"
  21. // TODO - create struct for internal plugin info
  22. // TODO - dont strdup() on const-char* returns, use static char[STR_MAX]
  23. /*!
  24. * @defgroup CarlaBackendStandalone Carla Backend Standalone
  25. *
  26. * The Carla Backend Standalone API
  27. *
  28. * @{
  29. */
  30. struct PluginInfo {
  31. CarlaBackend::PluginType type;
  32. CarlaBackend::PluginCategory category;
  33. unsigned int hints;
  34. const char* binary;
  35. const char* name;
  36. const char* label;
  37. const char* maker;
  38. const char* copyright;
  39. long uniqueId;
  40. PluginInfo()
  41. : type(CarlaBackend::PLUGIN_NONE),
  42. category(CarlaBackend::PLUGIN_CATEGORY_NONE),
  43. hints(0x0),
  44. binary(nullptr),
  45. name(nullptr),
  46. label(nullptr),
  47. maker(nullptr),
  48. copyright(nullptr),
  49. uniqueId(0) {}
  50. };
  51. struct PortCountInfo {
  52. uint32_t ins;
  53. uint32_t outs;
  54. uint32_t total;
  55. PortCountInfo()
  56. : ins(0),
  57. outs(0),
  58. total(0) {}
  59. };
  60. struct ParameterInfo {
  61. const char* name;
  62. const char* symbol;
  63. const char* unit;
  64. uint32_t scalePointCount;
  65. ParameterInfo()
  66. : name(nullptr),
  67. symbol(nullptr),
  68. unit(nullptr),
  69. scalePointCount(0) {}
  70. };
  71. struct ScalePointInfo {
  72. double value;
  73. const char* label;
  74. ScalePointInfo()
  75. : value(0.0),
  76. label(nullptr) {}
  77. };
  78. struct GuiInfo {
  79. CarlaBackend::GuiType type;
  80. bool resizable;
  81. GuiInfo()
  82. : type(CarlaBackend::GUI_NONE),
  83. resizable(false) {}
  84. };
  85. CARLA_EXPORT const char* get_extended_license_text();
  86. CARLA_EXPORT unsigned int get_engine_driver_count();
  87. CARLA_EXPORT const char* get_engine_driver_name(unsigned int index);
  88. CARLA_EXPORT unsigned int get_internal_plugin_count();
  89. CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int pluginId);
  90. CARLA_EXPORT bool engine_init(const char* driverName, const char* clientName);
  91. CARLA_EXPORT bool engine_close();
  92. CARLA_EXPORT bool is_engine_running();
  93. CARLA_EXPORT short add_plugin(CarlaBackend::BinaryType btype, CarlaBackend::PluginType ptype, const char* filename, const char* name, const char* label, void* extraStuff);
  94. CARLA_EXPORT bool remove_plugin(unsigned short pluginId);
  95. CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned short pluginId);
  96. CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned short pluginId);
  97. CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned short pluginId);
  98. CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned short pluginId);
  99. CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameterId);
  100. CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned short pluginId, uint32_t parameterId, uint32_t scalePointId);
  101. CARLA_EXPORT const GuiInfo* get_gui_info(unsigned short pluginId);
  102. CARLA_EXPORT const CarlaBackend::ParameterData* get_parameter_data(unsigned short pluginId, uint32_t parameterId);
  103. CARLA_EXPORT const CarlaBackend::ParameterRanges* get_parameter_ranges(unsigned short pluginId, uint32_t parameterId);
  104. CARLA_EXPORT const CarlaBackend::MidiProgramData* get_midi_program_data(unsigned short pluginId, uint32_t midiProgramId);
  105. CARLA_EXPORT const CarlaBackend::CustomData* get_custom_data(unsigned short pluginId, uint32_t customDataId);
  106. CARLA_EXPORT const char* get_chunk_data(unsigned short pluginId);
  107. CARLA_EXPORT uint32_t get_parameter_count(unsigned short pluginId);
  108. CARLA_EXPORT uint32_t get_program_count(unsigned short pluginId);
  109. CARLA_EXPORT uint32_t get_midi_program_count(unsigned short pluginId);
  110. CARLA_EXPORT uint32_t get_custom_data_count(unsigned short pluginId);
  111. CARLA_EXPORT const char* get_parameter_text(unsigned short pluginId, uint32_t parameterId);
  112. CARLA_EXPORT const char* get_program_name(unsigned short pluginId, uint32_t programId);
  113. CARLA_EXPORT const char* get_midi_program_name(unsigned short pluginId, uint32_t midiProgramId);
  114. CARLA_EXPORT const char* get_real_plugin_name(unsigned short pluginId);
  115. CARLA_EXPORT int32_t get_current_program_index(unsigned short pluginId);
  116. CARLA_EXPORT int32_t get_current_midi_program_index(unsigned short pluginId);
  117. CARLA_EXPORT double get_default_parameter_value(unsigned short pluginId, uint32_t parameterId);
  118. CARLA_EXPORT double get_current_parameter_value(unsigned short pluginId, uint32_t parameterId);
  119. CARLA_EXPORT double get_input_peak_value(unsigned short pluginId, unsigned short portId);
  120. CARLA_EXPORT double get_output_peak_value(unsigned short pluginId, unsigned short portId);
  121. CARLA_EXPORT void set_active(unsigned short pluginId, bool onOff);
  122. CARLA_EXPORT void set_drywet(unsigned short pluginId, double value);
  123. CARLA_EXPORT void set_volume(unsigned short pluginId, double value);
  124. CARLA_EXPORT void set_balance_left(unsigned short pluginId, double value);
  125. CARLA_EXPORT void set_balance_right(unsigned short pluginId, double value);
  126. CARLA_EXPORT void set_parameter_value(unsigned short pluginId, uint32_t parameterId, double value);
  127. CARLA_EXPORT void set_parameter_midi_channel(unsigned short pluginId, uint32_t parameterId, uint8_t channel);
  128. CARLA_EXPORT void set_parameter_midi_cc(unsigned short pluginId, uint32_t parameterId, int16_t cc);
  129. CARLA_EXPORT void set_program(unsigned short pluginId, uint32_t programId);
  130. CARLA_EXPORT void set_midi_program(unsigned short pluginId, uint32_t midiProgramId);
  131. CARLA_EXPORT void set_custom_data(unsigned short pluginId, const char* type, const char* key, const char* value);
  132. CARLA_EXPORT void set_chunk_data(unsigned short pluginId, const char* chunkData);
  133. CARLA_EXPORT void set_gui_container(unsigned short pluginId, uintptr_t guiAddr);
  134. CARLA_EXPORT void show_gui(unsigned short pluginId, bool yesNo);
  135. CARLA_EXPORT void idle_guis();
  136. CARLA_EXPORT void send_midi_note(unsigned short pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
  137. CARLA_EXPORT void prepare_for_save(unsigned short pluginId);
  138. CARLA_EXPORT uint32_t get_buffer_size();
  139. CARLA_EXPORT double get_sample_rate();
  140. CARLA_EXPORT const char* get_last_error();
  141. CARLA_EXPORT const char* get_host_osc_url();
  142. CARLA_EXPORT void set_callback_function(CarlaBackend::CallbackFunc func);
  143. CARLA_EXPORT void set_option(CarlaBackend::OptionsType option, int value, const char* valueStr);
  144. CARLA_EXPORT void nsm_announce(const char* url, int pid);
  145. CARLA_EXPORT void nsm_reply_open();
  146. CARLA_EXPORT void nsm_reply_save();
  147. /**@}*/
  148. #endif // CARLA_BACKEND_STANDALONE_H