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.

200 lines
6.7KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifdef JUCE_AUDIO_DEVICES_H_INCLUDED
  18. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  19. already included any other headers - just put it inside a file on its own, possibly with your config
  20. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  21. header files that the compiler may be using.
  22. */
  23. #error "Incorrect use of JUCE cpp file"
  24. #endif
  25. #include "AppConfig.h"
  26. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  27. #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
  28. #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
  29. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  30. #define JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW 1
  31. #include "juce_audio_devices.h"
  32. //==============================================================================
  33. #if JUCE_MAC
  34. #define Point CarbonDummyPointName
  35. #define Component CarbonDummyCompName
  36. #import <CoreAudio/AudioHardware.h>
  37. #import <CoreMIDI/MIDIServices.h>
  38. #import <AudioToolbox/AudioServices.h>
  39. #undef Point
  40. #undef Component
  41. #elif JUCE_IOS
  42. #import <AudioToolbox/AudioToolbox.h>
  43. #import <AVFoundation/AVFoundation.h>
  44. #import <CoreMIDI/MIDIServices.h>
  45. #if TARGET_OS_SIMULATOR
  46. #import <CoreMIDI/MIDINetworkSession.h>
  47. #endif
  48. //==============================================================================
  49. #elif JUCE_WINDOWS
  50. #if JUCE_WASAPI
  51. #include <mmreg.h>
  52. #endif
  53. #if JUCE_ASIO
  54. /* This is very frustrating - we only need to use a handful of definitions from
  55. a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy
  56. about 30 lines of code into this cpp file to create a fully stand-alone ASIO
  57. implementation...
  58. ..unfortunately that would break Steinberg's license agreement for use of
  59. their SDK, so I'm not allowed to do this.
  60. This means that anyone who wants to use JUCE's ASIO abilities will have to:
  61. 1) Agree to Steinberg's licensing terms and download the ASIO SDK
  62. (see http://www.steinberg.net/en/company/developers.html).
  63. 2) Enable this code with a global definition #define JUCE_ASIO 1.
  64. 3) Make sure that your header search path contains the iasiodrv.h file that
  65. comes with the SDK. (Only about a handful of the SDK header files are actually
  66. needed - so to simplify things, you could just copy these into your JUCE directory).
  67. */
  68. #include <iasiodrv.h>
  69. #endif
  70. //==============================================================================
  71. #elif JUCE_LINUX
  72. #if JUCE_ALSA
  73. /* Got an include error here? If so, you've either not got ALSA installed, or you've
  74. not got your paths set up correctly to find its header files.
  75. The package you need to install to get ASLA support is "libasound2-dev".
  76. If you don't have the ALSA library and don't want to build Juce with audio support,
  77. just set the JUCE_ALSA flag to 0.
  78. */
  79. #include <alsa/asoundlib.h>
  80. #endif
  81. #if JUCE_JACK
  82. /* Got an include error here? If so, you've either not got jack-audio-connection-kit
  83. installed, or you've not got your paths set up correctly to find its header files.
  84. The package you need to install to get JACK support is "libjack-dev".
  85. If you don't have the jack-audio-connection-kit library and don't want to build
  86. Juce with low latency audio support, just set the JUCE_JACK flag to 0.
  87. */
  88. #include <jack/jack.h>
  89. #endif
  90. #undef SIZEOF
  91. //==============================================================================
  92. #elif JUCE_ANDROID
  93. #if JUCE_USE_ANDROID_OPENSLES
  94. #include <SLES/OpenSLES.h>
  95. #include <SLES/OpenSLES_Android.h>
  96. #include <SLES/OpenSLES_AndroidConfiguration.h>
  97. #endif
  98. #endif
  99. namespace juce
  100. {
  101. #include "audio_io/juce_AudioDeviceManager.cpp"
  102. #include "audio_io/juce_AudioIODevice.cpp"
  103. #include "audio_io/juce_AudioIODeviceType.cpp"
  104. #include "midi_io/juce_MidiMessageCollector.cpp"
  105. #include "midi_io/juce_MidiOutput.cpp"
  106. #include "sources/juce_AudioSourcePlayer.cpp"
  107. #include "sources/juce_AudioTransportSource.cpp"
  108. #include "native/juce_MidiDataConcatenator.h"
  109. //==============================================================================
  110. #if JUCE_MAC
  111. #include "native/juce_mac_CoreAudio.cpp"
  112. #include "native/juce_mac_CoreMidi.cpp"
  113. //==============================================================================
  114. #elif JUCE_IOS
  115. #include "native/juce_ios_Audio.cpp"
  116. #include "native/juce_mac_CoreMidi.cpp"
  117. //==============================================================================
  118. #elif JUCE_WINDOWS
  119. #if JUCE_WASAPI
  120. #include "native/juce_win32_WASAPI.cpp"
  121. #endif
  122. #if JUCE_DIRECTSOUND
  123. #include "native/juce_win32_DirectSound.cpp"
  124. #endif
  125. #include "native/juce_win32_Midi.cpp"
  126. #if JUCE_ASIO
  127. #include "native/juce_win32_ASIO.cpp"
  128. #endif
  129. //==============================================================================
  130. #elif JUCE_LINUX
  131. #if JUCE_ALSA
  132. #include "native/juce_linux_ALSA.cpp"
  133. #endif
  134. #include "native/juce_linux_Midi.cpp"
  135. #if JUCE_JACK
  136. #include "native/juce_linux_JackAudio.cpp"
  137. #endif
  138. //==============================================================================
  139. #elif JUCE_ANDROID
  140. #include "native/juce_android_Audio.cpp"
  141. #include "native/juce_android_Midi.cpp"
  142. #if JUCE_USE_ANDROID_OPENSLES
  143. #include "native/juce_android_OpenSL.cpp"
  144. #endif
  145. #endif
  146. #if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED
  147. // None of these methods are available. (On Windows you might need to enable WASAPI for this)
  148. float JUCE_CALLTYPE SystemAudioVolume::getGain() { jassertfalse; return 0.0f; }
  149. bool JUCE_CALLTYPE SystemAudioVolume::setGain (float) { jassertfalse; return false; }
  150. bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { jassertfalse; return false; }
  151. bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool) { jassertfalse; return false; }
  152. #endif
  153. }