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.

Information.cpp 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. // TODO mention jsfx
  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. #ifndef USING_JUCE
  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. // JSFX
  162. "jsfx",
  163. // terminator
  164. nullptr
  165. };
  166. return extensions;
  167. }
  168. const char* const* carla_get_supported_features()
  169. {
  170. carla_debug("carla_get_supported_features()");
  171. static const char* const features[] = {
  172. #ifdef HAVE_FLUIDSYNTH
  173. "sf2",
  174. #endif
  175. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  176. "dls", "gig",
  177. #endif
  178. #ifdef HAVE_HYLIA
  179. "link",
  180. #endif
  181. #ifdef HAVE_LIBLO
  182. "osc",
  183. #endif
  184. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  185. "bridges",
  186. #endif
  187. #ifdef HAVE_PYQT
  188. "gui",
  189. #endif
  190. #ifdef USING_JUCE
  191. "juce",
  192. "vst3",
  193. # if defined(CARLA_OS_MAC)
  194. "au",
  195. # endif
  196. #endif
  197. nullptr
  198. };
  199. return features;
  200. }
  201. // -------------------------------------------------------------------------------------------------------------------
  202. const char* carla_get_library_filename()
  203. {
  204. carla_debug("carla_get_library_filename()");
  205. static CarlaString ret;
  206. if (ret.isEmpty())
  207. {
  208. using water::File;
  209. ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
  210. }
  211. return ret;
  212. }
  213. const char* carla_get_library_folder()
  214. {
  215. carla_debug("carla_get_library_folder()");
  216. static CarlaString ret;
  217. if (ret.isEmpty())
  218. {
  219. using water::File;
  220. ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
  221. }
  222. return ret;
  223. }
  224. // -------------------------------------------------------------------------------------------------------------------