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.

258 lines
5.8KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2014 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_UTILS_H_INCLUDED
  18. #define CARLA_UTILS_H_INCLUDED
  19. #include "CarlaBackend.h"
  20. #ifdef __cplusplus
  21. using CarlaBackend::PluginCategory;
  22. using CarlaBackend::PluginType;
  23. #endif
  24. /*!
  25. * @defgroup CarlaUtilsAPI Carla Utils API
  26. *
  27. * The Carla Utils API.
  28. *
  29. * This API allows to call advanced features from Python.
  30. * @{
  31. */
  32. /*!
  33. * TODO.
  34. */
  35. typedef void* CarlaPipeClientHandle;
  36. /*!
  37. * TODO.
  38. */
  39. typedef void (*CarlaPipeCallbackFunc)(void* ptr, const char* msg);
  40. /*!
  41. * Information about a cached plugin.
  42. * @see carla_get_cached_plugin_info()
  43. */
  44. typedef struct _CarlaCachedPluginInfo {
  45. /*!
  46. * Plugin category.
  47. */
  48. PluginCategory category;
  49. /*!
  50. * Plugin hints.
  51. * @see PluginHints
  52. */
  53. uint hints;
  54. /*!
  55. * Number of audio inputs.
  56. */
  57. uint32_t audioIns;
  58. /*!
  59. * Number of audio outputs.
  60. */
  61. uint32_t audioOuts;
  62. /*!
  63. * Number of MIDI inputs.
  64. */
  65. uint32_t midiIns;
  66. /*!
  67. * Number of MIDI outputs.
  68. */
  69. uint32_t midiOuts;
  70. /*!
  71. * Number of input parameters.
  72. */
  73. uint32_t parameterIns;
  74. /*!
  75. * Number of output parameters.
  76. */
  77. uint32_t parameterOuts;
  78. /*!
  79. * Plugin name.
  80. */
  81. const char* name;
  82. /*!
  83. * Plugin label.
  84. */
  85. const char* label;
  86. /*!
  87. * Plugin author/maker.
  88. */
  89. const char* maker;
  90. /*!
  91. * Plugin copyright/license.
  92. */
  93. const char* copyright;
  94. #ifdef __cplusplus
  95. /*!
  96. * C++ constructor.
  97. */
  98. CARLA_API _CarlaCachedPluginInfo() noexcept;
  99. CARLA_DECLARE_NON_COPY_STRUCT(_CarlaCachedPluginInfo)
  100. #endif
  101. } CarlaCachedPluginInfo;
  102. /* ------------------------------------------------------------------------------------------------------------
  103. * get stuff */
  104. /*!
  105. * Get the complete license text of used third-party code and features.
  106. * Returned string is in basic html format.
  107. */
  108. CARLA_EXPORT const char* carla_get_complete_license_text();
  109. /*!
  110. * Get all the supported file extensions in carla_load_file().
  111. * Returned string uses this syntax:
  112. * @code
  113. * "*.ext1;*.ext2;*.ext3"
  114. * @endcode
  115. */
  116. CARLA_EXPORT const char* carla_get_supported_file_extensions();
  117. /*!
  118. * Get how many cached plugins are available.
  119. * Internal, LV2 and AU plugin formats are cached and need to be discovered via this function.
  120. * Do not call this for any other plugin formats.
  121. */
  122. CARLA_EXPORT uint carla_get_cached_plugin_count(PluginType ptype, const char* pluginPath);
  123. /*!
  124. * Get information about a cached plugin.
  125. */
  126. CARLA_EXPORT const CarlaCachedPluginInfo* carla_get_cached_plugin_info(PluginType ptype, uint index);
  127. /* ------------------------------------------------------------------------------------------------------------
  128. * set stuff */
  129. /*!
  130. * Flush stdout or stderr.
  131. */
  132. CARLA_EXPORT void carla_fflush(bool err);
  133. /*!
  134. * Print the string @a string to stdout or stderr.
  135. */
  136. CARLA_EXPORT void carla_fputs(bool err, const char* string);
  137. /*!
  138. * Set the current process name to @a name.
  139. */
  140. CARLA_EXPORT void carla_set_process_name(const char* name);
  141. /* ------------------------------------------------------------------------------------------------------------
  142. * pipes */
  143. /*!
  144. * TODO.
  145. */
  146. CARLA_EXPORT CarlaPipeClientHandle carla_pipe_client_new(const char* argv[], CarlaPipeCallbackFunc callbackFunc, void* callbackPtr);
  147. /*!
  148. * TODO.
  149. */
  150. CARLA_EXPORT void carla_pipe_client_idle(CarlaPipeClientHandle handle);
  151. /*!
  152. * TODO.
  153. */
  154. CARLA_EXPORT bool carla_pipe_client_is_running(CarlaPipeClientHandle handle);
  155. /*!
  156. * TODO.
  157. */
  158. CARLA_EXPORT void carla_pipe_client_lock(CarlaPipeClientHandle handle);
  159. /*!
  160. * TODO.
  161. */
  162. CARLA_EXPORT void carla_pipe_client_unlock(CarlaPipeClientHandle handle);
  163. /*!
  164. * TODO.
  165. */
  166. CARLA_EXPORT const char* carla_pipe_client_readlineblock(CarlaPipeClientHandle handle, uint timeout);
  167. /*!
  168. * TODO.
  169. */
  170. CARLA_EXPORT bool carla_pipe_client_write_msg(CarlaPipeClientHandle handle, const char* msg);
  171. /*!
  172. * TODO.
  173. */
  174. CARLA_EXPORT bool carla_pipe_client_write_and_fix_msg(CarlaPipeClientHandle handle, const char* msg);
  175. /*!
  176. * TODO.
  177. */
  178. CARLA_EXPORT bool carla_pipe_client_flush(CarlaPipeClientHandle handle);
  179. /*!
  180. * TODO.
  181. */
  182. CARLA_EXPORT bool carla_pipe_client_flush_and_unlock(CarlaPipeClientHandle handle);
  183. /*!
  184. * TODO.
  185. */
  186. CARLA_EXPORT void carla_pipe_client_destroy(CarlaPipeClientHandle handle);
  187. /* ------------------------------------------------------------------------------------------------------------
  188. * info about current library */
  189. /*!
  190. * Get the absolute filename of this carla library.
  191. */
  192. CARLA_EXPORT const char* carla_get_library_filename();
  193. /*!
  194. * Get the folder where this carla library resides.
  195. */
  196. CARLA_EXPORT const char* carla_get_library_folder();
  197. // -------------------------------------------------------------------------------------------------------------------
  198. // TESTING
  199. CARLA_EXPORT void carla_x11_reparent_window(uintptr_t winId1, uintptr_t winId2);
  200. CARLA_EXPORT void carla_x11_move_window(uintptr_t winId, int x, int y);
  201. CARLA_EXPORT int* carla_x11_get_window_pos(uintptr_t winId);
  202. CARLA_EXPORT int carla_cocoa_get_window(void* nsViewPtr);
  203. // -------------------------------------------------------------------------------------------------------------------
  204. /** @} */
  205. #endif /* CARLA_UTILS_H_INCLUDED */