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.

223 lines
5.7KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2019 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. #ifdef HAVE_FLUIDSYNTH
  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. #ifdef HAVE_FLUIDSYNTH
  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_ZYN_DEPS
  122. "xmz", "xiz",
  123. #endif
  124. #ifdef CARLA_OS_MAC
  125. "vst",
  126. #else
  127. "dll",
  128. "so",
  129. #endif
  130. "vst3",
  131. // Audio files
  132. #ifdef HAVE_SNDFILE
  133. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg",
  134. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  135. #endif
  136. #ifdef HAVE_FFMPEG
  137. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  138. # ifndef HAVE_SNDFILE
  139. // FFmpeg without sndfile
  140. "flac", "oga", "ogg", "w64", "wav",
  141. # endif
  142. #endif
  143. // MIDI files
  144. "mid", "midi",
  145. // SFZ
  146. "sfz",
  147. // terminator
  148. nullptr
  149. };
  150. return extensions;
  151. }
  152. const char* const* carla_get_supported_features()
  153. {
  154. carla_debug("carla_get_supported_features()");
  155. static const char* const features[] = {
  156. #ifdef HAVE_FLUIDSYNTH
  157. "sf2",
  158. #endif
  159. #ifdef HAVE_HYLIA
  160. "link",
  161. #endif
  162. #ifdef HAVE_LIBLO
  163. "osc",
  164. #endif
  165. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  166. "bridges",
  167. #endif
  168. #ifdef HAVE_PYQT
  169. "gui",
  170. #endif
  171. #ifdef USING_JUCE
  172. "juce",
  173. "vst3",
  174. # if defined(CARLA_OS_MAC)
  175. "au",
  176. # endif
  177. #endif
  178. nullptr
  179. };
  180. return features;
  181. }
  182. // -------------------------------------------------------------------------------------------------------------------
  183. #ifndef CARLA_SKIP_HOST_COMMON
  184. # include "../CarlaHostCommon.cpp"
  185. #endif
  186. // -------------------------------------------------------------------------------------------------------------------