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.

251 lines
6.6KB

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