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.

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