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.

270 lines
6.9KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2022 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. #include "CarlaUtils.h"
  18. #include "CarlaString.hpp"
  19. #if defined(HAVE_FLUIDSYNTH) && !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH)
  20. # include <fluidsynth.h>
  21. #endif
  22. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  23. # pragma GCC diagnostic push
  24. # pragma GCC diagnostic ignored "-Wconversion"
  25. # pragma GCC diagnostic ignored "-Weffc++"
  26. # pragma GCC diagnostic ignored "-Wsign-conversion"
  27. # pragma GCC diagnostic ignored "-Wundef"
  28. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  29. #endif
  30. #ifdef USING_JUCE
  31. # include "carla_juce/carla_juce.h"
  32. #endif
  33. #ifdef USING_RTAUDIO
  34. # include "rtaudio/RtAudio.h"
  35. # include "rtmidi/RtMidi.h"
  36. #endif
  37. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  38. # pragma GCC diagnostic pop
  39. #endif
  40. #include "water/files/File.h"
  41. // -------------------------------------------------------------------------------------------------------------------
  42. const char* carla_get_complete_license_text()
  43. {
  44. carla_debug("carla_get_complete_license_text()");
  45. static CarlaString retText;
  46. if (retText.isEmpty())
  47. {
  48. retText =
  49. "<p>This current Carla build is using the following features and 3rd-party code:</p>"
  50. "<ul>"
  51. // Plugin formats
  52. "<li>LADSPA plugin support</li>"
  53. "<li>DSSI plugin support</li>"
  54. "<li>LV2 plugin support</li>"
  55. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST
  56. "<li>VST2 plugin support (using JUCE)</li>"
  57. #else
  58. "<li>VST2 plugin support (using VeSTige header by Javier Serrano Polo)</li>"
  59. #endif
  60. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST3
  61. "<li>VST3 plugin support (using JUCE)</li>"
  62. #else
  63. "<li>VST3 plugin support (using Travesty header files)</li>"
  64. #endif
  65. #if defined(USING_JUCE) && JUCE_PLUGINHOST_AU
  66. "<li>AU plugin support (using JUCE)</li>"
  67. #endif
  68. "<li>JSFX plugin support (using ysfx)</li>"
  69. // Sample kit libraries
  70. #if defined(HAVE_FLUIDSYNTH) && !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH)
  71. "<li>FluidSynth library v" FLUIDSYNTH_VERSION " for SF2/3 support</li>"
  72. #endif
  73. "<li>SFZero module for SFZ support</li>"
  74. // misc libs
  75. "<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
  76. "<li>dr_mp3 for mp3 file support</li>"
  77. #ifdef HAVE_LIBLO
  78. "<li>liblo library for OSC support</li>"
  79. #endif
  80. #ifdef HAVE_SNDFILE
  81. "<li>libsndfile library for base audio file support</li>"
  82. #endif
  83. "<li>rtmempool library by Nedko Arnaudov</li>"
  84. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  85. #ifdef USING_RTAUDIO
  86. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  87. #endif
  88. "<li>zita-resampler for audio file sample rate resampling</li>"
  89. // Internal plugins
  90. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  91. // External plugins
  92. #ifdef HAVE_EXTERNAL_PLUGINS
  93. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  94. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  95. # ifdef HAVE_ZYN_DEPS
  96. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  97. # endif
  98. #endif // HAVE_EXTERNAL_PLUGINS
  99. // end
  100. "</ul>";
  101. }
  102. return retText;
  103. }
  104. const char* carla_get_juce_version()
  105. {
  106. carla_debug("carla_get_juce_version()");
  107. static CarlaString retVersion;
  108. #ifdef USING_JUCE
  109. if (retVersion.isEmpty())
  110. {
  111. if (const char* const version = CarlaJUCE::getVersion())
  112. retVersion = version+6;
  113. else
  114. retVersion = "Unknown";
  115. }
  116. #endif
  117. return retVersion;
  118. }
  119. const char* const* carla_get_supported_file_extensions()
  120. {
  121. carla_debug("carla_get_supported_file_extensions()");
  122. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  123. static const char* const extensions[] = {
  124. // Base types
  125. "carxp", "carxs",
  126. // plugin files and resources
  127. #ifdef HAVE_FLUIDSYNTH
  128. "sf2", "sf3",
  129. #endif
  130. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  131. "dls", "gig",
  132. #endif
  133. #ifdef HAVE_ZYN_DEPS
  134. "xmz", "xiz",
  135. #endif
  136. #ifdef CARLA_OS_MAC
  137. "vst",
  138. #else
  139. "dll",
  140. "so",
  141. #endif
  142. "vst3",
  143. // Audio files
  144. #ifdef HAVE_SNDFILE
  145. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg", "opus",
  146. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  147. #endif
  148. #ifdef HAVE_FFMPEG
  149. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  150. # ifndef HAVE_SNDFILE
  151. // FFmpeg without sndfile
  152. "flac", "oga", "ogg", "w64", "wav",
  153. # endif
  154. #else
  155. // dr_mp3
  156. "mp3",
  157. #endif
  158. // MIDI files
  159. "mid", "midi",
  160. // SFZ
  161. "sfz",
  162. // JSFX
  163. "jsfx",
  164. // terminator
  165. nullptr
  166. };
  167. return extensions;
  168. }
  169. const char* const* carla_get_supported_features()
  170. {
  171. carla_debug("carla_get_supported_features()");
  172. static const char* const features[] = {
  173. #ifdef HAVE_FLUIDSYNTH
  174. "sf2",
  175. #endif
  176. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  177. "dls", "gig",
  178. #endif
  179. #ifdef HAVE_HYLIA
  180. "link",
  181. #endif
  182. #ifdef HAVE_LIBLO
  183. "osc",
  184. #endif
  185. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  186. "bridges",
  187. #endif
  188. #ifdef HAVE_PYQT
  189. "gui",
  190. #endif
  191. #ifdef USING_JUCE
  192. "juce",
  193. # if defined(CARLA_OS_MAC)
  194. "au",
  195. # endif
  196. #endif
  197. nullptr
  198. };
  199. return features;
  200. }
  201. // -------------------------------------------------------------------------------------------------------------------
  202. const char* carla_get_library_filename()
  203. {
  204. carla_debug("carla_get_library_filename()");
  205. static CarlaString ret;
  206. if (ret.isEmpty())
  207. {
  208. using water::File;
  209. ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
  210. }
  211. return ret;
  212. }
  213. const char* carla_get_library_folder()
  214. {
  215. carla_debug("carla_get_library_folder()");
  216. static CarlaString ret;
  217. if (ret.isEmpty())
  218. {
  219. using water::File;
  220. ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
  221. }
  222. return ret;
  223. }
  224. // -------------------------------------------------------------------------------------------------------------------