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.

265 lines
6.8KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2021 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 "CarlaHost.h"
  18. #include "CarlaUtils.h"
  19. #include "CarlaString.hpp"
  20. #if defined(HAVE_FLUIDSYNTH) && !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH)
  21. # include <fluidsynth.h>
  22. #endif
  23. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  24. # pragma GCC diagnostic push
  25. # pragma GCC diagnostic ignored "-Wconversion"
  26. # pragma GCC diagnostic ignored "-Weffc++"
  27. # pragma GCC diagnostic ignored "-Wsign-conversion"
  28. # pragma GCC diagnostic ignored "-Wundef"
  29. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  30. #endif
  31. #ifdef USING_JUCE
  32. # include "AppConfig.h"
  33. # include "juce_core/juce_core.h"
  34. #else
  35. # include "rtaudio/RtAudio.h"
  36. # include "rtmidi/RtMidi.h"
  37. #endif
  38. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  39. # pragma GCC diagnostic pop
  40. #endif
  41. #include "water/files/File.h"
  42. // -------------------------------------------------------------------------------------------------------------------
  43. const char* carla_get_complete_license_text()
  44. {
  45. carla_debug("carla_get_complete_license_text()");
  46. static CarlaString retText;
  47. if (retText.isEmpty())
  48. {
  49. retText =
  50. "<p>This current Carla build is using the following features and 3rd-party code:</p>"
  51. "<ul>"
  52. // Plugin formats
  53. "<li>LADSPA plugin support</li>"
  54. "<li>DSSI plugin support</li>"
  55. "<li>LV2 plugin support</li>"
  56. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST
  57. "<li>VST2 plugin support (using JUCE)</li>"
  58. #else
  59. "<li>VST2 plugin support (using VeSTige header by Javier Serrano Polo)</li>"
  60. #endif
  61. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST3
  62. "<li>VST3 plugin support (using JUCE)</li>"
  63. #endif
  64. #if defined(USING_JUCE) && JUCE_PLUGINHOST_AU
  65. "<li>AU plugin support (using JUCE)</li>"
  66. #endif
  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. #ifndef USING_JUCE
  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 = juce::SystemStats::getJUCEVersion().toRawUTF8())
  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. // terminator
  161. nullptr
  162. };
  163. return extensions;
  164. }
  165. const char* const* carla_get_supported_features()
  166. {
  167. carla_debug("carla_get_supported_features()");
  168. static const char* const features[] = {
  169. #ifdef HAVE_FLUIDSYNTH
  170. "sf2",
  171. #endif
  172. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  173. "dls", "gig",
  174. #endif
  175. #ifdef HAVE_HYLIA
  176. "link",
  177. #endif
  178. #ifdef HAVE_LIBLO
  179. "osc",
  180. #endif
  181. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  182. "bridges",
  183. #endif
  184. #ifdef HAVE_PYQT
  185. "gui",
  186. #endif
  187. #ifdef USING_JUCE
  188. "juce",
  189. "vst3",
  190. # if defined(CARLA_OS_MAC)
  191. "au",
  192. # endif
  193. #endif
  194. nullptr
  195. };
  196. return features;
  197. }
  198. // -------------------------------------------------------------------------------------------------------------------
  199. const char* carla_get_library_filename()
  200. {
  201. carla_debug("carla_get_library_filename()");
  202. static CarlaString ret;
  203. if (ret.isEmpty())
  204. {
  205. using water::File;
  206. ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
  207. }
  208. return ret;
  209. }
  210. const char* carla_get_library_folder()
  211. {
  212. carla_debug("carla_get_library_folder()");
  213. static CarlaString ret;
  214. if (ret.isEmpty())
  215. {
  216. using water::File;
  217. ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
  218. }
  219. return ret;
  220. }
  221. // -------------------------------------------------------------------------------------------------------------------