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
7.5KB

  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 "../juce_core/native/juce_BasicNativeHeaders.h"
  26. #include "juce_audio_devices.h"
  27. //==============================================================================
  28. #if JUCE_MAC
  29. #define Point CarbonDummyPointName
  30. #define Component CarbonDummyCompName
  31. #import <CoreAudio/AudioHardware.h>
  32. #import <CoreMIDI/MIDIServices.h>
  33. #import <DiscRecording/DiscRecording.h>
  34. #import <AudioToolbox/AudioServices.h>
  35. #undef Point
  36. #undef Component
  37. #elif JUCE_IOS
  38. #import <AudioToolbox/AudioToolbox.h>
  39. #import <AVFoundation/AVFoundation.h>
  40. #import <CoreMIDI/MIDIServices.h>
  41. //==============================================================================
  42. #elif JUCE_WINDOWS
  43. #if JUCE_WASAPI
  44. #include <MMReg.h>
  45. #endif
  46. #if JUCE_ASIO
  47. /* This is very frustrating - we only need to use a handful of definitions from
  48. a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy
  49. about 30 lines of code into this cpp file to create a fully stand-alone ASIO
  50. implementation...
  51. ..unfortunately that would break Steinberg's license agreement for use of
  52. their SDK, so I'm not allowed to do this.
  53. This means that anyone who wants to use JUCE's ASIO abilities will have to:
  54. 1) Agree to Steinberg's licensing terms and download the ASIO SDK
  55. (see http://www.steinberg.net/en/company/developers.html).
  56. 2) Enable this code with a global definition #define JUCE_ASIO 1.
  57. 3) Make sure that your header search path contains the iasiodrv.h file that
  58. comes with the SDK. (Only about a handful of the SDK header files are actually
  59. needed - so to simplify things, you could just copy these into your JUCE directory).
  60. */
  61. #include <iasiodrv.h>
  62. #endif
  63. #if JUCE_USE_CDBURNER
  64. /* You'll need the Platform SDK for these headers - if you don't have it and don't
  65. need to use CD-burning, then you might just want to set the JUCE_USE_CDBURNER flag
  66. to 0, to avoid these includes.
  67. */
  68. #include <imapi.h>
  69. #include <imapierror.h>
  70. #endif
  71. //==============================================================================
  72. #elif JUCE_LINUX
  73. #if JUCE_ALSA
  74. /* Got an include error here? If so, you've either not got ALSA installed, or you've
  75. not got your paths set up correctly to find its header files.
  76. The package you need to install to get ASLA support is "libasound2-dev".
  77. If you don't have the ALSA library and don't want to build Juce with audio support,
  78. just set the JUCE_ALSA flag to 0.
  79. */
  80. #include <alsa/asoundlib.h>
  81. #endif
  82. #if JUCE_JACK
  83. /* Got an include error here? If so, you've either not got jack-audio-connection-kit
  84. installed, or you've not got your paths set up correctly to find its header files.
  85. The package you need to install to get JACK support is "libjack-dev".
  86. If you don't have the jack-audio-connection-kit library and don't want to build
  87. Juce with low latency audio support, just set the JUCE_JACK flag to 0.
  88. */
  89. #include <jack/jack.h>
  90. #endif
  91. #undef SIZEOF
  92. //==============================================================================
  93. #elif JUCE_ANDROID
  94. #if JUCE_USE_ANDROID_OPENSLES
  95. #include <SLES/OpenSLES.h>
  96. #include <SLES/OpenSLES_Android.h>
  97. #include <SLES/OpenSLES_AndroidConfiguration.h>
  98. #endif
  99. #endif
  100. namespace juce
  101. {
  102. #include "audio_io/juce_AudioDeviceManager.cpp"
  103. #include "audio_io/juce_AudioIODevice.cpp"
  104. #include "audio_io/juce_AudioIODeviceType.cpp"
  105. #include "midi_io/juce_MidiMessageCollector.cpp"
  106. #include "midi_io/juce_MidiOutput.cpp"
  107. #include "audio_cd/juce_AudioCDReader.cpp"
  108. #include "sources/juce_AudioSourcePlayer.cpp"
  109. #include "sources/juce_AudioTransportSource.cpp"
  110. #include "native/juce_MidiDataConcatenator.h"
  111. //==============================================================================
  112. #if JUCE_MAC
  113. #include "../juce_core/native/juce_osx_ObjCHelpers.h"
  114. #include "native/juce_mac_CoreAudio.cpp"
  115. #include "native/juce_mac_CoreMidi.cpp"
  116. #if JUCE_USE_CDREADER
  117. #include "native/juce_mac_AudioCDReader.mm"
  118. #endif
  119. #if JUCE_USE_CDBURNER
  120. #include "native/juce_mac_AudioCDBurner.mm"
  121. #endif
  122. //==============================================================================
  123. #elif JUCE_IOS
  124. #include "native/juce_ios_Audio.cpp"
  125. #include "native/juce_mac_CoreMidi.cpp"
  126. //==============================================================================
  127. #elif JUCE_WINDOWS
  128. #include "../juce_core/native/juce_win32_ComSmartPtr.h"
  129. #include "../juce_events/native/juce_win32_HiddenMessageWindow.h"
  130. #if JUCE_WASAPI
  131. #include "native/juce_win32_WASAPI.cpp"
  132. #endif
  133. #if JUCE_DIRECTSOUND
  134. #include "native/juce_win32_DirectSound.cpp"
  135. #endif
  136. #include "native/juce_win32_Midi.cpp"
  137. #if JUCE_ASIO
  138. #include "native/juce_win32_ASIO.cpp"
  139. #endif
  140. #if JUCE_USE_CDREADER
  141. #include "native/juce_win32_AudioCDReader.cpp"
  142. #endif
  143. #if JUCE_USE_CDBURNER
  144. #include "native/juce_win32_AudioCDBurner.cpp"
  145. #endif
  146. //==============================================================================
  147. #elif JUCE_LINUX
  148. #if JUCE_ALSA
  149. #include "native/juce_linux_ALSA.cpp"
  150. #endif
  151. #include "native/juce_linux_Midi.cpp"
  152. #if JUCE_JACK
  153. #include "native/juce_linux_JackAudio.cpp"
  154. #endif
  155. #if JUCE_USE_CDREADER
  156. #include "native/juce_linux_AudioCDReader.cpp"
  157. #endif
  158. //==============================================================================
  159. #elif JUCE_ANDROID
  160. #include "../juce_core/native/juce_android_JNIHelpers.h"
  161. #include "native/juce_android_Audio.cpp"
  162. #include "native/juce_android_Midi.cpp"
  163. #if JUCE_USE_ANDROID_OPENSLES
  164. #include "native/juce_android_OpenSL.cpp"
  165. #endif
  166. #endif
  167. #if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED
  168. // None of these methods are available. (On Windows you might need to enable WASAPI for this)
  169. float JUCE_CALLTYPE SystemAudioVolume::getGain() { jassertfalse; return 0.0f; }
  170. bool JUCE_CALLTYPE SystemAudioVolume::setGain (float) { jassertfalse; return false; }
  171. bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { jassertfalse; return false; }
  172. bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool) { jassertfalse; return false; }
  173. #endif
  174. }