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.

228 lines
5.9KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2018 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. #ifdef USING_JUCE
  24. # include "AppConfig.h"
  25. # include "juce_core/juce_core.h"
  26. #else
  27. #if defined(__clang__)
  28. # pragma clang diagnostic push
  29. # pragma clang diagnostic ignored "-Wconversion"
  30. # pragma clang diagnostic ignored "-Weffc++"
  31. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  32. # pragma GCC diagnostic push
  33. # pragma GCC diagnostic ignored "-Wconversion"
  34. # pragma GCC diagnostic ignored "-Weffc++"
  35. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  36. #endif
  37. #include "rtaudio/RtAudio.h"
  38. #include "rtmidi/RtMidi.h"
  39. #if defined(__clang__)
  40. # pragma clang diagnostic pop
  41. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  42. # pragma GCC diagnostic pop
  43. #endif
  44. #endif
  45. #include "water/files/File.h"
  46. // -------------------------------------------------------------------------------------------------------------------
  47. const char* carla_get_complete_license_text()
  48. {
  49. carla_debug("carla_get_complete_license_text()");
  50. static CarlaString retText;
  51. if (retText.isEmpty())
  52. {
  53. retText =
  54. "<p>This current Carla build is using the following features and 3rd-party code:</p>"
  55. "<ul>"
  56. // Plugin formats
  57. "<li>LADSPA plugin support</li>"
  58. "<li>DSSI plugin support</li>"
  59. "<li>LV2 plugin support</li>"
  60. #if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  61. "<li>VST2/2 plugin support (using Juce)</li>"
  62. #else
  63. "<li>VST2 plugin support (using VeSTige header by Javier Serrano Polo)</li>"
  64. #endif
  65. #if defined(USING_JUCE) && defined(CARLA_OS_MAC)
  66. "<li>AU plugin support (using Juce)</li>"
  67. #endif
  68. // Sample kit libraries
  69. #ifdef HAVE_FLUIDSYNTH
  70. "<li>FluidSynth library v" FLUIDSYNTH_VERSION " for SF2/3 support</li>"
  71. #endif
  72. "<li>SFZero module for SFZ support</li>"
  73. // misc libs
  74. "<li>base64 utilities based on code by Ren\u00E9 Nyffenegger</li>"
  75. "<li>liblo library for OSC support</li>"
  76. "<li>rtmempool library by Nedko Arnaudov"
  77. "<li>serd, sord, sratom and lilv libraries for LV2 discovery</li>"
  78. #ifndef USING_JUCE
  79. "<li>RtAudio v" RTAUDIO_VERSION " and RtMidi v" RTMIDI_VERSION " for native Audio and MIDI support</li>"
  80. #endif
  81. // Internal plugins
  82. "<li>MIDI Sequencer UI code by Perry Nguyen</li>"
  83. // External plugins
  84. #ifdef HAVE_EXTERNAL_PLUGINS
  85. "<li>Nekobi plugin code based on nekobee by Sean Bolton and others</li>"
  86. "<li>VectorJuice and WobbleJuice plugin code by Andre Sklenar</li>"
  87. # ifdef HAVE_ZYN_DEPS
  88. "<li>ZynAddSubFX plugin code by Mark McCurry and Nasca Octavian Paul</li>"
  89. # endif
  90. #endif // HAVE_EXTERNAL_PLUGINS
  91. // end
  92. "</ul>";
  93. }
  94. return retText;
  95. }
  96. const char* carla_get_juce_version()
  97. {
  98. carla_debug("carla_get_juce_version()");
  99. static CarlaString retVersion;
  100. #ifdef USING_JUCE
  101. if (retVersion.isEmpty())
  102. {
  103. if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8())
  104. retVersion = version+6;
  105. else
  106. retVersion = "Unknown";
  107. }
  108. #endif
  109. return retVersion;
  110. }
  111. const char* const* carla_get_supported_file_extensions()
  112. {
  113. carla_debug("carla_get_supported_file_extensions()");
  114. // NOTE: please keep in sync with CarlaEngine::loadFile!!
  115. static const char* const extensions[] = {
  116. // Base types
  117. "carxp", "carxs",
  118. // plugin files and resources
  119. #ifdef HAVE_FLUIDSYNTH
  120. "sf2", "sf3",
  121. #endif
  122. #ifdef HAVE_ZYN_DEPS
  123. "xmz", "xiz",
  124. #endif
  125. #ifdef CARLA_OS_MAC
  126. "vst",
  127. #else
  128. "dll",
  129. "so",
  130. #endif
  131. #if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  132. "vst3",
  133. #endif
  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_HYLIA
  163. "link",
  164. #endif
  165. #ifdef HAVE_LIBLO
  166. "osc",
  167. #endif
  168. #if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN)
  169. "bridges",
  170. #endif
  171. #ifdef HAVE_PYQT
  172. "gui",
  173. #endif
  174. #ifdef USING_JUCE
  175. "juce",
  176. # if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
  177. "vst3",
  178. # endif
  179. # if defined(CARLA_OS_MAC)
  180. "au",
  181. # endif
  182. #endif
  183. nullptr
  184. };
  185. return features;
  186. }
  187. // -------------------------------------------------------------------------------------------------------------------
  188. #include "../CarlaHostCommon.cpp"
  189. // -------------------------------------------------------------------------------------------------------------------