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.

226 lines
6.0KB

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