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.

281 lines
7.5KB

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