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.

269 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. #ifdef CARLA_OS_MAC
  42. # import <AppKit/AppKit.h>
  43. #endif
  44. #include "water/files/File.h"
  45. // -------------------------------------------------------------------------------------------------------------------
  46. const char* carla_get_complete_license_text()
  47. {
  48. carla_debug("carla_get_complete_license_text()");
  49. static CarlaString retText;
  50. if (retText.isEmpty())
  51. {
  52. retText =
  53. "<p>This current Carla build is using the following features and 3rd-party code:</p>"
  54. "<ul>"
  55. // Plugin formats
  56. "<li>LADSPA plugin support</li>"
  57. "<li>DSSI plugin support</li>"
  58. "<li>LV2 plugin support</li>"
  59. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST
  60. "<li>VST2 plugin support (using JUCE)</li>"
  61. #else
  62. "<li>VST2 plugin support (using VeSTige header by Javier Serrano Polo)</li>"
  63. #endif
  64. #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST3
  65. "<li>VST3 plugin support (using JUCE)</li>"
  66. #endif
  67. #if defined(USING_JUCE) && JUCE_PLUGINHOST_AU
  68. "<li>AU plugin support (using JUCE)</li>"
  69. #endif
  70. // Sample kit libraries
  71. #if defined(HAVE_FLUIDSYNTH) && !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH)
  72. "<li>FluidSynth library v" FLUIDSYNTH_VERSION " for SF2/3 support</li>"
  73. #endif
  74. "<li>SFZero module for SFZ support</li>"
  75. // misc libs
  76. "<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
  77. "<li>dr_mp3 for mp3 file support</li>"
  78. #ifdef HAVE_LIBLO
  79. "<li>liblo library for OSC support</li>"
  80. #endif
  81. #ifdef HAVE_SNDFILE
  82. "<li>libsndfile library for base audio file support</li>"
  83. #endif
  84. "<li>rtmempool library by Nedko Arnaudov"
  85. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  86. #ifndef USING_JUCE
  87. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  88. #endif
  89. "<li>zita-resampler for audio file sample rate resampling</li>"
  90. // Internal plugins
  91. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  92. // External plugins
  93. #ifdef HAVE_EXTERNAL_PLUGINS
  94. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  95. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  96. # ifdef HAVE_ZYN_DEPS
  97. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  98. # endif
  99. #endif // HAVE_EXTERNAL_PLUGINS
  100. // end
  101. "</ul>";
  102. }
  103. return retText;
  104. }
  105. const char* carla_get_juce_version()
  106. {
  107. carla_debug("carla_get_juce_version()");
  108. static CarlaString retVersion;
  109. #ifdef USING_JUCE
  110. if (retVersion.isEmpty())
  111. {
  112. if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
  113. retVersion = version+6;
  114. else
  115. retVersion = "Unknown";
  116. }
  117. #endif
  118. return retVersion;
  119. }
  120. const char* const* carla_get_supported_file_extensions()
  121. {
  122. carla_debug("carla_get_supported_file_extensions()");
  123. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  124. static const char* const extensions[] = {
  125. // Base types
  126. "carxp", "carxs",
  127. // plugin files and resources
  128. #ifdef HAVE_FLUIDSYNTH
  129. "sf2", "sf3",
  130. #endif
  131. #ifdef HAVE_FLUIDSYNTH_INSTPATCH
  132. "dls", "gig",
  133. #endif
  134. #ifdef HAVE_ZYN_DEPS
  135. "xmz", "xiz",
  136. #endif
  137. #ifdef CARLA_OS_MAC
  138. "vst",
  139. #else
  140. "dll",
  141. "so",
  142. #endif
  143. "vst3",
  144. // Audio files
  145. #ifdef HAVE_SNDFILE
  146. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg", "opus",
  147. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  148. #endif
  149. #ifdef HAVE_FFMPEG
  150. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  151. # ifndef HAVE_SNDFILE
  152. // FFmpeg without sndfile
  153. "flac", "oga", "ogg", "w64", "wav",
  154. # endif
  155. #else
  156. // dr_mp3
  157. "mp3",
  158. #endif
  159. // MIDI files
  160. "mid", "midi",
  161. // SFZ
  162. "sfz",
  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. // -------------------------------------------------------------------------------------------------------------------