The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

229 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. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  26. #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
  27. #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
  28. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  29. #define JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW 1
  30. #include "juce_audio_devices.h"
  31. //==============================================================================
  32. #if JUCE_MAC
  33. #define Point CarbonDummyPointName
  34. #define Component CarbonDummyCompName
  35. #import <CoreAudio/AudioHardware.h>
  36. #import <CoreMIDI/MIDIServices.h>
  37. #import <DiscRecording/DiscRecording.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. #if JUCE_USE_CDBURNER
  71. /* You'll need the Platform SDK for these headers - if you don't have it and don't
  72. need to use CD-burning, then you might just want to set the JUCE_USE_CDBURNER flag
  73. to 0, to avoid these includes.
  74. */
  75. #include <imapi.h>
  76. #include <imapierror.h>
  77. #endif
  78. //==============================================================================
  79. #elif JUCE_LINUX
  80. #if JUCE_ALSA
  81. /* Got an include error here? If so, you've either not got ALSA installed, or you've
  82. not got your paths set up correctly to find its header files.
  83. The package you need to install to get ASLA support is "libasound2-dev".
  84. If you don't have the ALSA library and don't want to build Juce with audio support,
  85. just set the JUCE_ALSA flag to 0.
  86. */
  87. #include <alsa/asoundlib.h>
  88. #endif
  89. #if JUCE_JACK
  90. /* Got an include error here? If so, you've either not got jack-audio-connection-kit
  91. installed, or you've not got your paths set up correctly to find its header files.
  92. The package you need to install to get JACK support is "libjack-dev".
  93. If you don't have the jack-audio-connection-kit library and don't want to build
  94. Juce with low latency audio support, just set the JUCE_JACK flag to 0.
  95. */
  96. #include <jack/jack.h>
  97. #endif
  98. #undef SIZEOF
  99. //==============================================================================
  100. #elif JUCE_ANDROID
  101. #if JUCE_USE_ANDROID_OPENSLES
  102. #include <SLES/OpenSLES.h>
  103. #include <SLES/OpenSLES_Android.h>
  104. #include <SLES/OpenSLES_AndroidConfiguration.h>
  105. #endif
  106. #endif
  107. namespace juce
  108. {
  109. #include "audio_io/juce_AudioDeviceManager.cpp"
  110. #include "audio_io/juce_AudioIODevice.cpp"
  111. #include "audio_io/juce_AudioIODeviceType.cpp"
  112. #include "midi_io/juce_MidiMessageCollector.cpp"
  113. #include "midi_io/juce_MidiOutput.cpp"
  114. #include "audio_cd/juce_AudioCDReader.cpp"
  115. #include "sources/juce_AudioSourcePlayer.cpp"
  116. #include "sources/juce_AudioTransportSource.cpp"
  117. #include "native/juce_MidiDataConcatenator.h"
  118. //==============================================================================
  119. #if JUCE_MAC
  120. #include "native/juce_mac_CoreAudio.cpp"
  121. #include "native/juce_mac_CoreMidi.cpp"
  122. #if JUCE_USE_CDREADER
  123. #include "native/juce_mac_AudioCDReader.mm"
  124. #endif
  125. #if JUCE_USE_CDBURNER
  126. #include "native/juce_mac_AudioCDBurner.mm"
  127. #endif
  128. //==============================================================================
  129. #elif JUCE_IOS
  130. #include "native/juce_ios_Audio.cpp"
  131. #include "native/juce_mac_CoreMidi.cpp"
  132. //==============================================================================
  133. #elif JUCE_WINDOWS
  134. #if JUCE_WASAPI
  135. #include "native/juce_win32_WASAPI.cpp"
  136. #endif
  137. #if JUCE_DIRECTSOUND
  138. #include "native/juce_win32_DirectSound.cpp"
  139. #endif
  140. #include "native/juce_win32_Midi.cpp"
  141. #if JUCE_ASIO
  142. #include "native/juce_win32_ASIO.cpp"
  143. #endif
  144. #if JUCE_USE_CDREADER
  145. #include "native/juce_win32_AudioCDReader.cpp"
  146. #endif
  147. #if JUCE_USE_CDBURNER
  148. #include "native/juce_win32_AudioCDBurner.cpp"
  149. #endif
  150. //==============================================================================
  151. #elif JUCE_LINUX
  152. #if JUCE_ALSA
  153. #include "native/juce_linux_ALSA.cpp"
  154. #endif
  155. #include "native/juce_linux_Midi.cpp"
  156. #if JUCE_JACK
  157. #include "native/juce_linux_JackAudio.cpp"
  158. #endif
  159. #if JUCE_USE_CDREADER
  160. #include "native/juce_linux_AudioCDReader.cpp"
  161. #endif
  162. //==============================================================================
  163. #elif JUCE_ANDROID
  164. #include "native/juce_android_Audio.cpp"
  165. #include "native/juce_android_Midi.cpp"
  166. #if JUCE_USE_ANDROID_OPENSLES
  167. #include "native/juce_android_OpenSL.cpp"
  168. #endif
  169. #endif
  170. #if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED
  171. // None of these methods are available. (On Windows you might need to enable WASAPI for this)
  172. float JUCE_CALLTYPE SystemAudioVolume::getGain() { jassertfalse; return 0.0f; }
  173. bool JUCE_CALLTYPE SystemAudioVolume::setGain (float) { jassertfalse; return false; }
  174. bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { jassertfalse; return false; }
  175. bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool) { jassertfalse; return false; }
  176. #endif
  177. }