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.

224 lines
5.8KB

  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) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  57. "<li>VST2/2 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) && defined(CARLA_OS_MAC)
  62. "<li>AU plugin support (using Juce)</li>"
  63. #endif
  64. // Sample kit libraries
  65. #ifdef HAVE_FLUIDSYNTH
  66. "<li>FluidSynth library v" FLUIDSYNTH_VERSION " for SF2/3 support</li>"
  67. #endif
  68. "<li>SFZero module for SFZ support</li>"
  69. // misc libs
  70. "<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
  71. "<li>liblo library for OSC support</li>"
  72. "<li>rtmempool library by Nedko Arnaudov"
  73. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  74. #ifndef USING_JUCE
  75. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  76. #endif
  77. // Internal plugins
  78. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  79. // External plugins
  80. #ifdef HAVE_EXTERNAL_PLUGINS
  81. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  82. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  83. # ifdef HAVE_ZYN_DEPS
  84. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  85. # endif
  86. #endif // HAVE_EXTERNAL_PLUGINS
  87. // end
  88. "</ul>";
  89. }
  90. return retText;
  91. }
  92. const char* carla_get_juce_version()
  93. {
  94. carla_debug("carla_get_juce_version()");
  95. static CarlaString retVersion;
  96. #ifdef USING_JUCE
  97. if (retVersion.isEmpty())
  98. {
  99. if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
  100. retVersion = version+6;
  101. else
  102. retVersion = "Unknown";
  103. }
  104. #endif
  105. return retVersion;
  106. }
  107. const char* const* carla_get_supported_file_extensions()
  108. {
  109. carla_debug("carla_get_supported_file_extensions()");
  110. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  111. static const char* const extensions[] = {
  112. // Base types
  113. "carxp", "carxs",
  114. // plugin files and resources
  115. #ifdef HAVE_FLUIDSYNTH
  116. "sf2", "sf3",
  117. #endif
  118. #ifdef HAVE_ZYN_DEPS
  119. "xmz", "xiz",
  120. #endif
  121. #ifdef CARLA_OS_MAC
  122. "vst",
  123. #else
  124. "dll",
  125. "so",
  126. #endif
  127. #if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  128. "vst3",
  129. #endif
  130. // Audio files
  131. #ifdef HAVE_SNDFILE
  132. "aif", "aifc", "aiff", "au", "bwf", "flac", "htk", "iff", "mat4", "mat5", "oga", "ogg",
  133. "paf", "pvf", "pvf5", "sd2", "sf", "snd", "svx", "vcc", "w64", "wav", "xi",
  134. #endif
  135. #ifdef HAVE_FFMPEG
  136. "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma",
  137. # ifndef HAVE_SNDFILE
  138. // FFmpeg without sndfile
  139. "flac", "oga", "ogg", "w64", "wav",
  140. # endif
  141. #endif
  142. // MIDI files
  143. "mid", "midi",
  144. // SFZ
  145. "sfz",
  146. // terminator
  147. nullptr
  148. };
  149. return extensions;
  150. }
  151. const char* const* carla_get_supported_features()
  152. {
  153. carla_debug("carla_get_supported_features()");
  154. static const char* const features[] = {
  155. #ifdef HAVE_FLUIDSYNTH
  156. "sf2",
  157. #endif
  158. #ifdef HAVE_HYLIA
  159. "link",
  160. #endif
  161. #ifdef HAVE_LIBLO
  162. "osc",
  163. #endif
  164. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  165. "bridges",
  166. #endif
  167. #ifdef HAVE_PYQT
  168. "gui",
  169. #endif
  170. #ifdef USING_JUCE
  171. "juce",
  172. # if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
  173. "vst3",
  174. # endif
  175. # if defined(CARLA_OS_MAC)
  176. "au",
  177. # endif
  178. #endif
  179. nullptr
  180. };
  181. return features;
  182. }
  183. // -------------------------------------------------------------------------------------------------------------------
  184. #ifndef CARLA_SKIP_HOST_COMMON
  185. # include "../CarlaHostCommon.cpp"
  186. #endif
  187. // -------------------------------------------------------------------------------------------------------------------