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.

204 lines
7.2KB

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