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.

264 lines
6.7KB

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