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.

269 lines
6.8KB

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