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.

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