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.

277 lines
7.0KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2023 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. #ifdef HAVE_YSFX
  69. "<li>JSFX plugin support (using ysfx)</li>"
  70. #endif
  71. // Sample kit libraries
  72. #if defined(HAVE_FLUIDSYNTH) && !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH)
  73. "<li>FluidSynth library v" FLUIDSYNTH_VERSION " for SF2/3 support</li>"
  74. #endif
  75. "<li>SFZero module for SFZ support</li>"
  76. // misc libs
  77. "<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
  78. "<li>dr_mp3 for mp3 file support</li>"
  79. #ifdef HAVE_LIBLO
  80. "<li>liblo library for OSC support</li>"
  81. #endif
  82. #ifdef HAVE_SNDFILE
  83. "<li>libsndfile library for base audio file support</li>"
  84. #endif
  85. "<li>rtmempool library by Nedko Arnaudov</li>"
  86. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  87. #ifdef USING_RTAUDIO
  88. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  89. #endif
  90. "<li>zita-resampler for audio file sample rate resampling</li>"
  91. // Internal plugins
  92. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  93. // External plugins
  94. #ifdef HAVE_EXTERNAL_PLUGINS
  95. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  96. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  97. # ifdef HAVE_ZYN_DEPS
  98. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  99. # endif
  100. #endif // HAVE_EXTERNAL_PLUGINS
  101. // end
  102. "</ul>";
  103. }
  104. return retText;
  105. }
  106. const char* carla_get_juce_version()
  107. {
  108. carla_debug("carla_get_juce_version()");
  109. static CarlaString retVersion;
  110. #ifdef USING_JUCE
  111. if (retVersion.isEmpty())
  112. {
  113. if (const char* const version = CarlaJUCE::getVersion())
  114. retVersion = version+6;
  115. else
  116. retVersion = "Unknown";
  117. }
  118. #endif
  119. return retVersion;
  120. }
  121. const char* const* carla_get_supported_file_extensions()
  122. {
  123. carla_debug("carla_get_supported_file_extensions()");
  124. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  125. static const char* const extensions[] = {
  126. // Base types
  127. "carxp", "carxs",
  128. // plugin files and resources
  129. #ifdef HAVE_FLUIDSYNTH
  130. "sf2", "sf3",
  131. #endif
  132. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  133. "dls", "gig",
  134. #endif
  135. #ifdef HAVE_ZYN_DEPS
  136. "xmz", "xiz",
  137. #endif
  138. #ifdef CARLA_OS_MAC
  139. "vst",
  140. #else
  141. "dll",
  142. "so",
  143. #endif
  144. "vst3",
  145. "clap",
  146. // Audio files
  147. #ifdef HAVE_SNDFILE
  148. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg", "opus",
  149. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  150. #endif
  151. #ifdef HAVE_FFMPEG
  152. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  153. # ifndef HAVE_SNDFILE
  154. // FFmpeg without sndfile
  155. "flac", "oga", "ogg", "w64", "wav",
  156. # endif
  157. #else
  158. // dr_mp3
  159. "mp3",
  160. #endif
  161. // MIDI files
  162. "mid", "midi",
  163. // SFZ
  164. "sfz",
  165. #ifdef HAVE_YSFX
  166. // JSFX
  167. "jsfx",
  168. #endif
  169. // terminator
  170. nullptr
  171. };
  172. return extensions;
  173. }
  174. const char* const* carla_get_supported_features()
  175. {
  176. carla_debug("carla_get_supported_features()");
  177. static const char* const features[] = {
  178. #ifdef HAVE_FLUIDSYNTH
  179. "sf2",
  180. #endif
  181. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  182. "dls", "gig",
  183. #endif
  184. #ifdef HAVE_HYLIA
  185. "link",
  186. #endif
  187. #ifdef HAVE_LIBLO
  188. "osc",
  189. #endif
  190. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  191. "bridges",
  192. #endif
  193. #ifdef HAVE_PYQT
  194. "gui",
  195. #endif
  196. #ifdef HAVE_YSFX
  197. "jsfx",
  198. #endif
  199. #ifdef USING_JUCE
  200. "juce",
  201. # if defined(CARLA_OS_MAC)
  202. "au",
  203. # endif
  204. #endif
  205. nullptr
  206. };
  207. return features;
  208. }
  209. // -------------------------------------------------------------------------------------------------------------------
  210. const char* carla_get_library_filename()
  211. {
  212. carla_debug("carla_get_library_filename()");
  213. static CarlaString ret;
  214. if (ret.isEmpty())
  215. {
  216. using water::File;
  217. ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
  218. }
  219. return ret;
  220. }
  221. const char* carla_get_library_folder()
  222. {
  223. carla_debug("carla_get_library_folder()");
  224. static CarlaString ret;
  225. if (ret.isEmpty())
  226. {
  227. using water::File;
  228. ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
  229. }
  230. return ret;
  231. }
  232. // -------------------------------------------------------------------------------------------------------------------