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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2020 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>liblo library for OSC support</li>"
  75. "<li>rtmempool library by Nedko Arnaudov"
  76. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  77. #ifndef USING_JUCE
  78. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  79. #endif
  80. // Internal plugins
  81. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  82. // External plugins
  83. #ifdef HAVE_EXTERNAL_PLUGINS
  84. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  85. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  86. # ifdef HAVE_ZYN_DEPS
  87. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  88. # endif
  89. #endif // HAVE_EXTERNAL_PLUGINS
  90. // end
  91. "</ul>";
  92. }
  93. return retText;
  94. }
  95. const char* carla_get_juce_version()
  96. {
  97. carla_debug("carla_get_juce_version()");
  98. static CarlaString retVersion;
  99. #ifdef USING_JUCE
  100. if (retVersion.isEmpty())
  101. {
  102. if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
  103. retVersion = version+6;
  104. else
  105. retVersion = "Unknown";
  106. }
  107. #endif
  108. return retVersion;
  109. }
  110. const char* const* carla_get_supported_file_extensions()
  111. {
  112. carla_debug("carla_get_supported_file_extensions()");
  113. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  114. static const char* const extensions[] = {
  115. // Base types
  116. "carxp", "carxs",
  117. // plugin files and resources
  118. #ifdef HAVE_FLUIDSYNTH
  119. "sf2", "sf3",
  120. #endif
  121. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  122. "dls", "gig",
  123. #endif
  124. #ifdef HAVE_ZYN_DEPS
  125. "xmz", "xiz",
  126. #endif
  127. #ifdef CARLA_OS_MAC
  128. "vst",
  129. #else
  130. "dll",
  131. "so",
  132. #endif
  133. "vst3",
  134. // Audio files
  135. #ifdef HAVE_SNDFILE
  136. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg",
  137. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  138. #endif
  139. #ifdef HAVE_FFMPEG
  140. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  141. # ifndef HAVE_SNDFILE
  142. // FFmpeg without sndfile
  143. "flac", "oga", "ogg", "w64", "wav",
  144. # endif
  145. #endif
  146. // MIDI files
  147. "mid", "midi",
  148. // SFZ
  149. "sfz",
  150. // terminator
  151. nullptr
  152. };
  153. return extensions;
  154. }
  155. const char* const* carla_get_supported_features()
  156. {
  157. carla_debug("carla_get_supported_features()");
  158. static const char* const features[] = {
  159. #ifdef HAVE_FLUIDSYNTH
  160. "sf2",
  161. #endif
  162. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  163. "dls", "gig",
  164. #endif
  165. #ifdef HAVE_HYLIA
  166. "link",
  167. #endif
  168. #ifdef HAVE_LIBLO
  169. "osc",
  170. #endif
  171. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  172. "bridges",
  173. #endif
  174. #ifdef HAVE_PYQT
  175. "gui",
  176. #endif
  177. #ifdef USING_JUCE
  178. "juce",
  179. "vst3",
  180. # if defined(CARLA_OS_MAC)
  181. "au",
  182. # endif
  183. #endif
  184. nullptr
  185. };
  186. return features;
  187. }
  188. // -------------------------------------------------------------------------------------------------------------------
  189. const char* carla_get_library_filename()
  190. {
  191. carla_debug("carla_get_library_filename()");
  192. static CarlaString ret;
  193. if (ret.isEmpty())
  194. {
  195. using water::File;
  196. ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
  197. }
  198. return ret;
  199. }
  200. const char* carla_get_library_folder()
  201. {
  202. carla_debug("carla_get_library_folder()");
  203. static CarlaString ret;
  204. if (ret.isEmpty())
  205. {
  206. using water::File;
  207. ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
  208. }
  209. return ret;
  210. }
  211. // -------------------------------------------------------------------------------------------------------------------