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.

219 lines
7.5KB

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