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.

222 lines
7.6KB

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