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.

238 lines
7.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #if defined (__JUCE_AUDIO_DEVICES_JUCEHEADER__) && ! JUCE_AMALGAMATED_INCLUDE
  19. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  20. already included any other headers - just put it inside a file on its own, possibly with your config
  21. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  22. header files that the compiler may be using.
  23. */
  24. #error "Incorrect use of JUCE cpp file"
  25. #endif
  26. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  27. // and your header search path must make it accessible to the module's files.
  28. #include "AppConfig.h"
  29. #include "../juce_core/native/juce_BasicNativeHeaders.h"
  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. #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. //==============================================================================
  45. #elif JUCE_WINDOWS
  46. #if JUCE_WASAPI
  47. #pragma warning (push)
  48. #pragma warning (disable: 4201)
  49. #include <MMReg.h>
  50. #include <mmdeviceapi.h>
  51. #include <Audioclient.h>
  52. #include <Audiopolicy.h>
  53. #include <Avrt.h>
  54. #include <functiondiscoverykeys.h>
  55. #pragma warning (pop)
  56. #endif
  57. #if JUCE_ASIO
  58. /* This is very frustrating - we only need to use a handful of definitions from
  59. a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy
  60. about 30 lines of code into this cpp file to create a fully stand-alone ASIO
  61. implementation...
  62. ..unfortunately that would break Steinberg's license agreement for use of
  63. their SDK, so I'm not allowed to do this.
  64. This means that anyone who wants to use JUCE's ASIO abilities will have to:
  65. 1) Agree to Steinberg's licensing terms and download the ASIO SDK
  66. (see www.steinberg.net/Steinberg/Developers.asp).
  67. 2) Enable this code with a global definition #define JUCE_ASIO 1.
  68. 3) Make sure that your header search path contains the iasiodrv.h file that
  69. comes with the SDK. (Only about a handful of the SDK header files are actually
  70. needed - so to simplify things, you could just copy these into your JUCE directory).
  71. */
  72. #include <iasiodrv.h>
  73. #endif
  74. #if JUCE_USE_CDBURNER
  75. /* You'll need the Platform SDK for these headers - if you don't have it and don't
  76. need to use CD-burning, then you might just want to set the JUCE_USE_CDBURNER flag
  77. to 0, to avoid these includes.
  78. */
  79. #include <imapi.h>
  80. #include <imapierror.h>
  81. #endif
  82. //==============================================================================
  83. #elif JUCE_LINUX
  84. #if JUCE_ALSA
  85. /* Got an include error here? If so, you've either not got ALSA installed, or you've
  86. not got your paths set up correctly to find its header files.
  87. The package you need to install to get ASLA support is "libasound2-dev".
  88. If you don't have the ALSA library and don't want to build Juce with audio support,
  89. just set the JUCE_ALSA flag to 0.
  90. */
  91. #include <alsa/asoundlib.h>
  92. #endif
  93. #if JUCE_JACK
  94. /* Got an include error here? If so, you've either not got jack-audio-connection-kit
  95. installed, or you've not got your paths set up correctly to find its header files.
  96. The package you need to install to get JACK support is "libjack-dev".
  97. If you don't have the jack-audio-connection-kit library and don't want to build
  98. Juce with low latency audio support, just set the JUCE_JACK flag to 0.
  99. */
  100. #include <jack/jack.h>
  101. #endif
  102. #undef SIZEOF
  103. //==============================================================================
  104. #elif JUCE_ANDROID
  105. #if JUCE_USE_ANDROID_OPENSLES
  106. #include <SLES/OpenSLES.h>
  107. #include <SLES/OpenSLES_Android.h>
  108. #endif
  109. #endif
  110. namespace juce
  111. {
  112. // START_AUTOINCLUDE audio_io/*.cpp, midi_io/*.cpp, audio_cd/*.cpp, sources/*.cpp
  113. #include "audio_io/juce_AudioDeviceManager.cpp"
  114. #include "audio_io/juce_AudioIODevice.cpp"
  115. #include "audio_io/juce_AudioIODeviceType.cpp"
  116. #include "midi_io/juce_MidiMessageCollector.cpp"
  117. #include "midi_io/juce_MidiOutput.cpp"
  118. #include "audio_cd/juce_AudioCDReader.cpp"
  119. #include "sources/juce_AudioSourcePlayer.cpp"
  120. #include "sources/juce_AudioTransportSource.cpp"
  121. // END_AUTOINCLUDE
  122. }
  123. //==============================================================================
  124. using namespace juce;
  125. namespace juce
  126. {
  127. #include "native/juce_MidiDataConcatenator.h"
  128. //==============================================================================
  129. #if JUCE_MAC
  130. #include "../juce_core/native/juce_osx_ObjCHelpers.h"
  131. #include "native/juce_mac_CoreAudio.cpp"
  132. #include "native/juce_mac_CoreMidi.cpp"
  133. #if JUCE_USE_CDREADER
  134. #include "native/juce_mac_AudioCDReader.mm"
  135. #endif
  136. #if JUCE_USE_CDBURNER
  137. #include "native/juce_mac_AudioCDBurner.mm"
  138. #endif
  139. //==============================================================================
  140. #elif JUCE_IOS
  141. #include "native/juce_ios_Audio.cpp"
  142. #include "native/juce_mac_CoreMidi.cpp"
  143. //==============================================================================
  144. #elif JUCE_WINDOWS
  145. #include "../juce_core/native/juce_win32_ComSmartPtr.h"
  146. #include "../juce_events/native/juce_win32_HiddenMessageWindow.h"
  147. #if JUCE_WASAPI
  148. #include "native/juce_win32_WASAPI.cpp"
  149. #endif
  150. #if JUCE_DIRECTSOUND
  151. #include "native/juce_win32_DirectSound.cpp"
  152. #endif
  153. #include "native/juce_win32_Midi.cpp"
  154. #if JUCE_ASIO
  155. #include "native/juce_win32_ASIO.cpp"
  156. #endif
  157. #if JUCE_USE_CDREADER
  158. #include "native/juce_win32_AudioCDReader.cpp"
  159. #endif
  160. #if JUCE_USE_CDBURNER
  161. #include "native/juce_win32_AudioCDBurner.cpp"
  162. #endif
  163. //==============================================================================
  164. #elif JUCE_LINUX
  165. #if JUCE_ALSA
  166. #include "native/juce_linux_ALSA.cpp"
  167. #endif
  168. #include "native/juce_linux_Midi.cpp"
  169. #if JUCE_JACK
  170. #include "native/juce_linux_JackAudio.cpp"
  171. #endif
  172. #if JUCE_USE_CDREADER
  173. #include "native/juce_linux_AudioCDReader.cpp"
  174. #endif
  175. //==============================================================================
  176. #elif JUCE_ANDROID
  177. #include "../juce_core/native/juce_android_JNIHelpers.h"
  178. #include "native/juce_android_Audio.cpp"
  179. #include "native/juce_android_Midi.cpp"
  180. #if JUCE_USE_ANDROID_OPENSLES
  181. #include "native/juce_android_OpenSL.cpp"
  182. #endif
  183. #endif
  184. }