alphatau 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1362) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +11 -0
  3. data/bin/console +14 -0
  4. data/bin/setup +8 -0
  5. data/ext/alphatau/native/alphatau_native.cpp +141 -0
  6. data/ext/alphatau/native/extconf.rb +18 -0
  7. data/ext/alphatau/native/sdl/Android.mk +110 -0
  8. data/ext/alphatau/native/sdl/BUGS.txt +16 -0
  9. data/ext/alphatau/native/sdl/CMakeLists.txt +1877 -0
  10. data/ext/alphatau/native/sdl/COPYING.txt +20 -0
  11. data/ext/alphatau/native/sdl/CREDITS.txt +53 -0
  12. data/ext/alphatau/native/sdl/INSTALL.txt +40 -0
  13. data/ext/alphatau/native/sdl/Makefile.in +240 -0
  14. data/ext/alphatau/native/sdl/Makefile.minimal +44 -0
  15. data/ext/alphatau/native/sdl/Makefile.pandora +60 -0
  16. data/ext/alphatau/native/sdl/Makefile.psp +95 -0
  17. data/ext/alphatau/native/sdl/Makefile.wiz +80 -0
  18. data/ext/alphatau/native/sdl/README-SDL.txt +13 -0
  19. data/ext/alphatau/native/sdl/README.txt +21 -0
  20. data/ext/alphatau/native/sdl/SDL2.spec.in +118 -0
  21. data/ext/alphatau/native/sdl/SDL2Config.cmake +1 -0
  22. data/ext/alphatau/native/sdl/TODO.txt +10 -0
  23. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.nuspec +23 -0
  24. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.targets +38 -0
  25. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec +22 -0
  26. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets +10 -0
  27. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln +34 -0
  28. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj +575 -0
  29. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +774 -0
  30. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln +28 -0
  31. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +466 -0
  32. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +735 -0
  33. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln +34 -0
  34. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +571 -0
  35. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +771 -0
  36. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png +0 -0
  37. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png +0 -0
  38. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png +0 -0
  39. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png +0 -0
  40. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest +42 -0
  41. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +170 -0
  42. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx +0 -0
  43. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png +0 -0
  44. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png +0 -0
  45. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png +0 -0
  46. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png +0 -0
  47. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest +42 -0
  48. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +160 -0
  49. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx +0 -0
  50. data/ext/alphatau/native/sdl/VisualC.html +146 -0
  51. data/ext/alphatau/native/sdl/VisualC/SDL.sln +291 -0
  52. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj +559 -0
  53. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj.filters +479 -0
  54. data/ext/alphatau/native/sdl/VisualC/SDLmain/SDLmain.vcxproj +162 -0
  55. data/ext/alphatau/native/sdl/VisualC/SDLtest/SDLtest.vcxproj +177 -0
  56. data/ext/alphatau/native/sdl/VisualC/clean.sh +4 -0
  57. data/ext/alphatau/native/sdl/VisualC/tests/checkkeys/checkkeys.vcxproj +218 -0
  58. data/ext/alphatau/native/sdl/VisualC/tests/controllermap/controllermap.vcxproj +259 -0
  59. data/ext/alphatau/native/sdl/VisualC/tests/loopwave/loopwave.vcxproj +229 -0
  60. data/ext/alphatau/native/sdl/VisualC/tests/testatomic/testatomic.vcxproj +203 -0
  61. data/ext/alphatau/native/sdl/VisualC/tests/testautomation/testautomation.vcxproj +230 -0
  62. data/ext/alphatau/native/sdl/VisualC/tests/testdraw2/testdraw2.vcxproj +209 -0
  63. data/ext/alphatau/native/sdl/VisualC/tests/testfile/testfile.vcxproj +203 -0
  64. data/ext/alphatau/native/sdl/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +259 -0
  65. data/ext/alphatau/native/sdl/VisualC/tests/testgesture/testgesture.vcxproj +203 -0
  66. data/ext/alphatau/native/sdl/VisualC/tests/testgl2/testgl2.vcxproj +213 -0
  67. data/ext/alphatau/native/sdl/VisualC/tests/testgles2/testgles2.vcxproj +209 -0
  68. data/ext/alphatau/native/sdl/VisualC/tests/testjoystick/testjoystick.vcxproj +203 -0
  69. data/ext/alphatau/native/sdl/VisualC/tests/testoverlay2/testoverlay2.vcxproj +224 -0
  70. data/ext/alphatau/native/sdl/VisualC/tests/testplatform/testplatform.vcxproj +231 -0
  71. data/ext/alphatau/native/sdl/VisualC/tests/testpower/testpower.vcxproj +203 -0
  72. data/ext/alphatau/native/sdl/VisualC/tests/testrendertarget/testrendertarget.vcxproj +247 -0
  73. data/ext/alphatau/native/sdl/VisualC/tests/testrumble/testrumble.vcxproj +203 -0
  74. data/ext/alphatau/native/sdl/VisualC/tests/testscale/testscale.vcxproj +247 -0
  75. data/ext/alphatau/native/sdl/VisualC/tests/testshape/testshape.vcxproj +203 -0
  76. data/ext/alphatau/native/sdl/VisualC/tests/testsprite2/testsprite2.vcxproj +229 -0
  77. data/ext/alphatau/native/sdl/VisualC/tests/testvulkan/testvulkan.vcxproj +203 -0
  78. data/ext/alphatau/native/sdl/VisualC/tests/testyuv/testyuv.vcxproj +233 -0
  79. data/ext/alphatau/native/sdl/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +216 -0
  80. data/ext/alphatau/native/sdl/VisualC/visualtest/visualtest_VS2012.vcxproj +304 -0
  81. data/ext/alphatau/native/sdl/WhatsNew.txt +401 -0
  82. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Default.png +0 -0
  83. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +1299 -0
  84. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Icon.png +0 -0
  85. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Info.plist +32 -0
  86. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/README +43 -0
  87. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp +0 -0
  88. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt +258 -0
  89. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav +0 -0
  90. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav +0 -0
  91. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav +0 -0
  92. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav +0 -0
  93. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/icon.bmp +0 -0
  94. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/ship.bmp +0 -0
  95. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/space.bmp +0 -0
  96. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/stroke.bmp +0 -0
  97. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/iOS Launch Screen.storyboard +40 -0
  98. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/accelerometer.c +226 -0
  99. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.c +56 -0
  100. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.h +10 -0
  101. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/fireworks.c +474 -0
  102. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/happy.c +180 -0
  103. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/keyboard.c +301 -0
  104. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/mixer.c +344 -0
  105. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/rectangles.c +92 -0
  106. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/touch.c +129 -0
  107. data/ext/alphatau/native/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +2047 -0
  108. data/ext/alphatau/native/sdl/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj +422 -0
  109. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png +0 -0
  110. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png +0 -0
  111. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png +0 -0
  112. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist +28 -0
  113. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns +0 -0
  114. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +10 -0
  115. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +308 -0
  116. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  117. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/main.c +100 -0
  118. data/ext/alphatau/native/sdl/Xcode-iOS/Test/Info.plist +26 -0
  119. data/ext/alphatau/native/sdl/Xcode-iOS/Test/README +11 -0
  120. data/ext/alphatau/native/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +3095 -0
  121. data/ext/alphatau/native/sdl/Xcode/SDL/Info-Framework.plist +28 -0
  122. data/ext/alphatau/native/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +3384 -0
  123. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/SDL.info +15 -0
  124. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/License.txt +19 -0
  125. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt +32 -0
  126. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store +0 -0
  127. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf +0 -0
  128. data/ext/alphatau/native/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +4995 -0
  129. data/ext/alphatau/native/sdl/Xcode/SDLTest/TestDropFile-Info.plist +35 -0
  130. data/ext/alphatau/native/sdl/Xcode/XcodeDocSet/Doxyfile +1558 -0
  131. data/ext/alphatau/native/sdl/acinclude/ac_check_define.m4 +14 -0
  132. data/ext/alphatau/native/sdl/acinclude/alsa.m4 +145 -0
  133. data/ext/alphatau/native/sdl/acinclude/ax_check_compiler_flags.m4 +76 -0
  134. data/ext/alphatau/native/sdl/acinclude/ax_gcc_archflag.m4 +215 -0
  135. data/ext/alphatau/native/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm +79 -0
  136. data/ext/alphatau/native/sdl/acinclude/esd.m4 +168 -0
  137. data/ext/alphatau/native/sdl/acinclude/libtool.m4 +7998 -0
  138. data/ext/alphatau/native/sdl/acinclude/ltoptions.m4 +384 -0
  139. data/ext/alphatau/native/sdl/acinclude/ltsugar.m4 +123 -0
  140. data/ext/alphatau/native/sdl/acinclude/ltversion.m4 +23 -0
  141. data/ext/alphatau/native/sdl/acinclude/lt~obsolete.m4 +98 -0
  142. data/ext/alphatau/native/sdl/android-project-ant/AndroidManifest.xml +1 -0
  143. data/ext/alphatau/native/sdl/android-project-ant/ant.properties +17 -0
  144. data/ext/alphatau/native/sdl/android-project-ant/build.properties +17 -0
  145. data/ext/alphatau/native/sdl/android-project-ant/build.xml +93 -0
  146. data/ext/alphatau/native/sdl/android-project-ant/default.properties +11 -0
  147. data/ext/alphatau/native/sdl/android-project-ant/jni/Android.mk +1 -0
  148. data/ext/alphatau/native/sdl/android-project-ant/jni/Application.mk +10 -0
  149. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android.mk +18 -0
  150. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android_static.mk +12 -0
  151. data/ext/alphatau/native/sdl/android-project-ant/proguard-project.txt +20 -0
  152. data/ext/alphatau/native/sdl/android-project-ant/project.properties +14 -0
  153. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-hdpi/ic_launcher.png +0 -0
  154. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-mdpi/ic_launcher.png +0 -0
  155. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xhdpi/ic_launcher.png +0 -0
  156. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xxhdpi/ic_launcher.png +0 -0
  157. data/ext/alphatau/native/sdl/android-project-ant/res/layout/main.xml +13 -0
  158. data/ext/alphatau/native/sdl/android-project-ant/res/values/strings.xml +4 -0
  159. data/ext/alphatau/native/sdl/android-project-ant/src +1 -0
  160. data/ext/alphatau/native/sdl/android-project/app/build.gradle +69 -0
  161. data/ext/alphatau/native/sdl/android-project/app/jni/Android.mk +1 -0
  162. data/ext/alphatau/native/sdl/android-project/app/jni/Application.mk +9 -0
  163. data/ext/alphatau/native/sdl/android-project/app/jni/src/Android.mk +18 -0
  164. data/ext/alphatau/native/sdl/android-project/app/proguard-rules.pro +17 -0
  165. data/ext/alphatau/native/sdl/android-project/app/src/main/AndroidManifest.xml +77 -0
  166. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDevice.java +19 -0
  167. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +640 -0
  168. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +624 -0
  169. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +298 -0
  170. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDL.java +37 -0
  171. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +2103 -0
  172. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +178 -0
  173. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java +812 -0
  174. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  175. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  176. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  177. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  178. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  179. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/colors.xml +6 -0
  180. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/strings.xml +3 -0
  181. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/styles.xml +8 -0
  182. data/ext/alphatau/native/sdl/android-project/build.gradle +23 -0
  183. data/ext/alphatau/native/sdl/android-project/gradle.properties +17 -0
  184. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.jar +0 -0
  185. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.properties +6 -0
  186. data/ext/alphatau/native/sdl/android-project/gradlew +160 -0
  187. data/ext/alphatau/native/sdl/android-project/gradlew.bat +90 -0
  188. data/ext/alphatau/native/sdl/android-project/settings.gradle +1 -0
  189. data/ext/alphatau/native/sdl/autogen.sh +23 -0
  190. data/ext/alphatau/native/sdl/build-scripts/androidbuild.sh +100 -0
  191. data/ext/alphatau/native/sdl/build-scripts/androidbuildlibs.sh +74 -0
  192. data/ext/alphatau/native/sdl/build-scripts/checker-buildbot.sh +103 -0
  193. data/ext/alphatau/native/sdl/build-scripts/config.guess +1476 -0
  194. data/ext/alphatau/native/sdl/build-scripts/config.sub +1868 -0
  195. data/ext/alphatau/native/sdl/build-scripts/config.sub.patch +72 -0
  196. data/ext/alphatau/native/sdl/build-scripts/emscripten-buildbot.sh +77 -0
  197. data/ext/alphatau/native/sdl/build-scripts/g++-fat.sh +101 -0
  198. data/ext/alphatau/native/sdl/build-scripts/gcc-fat.sh +102 -0
  199. data/ext/alphatau/native/sdl/build-scripts/install-sh +323 -0
  200. data/ext/alphatau/native/sdl/build-scripts/iosbuild.sh +188 -0
  201. data/ext/alphatau/native/sdl/build-scripts/ltmain.sh +9658 -0
  202. data/ext/alphatau/native/sdl/build-scripts/mkinstalldirs +99 -0
  203. data/ext/alphatau/native/sdl/build-scripts/nacl-buildbot.sh +61 -0
  204. data/ext/alphatau/native/sdl/build-scripts/naclbuild.sh +105 -0
  205. data/ext/alphatau/native/sdl/build-scripts/raspberrypi-buildbot.sh +60 -0
  206. data/ext/alphatau/native/sdl/build-scripts/showrev.sh +5 -0
  207. data/ext/alphatau/native/sdl/build-scripts/strip_fPIC.sh +21 -0
  208. data/ext/alphatau/native/sdl/build-scripts/update-copyright.sh +8 -0
  209. data/ext/alphatau/native/sdl/build-scripts/updaterev.sh +20 -0
  210. data/ext/alphatau/native/sdl/build-scripts/windows-buildbot-zipper.bat +40 -0
  211. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.bat +8 -0
  212. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.ps1 +302 -0
  213. data/ext/alphatau/native/sdl/cmake/macros.cmake +73 -0
  214. data/ext/alphatau/native/sdl/cmake/sdlchecks.cmake +1184 -0
  215. data/ext/alphatau/native/sdl/cmake_uninstall.cmake.in +18 -0
  216. data/ext/alphatau/native/sdl/configure +27540 -0
  217. data/ext/alphatau/native/sdl/configure.in +4236 -0
  218. data/ext/alphatau/native/sdl/debian/changelog +114 -0
  219. data/ext/alphatau/native/sdl/debian/compat +1 -0
  220. data/ext/alphatau/native/sdl/debian/control +76 -0
  221. data/ext/alphatau/native/sdl/debian/copyright +351 -0
  222. data/ext/alphatau/native/sdl/debian/docs +4 -0
  223. data/ext/alphatau/native/sdl/debian/libsdl2-dev.install +8 -0
  224. data/ext/alphatau/native/sdl/debian/libsdl2-dev.manpages +1 -0
  225. data/ext/alphatau/native/sdl/debian/libsdl2.install +1 -0
  226. data/ext/alphatau/native/sdl/debian/rules +41 -0
  227. data/ext/alphatau/native/sdl/debian/sdl2-config.1 +86 -0
  228. data/ext/alphatau/native/sdl/debian/source/format +1 -0
  229. data/ext/alphatau/native/sdl/debian/watch +2 -0
  230. data/ext/alphatau/native/sdl/docs/README-android.md +432 -0
  231. data/ext/alphatau/native/sdl/docs/README-cmake.md +32 -0
  232. data/ext/alphatau/native/sdl/docs/README-directfb.md +107 -0
  233. data/ext/alphatau/native/sdl/docs/README-dynapi.md +130 -0
  234. data/ext/alphatau/native/sdl/docs/README-emscripten.md +35 -0
  235. data/ext/alphatau/native/sdl/docs/README-gesture.md +71 -0
  236. data/ext/alphatau/native/sdl/docs/README-hg.md +22 -0
  237. data/ext/alphatau/native/sdl/docs/README-ios.md +284 -0
  238. data/ext/alphatau/native/sdl/docs/README-linux.md +90 -0
  239. data/ext/alphatau/native/sdl/docs/README-macosx.md +240 -0
  240. data/ext/alphatau/native/sdl/docs/README-nacl.md +103 -0
  241. data/ext/alphatau/native/sdl/docs/README-pandora.md +17 -0
  242. data/ext/alphatau/native/sdl/docs/README-platforms.md +8 -0
  243. data/ext/alphatau/native/sdl/docs/README-porting.md +68 -0
  244. data/ext/alphatau/native/sdl/docs/README-psp.md +19 -0
  245. data/ext/alphatau/native/sdl/docs/README-raspberrypi.md +188 -0
  246. data/ext/alphatau/native/sdl/docs/README-touch.md +86 -0
  247. data/ext/alphatau/native/sdl/docs/README-wince.md +10 -0
  248. data/ext/alphatau/native/sdl/docs/README-windows.md +45 -0
  249. data/ext/alphatau/native/sdl/docs/README-winrt.md +544 -0
  250. data/ext/alphatau/native/sdl/docs/README.md +63 -0
  251. data/ext/alphatau/native/sdl/docs/doxyfile +1560 -0
  252. data/ext/alphatau/native/sdl/include/SDL.h +135 -0
  253. data/ext/alphatau/native/sdl/include/SDL_assert.h +291 -0
  254. data/ext/alphatau/native/sdl/include/SDL_atomic.h +277 -0
  255. data/ext/alphatau/native/sdl/include/SDL_audio.h +825 -0
  256. data/ext/alphatau/native/sdl/include/SDL_bits.h +112 -0
  257. data/ext/alphatau/native/sdl/include/SDL_blendmode.h +120 -0
  258. data/ext/alphatau/native/sdl/include/SDL_clipboard.h +71 -0
  259. data/ext/alphatau/native/sdl/include/SDL_config.h +53 -0
  260. data/ext/alphatau/native/sdl/include/SDL_config.h.cmake +471 -0
  261. data/ext/alphatau/native/sdl/include/SDL_config.h.in +417 -0
  262. data/ext/alphatau/native/sdl/include/SDL_config_android.h +177 -0
  263. data/ext/alphatau/native/sdl/include/SDL_config_iphoneos.h +201 -0
  264. data/ext/alphatau/native/sdl/include/SDL_config_macosx.h +240 -0
  265. data/ext/alphatau/native/sdl/include/SDL_config_minimal.h +85 -0
  266. data/ext/alphatau/native/sdl/include/SDL_config_pandora.h +133 -0
  267. data/ext/alphatau/native/sdl/include/SDL_config_psp.h +164 -0
  268. data/ext/alphatau/native/sdl/include/SDL_config_windows.h +254 -0
  269. data/ext/alphatau/native/sdl/include/SDL_config_winrt.h +235 -0
  270. data/ext/alphatau/native/sdl/include/SDL_config_wiz.h +146 -0
  271. data/ext/alphatau/native/sdl/include/SDL_copying.h +20 -0
  272. data/ext/alphatau/native/sdl/include/SDL_cpuinfo.h +188 -0
  273. data/ext/alphatau/native/sdl/include/SDL_egl.h +1673 -0
  274. data/ext/alphatau/native/sdl/include/SDL_endian.h +260 -0
  275. data/ext/alphatau/native/sdl/include/SDL_error.h +76 -0
  276. data/ext/alphatau/native/sdl/include/SDL_events.h +788 -0
  277. data/ext/alphatau/native/sdl/include/SDL_filesystem.h +136 -0
  278. data/ext/alphatau/native/sdl/include/SDL_gamecontroller.h +383 -0
  279. data/ext/alphatau/native/sdl/include/SDL_gesture.h +87 -0
  280. data/ext/alphatau/native/sdl/include/SDL_haptic.h +1227 -0
  281. data/ext/alphatau/native/sdl/include/SDL_hints.h +1106 -0
  282. data/ext/alphatau/native/sdl/include/SDL_joystick.h +395 -0
  283. data/ext/alphatau/native/sdl/include/SDL_keyboard.h +217 -0
  284. data/ext/alphatau/native/sdl/include/SDL_keycode.h +349 -0
  285. data/ext/alphatau/native/sdl/include/SDL_loadso.h +81 -0
  286. data/ext/alphatau/native/sdl/include/SDL_log.h +211 -0
  287. data/ext/alphatau/native/sdl/include/SDL_main.h +168 -0
  288. data/ext/alphatau/native/sdl/include/SDL_messagebox.h +144 -0
  289. data/ext/alphatau/native/sdl/include/SDL_mouse.h +302 -0
  290. data/ext/alphatau/native/sdl/include/SDL_mutex.h +251 -0
  291. data/ext/alphatau/native/sdl/include/SDL_name.h +33 -0
  292. data/ext/alphatau/native/sdl/include/SDL_opengl.h +2183 -0
  293. data/ext/alphatau/native/sdl/include/SDL_opengl_glext.h +11177 -0
  294. data/ext/alphatau/native/sdl/include/SDL_opengles.h +39 -0
  295. data/ext/alphatau/native/sdl/include/SDL_opengles2.h +52 -0
  296. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2.h +621 -0
  297. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2ext.h +2050 -0
  298. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2platform.h +30 -0
  299. data/ext/alphatau/native/sdl/include/SDL_opengles2_khrplatform.h +282 -0
  300. data/ext/alphatau/native/sdl/include/SDL_pixels.h +470 -0
  301. data/ext/alphatau/native/sdl/include/SDL_platform.h +198 -0
  302. data/ext/alphatau/native/sdl/include/SDL_power.h +75 -0
  303. data/ext/alphatau/native/sdl/include/SDL_quit.h +58 -0
  304. data/ext/alphatau/native/sdl/include/SDL_rect.h +148 -0
  305. data/ext/alphatau/native/sdl/include/SDL_render.h +931 -0
  306. data/ext/alphatau/native/sdl/include/SDL_revision.h +2 -0
  307. data/ext/alphatau/native/sdl/include/SDL_rwops.h +254 -0
  308. data/ext/alphatau/native/sdl/include/SDL_scancode.h +413 -0
  309. data/ext/alphatau/native/sdl/include/SDL_sensor.h +251 -0
  310. data/ext/alphatau/native/sdl/include/SDL_shape.h +144 -0
  311. data/ext/alphatau/native/sdl/include/SDL_stdinc.h +607 -0
  312. data/ext/alphatau/native/sdl/include/SDL_surface.h +546 -0
  313. data/ext/alphatau/native/sdl/include/SDL_system.h +279 -0
  314. data/ext/alphatau/native/sdl/include/SDL_syswm.h +324 -0
  315. data/ext/alphatau/native/sdl/include/SDL_test.h +69 -0
  316. data/ext/alphatau/native/sdl/include/SDL_test_assert.h +105 -0
  317. data/ext/alphatau/native/sdl/include/SDL_test_common.h +188 -0
  318. data/ext/alphatau/native/sdl/include/SDL_test_compare.h +69 -0
  319. data/ext/alphatau/native/sdl/include/SDL_test_crc32.h +124 -0
  320. data/ext/alphatau/native/sdl/include/SDL_test_font.h +81 -0
  321. data/ext/alphatau/native/sdl/include/SDL_test_fuzzer.h +384 -0
  322. data/ext/alphatau/native/sdl/include/SDL_test_harness.h +134 -0
  323. data/ext/alphatau/native/sdl/include/SDL_test_images.h +78 -0
  324. data/ext/alphatau/native/sdl/include/SDL_test_log.h +67 -0
  325. data/ext/alphatau/native/sdl/include/SDL_test_md5.h +129 -0
  326. data/ext/alphatau/native/sdl/include/SDL_test_memory.h +63 -0
  327. data/ext/alphatau/native/sdl/include/SDL_test_random.h +115 -0
  328. data/ext/alphatau/native/sdl/include/SDL_thread.h +309 -0
  329. data/ext/alphatau/native/sdl/include/SDL_timer.h +115 -0
  330. data/ext/alphatau/native/sdl/include/SDL_touch.h +86 -0
  331. data/ext/alphatau/native/sdl/include/SDL_types.h +29 -0
  332. data/ext/alphatau/native/sdl/include/SDL_version.h +162 -0
  333. data/ext/alphatau/native/sdl/include/SDL_video.h +1276 -0
  334. data/ext/alphatau/native/sdl/include/SDL_vulkan.h +278 -0
  335. data/ext/alphatau/native/sdl/include/begin_code.h +167 -0
  336. data/ext/alphatau/native/sdl/include/close_code.h +37 -0
  337. data/ext/alphatau/native/sdl/sdl2-config.cmake.in +11 -0
  338. data/ext/alphatau/native/sdl/sdl2-config.in +60 -0
  339. data/ext/alphatau/native/sdl/sdl2.m4 +234 -0
  340. data/ext/alphatau/native/sdl/sdl2.pc.in +15 -0
  341. data/ext/alphatau/native/sdl/src/SDL.c +514 -0
  342. data/ext/alphatau/native/sdl/src/SDL_assert.c +451 -0
  343. data/ext/alphatau/native/sdl/src/SDL_assert_c.h +24 -0
  344. data/ext/alphatau/native/sdl/src/SDL_dataqueue.c +339 -0
  345. data/ext/alphatau/native/sdl/src/SDL_dataqueue.h +55 -0
  346. data/ext/alphatau/native/sdl/src/SDL_error.c +319 -0
  347. data/ext/alphatau/native/sdl/src/SDL_error_c.h +65 -0
  348. data/ext/alphatau/native/sdl/src/SDL_hints.c +236 -0
  349. data/ext/alphatau/native/sdl/src/SDL_internal.h +52 -0
  350. data/ext/alphatau/native/sdl/src/SDL_log.c +450 -0
  351. data/ext/alphatau/native/sdl/src/atomic/SDL_atomic.c +303 -0
  352. data/ext/alphatau/native/sdl/src/atomic/SDL_spinlock.c +176 -0
  353. data/ext/alphatau/native/sdl/src/audio/SDL_audio.c +1647 -0
  354. data/ext/alphatau/native/sdl/src/audio/SDL_audio_c.h +79 -0
  355. data/ext/alphatau/native/sdl/src/audio/SDL_audiocvt.c +1673 -0
  356. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev.c +124 -0
  357. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev_c.h +38 -0
  358. data/ext/alphatau/native/sdl/src/audio/SDL_audiotypecvt.c +1430 -0
  359. data/ext/alphatau/native/sdl/src/audio/SDL_mixer.c +369 -0
  360. data/ext/alphatau/native/sdl/src/audio/SDL_sysaudio.h +211 -0
  361. data/ext/alphatau/native/sdl/src/audio/SDL_wave.c +694 -0
  362. data/ext/alphatau/native/sdl/src/audio/SDL_wave.h +77 -0
  363. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.c +990 -0
  364. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.h +48 -0
  365. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.c +226 -0
  366. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.h +42 -0
  367. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.c +365 -0
  368. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.h +53 -0
  369. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.h +66 -0
  370. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.m +861 -0
  371. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.c +604 -0
  372. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.h +47 -0
  373. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.c +207 -0
  374. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.h +41 -0
  375. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.c +320 -0
  376. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.h +43 -0
  377. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.c +65 -0
  378. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.h +41 -0
  379. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.c +379 -0
  380. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.h +38 -0
  381. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.c +335 -0
  382. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.h +51 -0
  383. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.c +328 -0
  384. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.h +50 -0
  385. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.cc +248 -0
  386. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.h +38 -0
  387. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.c +446 -0
  388. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.h +41 -0
  389. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.c +165 -0
  390. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.h +43 -0
  391. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.c +463 -0
  392. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.h +56 -0
  393. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.c +412 -0
  394. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.h +48 -0
  395. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.c +516 -0
  396. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.h +48 -0
  397. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.c +181 -0
  398. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.h +45 -0
  399. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.c +782 -0
  400. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.h +52 -0
  401. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.c +666 -0
  402. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.h +57 -0
  403. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.c +382 -0
  404. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.h +49 -0
  405. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.c +419 -0
  406. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.h +47 -0
  407. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.c +779 -0
  408. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.h +85 -0
  409. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_win32.c +417 -0
  410. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_winrt.cpp +276 -0
  411. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.c +457 -0
  412. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.h +45 -0
  413. data/ext/alphatau/native/sdl/src/core/android/SDL_android.c +2285 -0
  414. data/ext/alphatau/native/sdl/src/core/android/SDL_android.h +122 -0
  415. data/ext/alphatau/native/sdl/src/core/android/keyinfotable.h +175 -0
  416. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.c +347 -0
  417. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.h +97 -0
  418. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.c +698 -0
  419. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.h +39 -0
  420. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.c +840 -0
  421. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.h +29 -0
  422. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_accents.h +284 -0
  423. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_keymap.h +4763 -0
  424. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.c +373 -0
  425. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.h +40 -0
  426. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.c +584 -0
  427. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.h +58 -0
  428. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.c +152 -0
  429. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.h +40 -0
  430. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.c +553 -0
  431. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.h +121 -0
  432. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.c +87 -0
  433. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.h +34 -0
  434. data/ext/alphatau/native/sdl/src/core/windows/SDL_directx.h +111 -0
  435. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.c +233 -0
  436. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.h +75 -0
  437. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.c +139 -0
  438. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.h +177 -0
  439. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.cpp +66 -0
  440. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.h +31 -0
  441. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.cpp +855 -0
  442. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.h +92 -0
  443. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.cpp +160 -0
  444. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.h +33 -0
  445. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_cpuinfo.c +855 -0
  446. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_simd.h +88 -0
  447. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.c +331 -0
  448. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.h +67 -0
  449. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_overrides.h +698 -0
  450. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_procs.h +740 -0
  451. data/ext/alphatau/native/sdl/src/dynapi/gendynapi.pl +141 -0
  452. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents.c +46 -0
  453. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents_c.h +30 -0
  454. data/ext/alphatau/native/sdl/src/events/SDL_displayevents.c +60 -0
  455. data/ext/alphatau/native/sdl/src/events/SDL_displayevents_c.h +30 -0
  456. data/ext/alphatau/native/sdl/src/events/SDL_dropevents.c +98 -0
  457. data/ext/alphatau/native/sdl/src/events/SDL_dropevents_c.h +32 -0
  458. data/ext/alphatau/native/sdl/src/events/SDL_events.c +976 -0
  459. data/ext/alphatau/native/sdl/src/events/SDL_events_c.h +52 -0
  460. data/ext/alphatau/native/sdl/src/events/SDL_gesture.c +700 -0
  461. data/ext/alphatau/native/sdl/src/events/SDL_gesture_c.h +35 -0
  462. data/ext/alphatau/native/sdl/src/events/SDL_keyboard.c +1033 -0
  463. data/ext/alphatau/native/sdl/src/events/SDL_keyboard_c.h +70 -0
  464. data/ext/alphatau/native/sdl/src/events/SDL_mouse.c +1031 -0
  465. data/ext/alphatau/native/sdl/src/events/SDL_mouse_c.h +141 -0
  466. data/ext/alphatau/native/sdl/src/events/SDL_quit.c +152 -0
  467. data/ext/alphatau/native/sdl/src/events/SDL_sysevents.h +36 -0
  468. data/ext/alphatau/native/sdl/src/events/SDL_touch.c +375 -0
  469. data/ext/alphatau/native/sdl/src/events/SDL_touch_c.h +61 -0
  470. data/ext/alphatau/native/sdl/src/events/SDL_windowevents.c +227 -0
  471. data/ext/alphatau/native/sdl/src/events/SDL_windowevents_c.h +31 -0
  472. data/ext/alphatau/native/sdl/src/events/blank_cursor.h +33 -0
  473. data/ext/alphatau/native/sdl/src/events/default_cursor.h +114 -0
  474. data/ext/alphatau/native/sdl/src/events/scancodes_darwin.h +159 -0
  475. data/ext/alphatau/native/sdl/src/events/scancodes_linux.h +263 -0
  476. data/ext/alphatau/native/sdl/src/events/scancodes_windows.h +55 -0
  477. data/ext/alphatau/native/sdl/src/events/scancodes_xfree86.h +506 -0
  478. data/ext/alphatau/native/sdl/src/file/SDL_rwops.c +867 -0
  479. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.h +30 -0
  480. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +62 -0
  481. data/ext/alphatau/native/sdl/src/filesystem/android/SDL_sysfilesystem.c +62 -0
  482. data/ext/alphatau/native/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m +117 -0
  483. data/ext/alphatau/native/sdl/src/filesystem/dummy/SDL_sysfilesystem.c +47 -0
  484. data/ext/alphatau/native/sdl/src/filesystem/emscripten/SDL_sysfilesystem.c +81 -0
  485. data/ext/alphatau/native/sdl/src/filesystem/haiku/SDL_sysfilesystem.cc +110 -0
  486. data/ext/alphatau/native/sdl/src/filesystem/nacl/SDL_sysfilesystem.c +43 -0
  487. data/ext/alphatau/native/sdl/src/filesystem/unix/SDL_sysfilesystem.c +250 -0
  488. data/ext/alphatau/native/sdl/src/filesystem/windows/SDL_sysfilesystem.c +192 -0
  489. data/ext/alphatau/native/sdl/src/filesystem/winrt/SDL_sysfilesystem.cpp +233 -0
  490. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic.c +850 -0
  491. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic_c.h +25 -0
  492. data/ext/alphatau/native/sdl/src/haptic/SDL_syshaptic.h +208 -0
  493. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic.c +358 -0
  494. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic_c.h +12 -0
  495. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic.c +1417 -0
  496. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic_c.h +26 -0
  497. data/ext/alphatau/native/sdl/src/haptic/dummy/SDL_syshaptic.c +186 -0
  498. data/ext/alphatau/native/sdl/src/haptic/linux/SDL_syshaptic.c +1165 -0
  499. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic.c +1305 -0
  500. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic_c.h +47 -0
  501. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic.c +456 -0
  502. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic_c.h +88 -0
  503. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic.c +487 -0
  504. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic_c.h +47 -0
  505. data/ext/alphatau/native/sdl/src/hidapi/AUTHORS.txt +16 -0
  506. data/ext/alphatau/native/sdl/src/hidapi/HACKING.txt +15 -0
  507. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-bsd.txt +26 -0
  508. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-gpl3.txt +674 -0
  509. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-orig.txt +9 -0
  510. data/ext/alphatau/native/sdl/src/hidapi/LICENSE.txt +13 -0
  511. data/ext/alphatau/native/sdl/src/hidapi/Makefile.am +85 -0
  512. data/ext/alphatau/native/sdl/src/hidapi/README.txt +339 -0
  513. data/ext/alphatau/native/sdl/src/hidapi/android/hid.cpp +1079 -0
  514. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Android.mk +16 -0
  515. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Application.mk +2 -0
  516. data/ext/alphatau/native/sdl/src/hidapi/android/project.properties +14 -0
  517. data/ext/alphatau/native/sdl/src/hidapi/bootstrap +2 -0
  518. data/ext/alphatau/native/sdl/src/hidapi/configure.ac +236 -0
  519. data/ext/alphatau/native/sdl/src/hidapi/doxygen/Doxyfile +1630 -0
  520. data/ext/alphatau/native/sdl/src/hidapi/hidapi/hidapi.h +398 -0
  521. data/ext/alphatau/native/sdl/src/hidapi/hidtest/Makefile.am +20 -0
  522. data/ext/alphatau/native/sdl/src/hidapi/hidtest/hidtest.cpp +194 -0
  523. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile-manual +32 -0
  524. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile.am +9 -0
  525. data/ext/alphatau/native/sdl/src/hidapi/ios/hid.m +909 -0
  526. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile-manual +18 -0
  527. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.am +27 -0
  528. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.freebsd +46 -0
  529. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.linux +49 -0
  530. data/ext/alphatau/native/sdl/src/hidapi/libusb/hid.c +1615 -0
  531. data/ext/alphatau/native/sdl/src/hidapi/libusb/hidusb.cpp +3 -0
  532. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile-manual +49 -0
  533. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile.am +10 -0
  534. data/ext/alphatau/native/sdl/src/hidapi/linux/README.txt +59 -0
  535. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.c +893 -0
  536. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.cpp +333 -0
  537. data/ext/alphatau/native/sdl/src/hidapi/linux/hidraw.cpp +3 -0
  538. data/ext/alphatau/native/sdl/src/hidapi/m4/ax_pthread.m4 +309 -0
  539. data/ext/alphatau/native/sdl/src/hidapi/m4/pkg.m4 +157 -0
  540. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile-manual +32 -0
  541. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile.am +9 -0
  542. data/ext/alphatau/native/sdl/src/hidapi/mac/hid.c +1186 -0
  543. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-hidraw.pc.in +10 -0
  544. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-libusb.pc.in +10 -0
  545. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi.pc.in +10 -0
  546. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile-manual +26 -0
  547. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.am +43 -0
  548. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.freebsd +33 -0
  549. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.linux +32 -0
  550. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mac +46 -0
  551. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mingw +32 -0
  552. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Info.plist +28 -0
  553. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/PkgInfo +1 -0
  554. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/English.lproj/InfoPlist.strings +0 -0
  555. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/Signal11.icns +0 -0
  556. data/ext/alphatau/native/sdl/src/hidapi/testgui/copy_to_bundle.sh +97 -0
  557. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.cpp +134 -0
  558. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.h +17 -0
  559. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support_cocoa.m +94 -0
  560. data/ext/alphatau/native/sdl/src/hidapi/testgui/start.sh +2 -0
  561. data/ext/alphatau/native/sdl/src/hidapi/testgui/test.cpp +532 -0
  562. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.sln +20 -0
  563. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.vcproj +217 -0
  564. data/ext/alphatau/native/sdl/src/hidapi/udev/99-hid.rules +33 -0
  565. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile-manual +14 -0
  566. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.am +16 -0
  567. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.mingw +35 -0
  568. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/hidapi.def +17 -0
  569. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/makefile +49 -0
  570. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/sources +23 -0
  571. data/ext/alphatau/native/sdl/src/hidapi/windows/hid.c +983 -0
  572. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.sln +29 -0
  573. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.vcproj +201 -0
  574. data/ext/alphatau/native/sdl/src/hidapi/windows/hidtest.vcproj +196 -0
  575. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontroller.c +2066 -0
  576. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontrollerdb.h +583 -0
  577. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick.c +1547 -0
  578. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick_c.h +94 -0
  579. data/ext/alphatau/native/sdl/src/joystick/SDL_sysjoystick.h +153 -0
  580. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick.c +703 -0
  581. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick_c.h +59 -0
  582. data/ext/alphatau/native/sdl/src/joystick/bsd/SDL_sysjoystick.c +701 -0
  583. data/ext/alphatau/native/sdl/src/joystick/controller_type.h +457 -0
  584. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick.c +1012 -0
  585. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick_c.h +79 -0
  586. data/ext/alphatau/native/sdl/src/joystick/dummy/SDL_sysjoystick.c +113 -0
  587. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick.c +406 -0
  588. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick_c.h +52 -0
  589. data/ext/alphatau/native/sdl/src/joystick/haiku/SDL_haikujoystick.cc +272 -0
  590. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_ps4.c +545 -0
  591. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_switch.c +905 -0
  592. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xbox360.c +461 -0
  593. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xboxone.c +318 -0
  594. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick.c +1021 -0
  595. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick_c.h +72 -0
  596. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick.m +727 -0
  597. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick_c.h +57 -0
  598. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick.c +1116 -0
  599. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick_c.h +64 -0
  600. data/ext/alphatau/native/sdl/src/joystick/psp/SDL_sysjoystick.c +264 -0
  601. data/ext/alphatau/native/sdl/src/joystick/sort_controllers.py +78 -0
  602. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.c +52 -0
  603. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.h +33 -0
  604. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick.c +1155 -0
  605. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick_c.h +31 -0
  606. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_mmjoystick.c +452 -0
  607. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick.c +558 -0
  608. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick_c.h +95 -0
  609. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick.c +558 -0
  610. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick_c.h +34 -0
  611. data/ext/alphatau/native/sdl/src/libm/e_atan2.c +134 -0
  612. data/ext/alphatau/native/sdl/src/libm/e_exp.c +187 -0
  613. data/ext/alphatau/native/sdl/src/libm/e_fmod.c +144 -0
  614. data/ext/alphatau/native/sdl/src/libm/e_log.c +152 -0
  615. data/ext/alphatau/native/sdl/src/libm/e_log10.c +106 -0
  616. data/ext/alphatau/native/sdl/src/libm/e_pow.c +343 -0
  617. data/ext/alphatau/native/sdl/src/libm/e_rem_pio2.c +161 -0
  618. data/ext/alphatau/native/sdl/src/libm/e_sqrt.c +457 -0
  619. data/ext/alphatau/native/sdl/src/libm/k_cos.c +82 -0
  620. data/ext/alphatau/native/sdl/src/libm/k_rem_pio2.c +317 -0
  621. data/ext/alphatau/native/sdl/src/libm/k_sin.c +65 -0
  622. data/ext/alphatau/native/sdl/src/libm/k_tan.c +118 -0
  623. data/ext/alphatau/native/sdl/src/libm/math_libm.h +41 -0
  624. data/ext/alphatau/native/sdl/src/libm/math_private.h +227 -0
  625. data/ext/alphatau/native/sdl/src/libm/s_atan.c +114 -0
  626. data/ext/alphatau/native/sdl/src/libm/s_copysign.c +29 -0
  627. data/ext/alphatau/native/sdl/src/libm/s_cos.c +73 -0
  628. data/ext/alphatau/native/sdl/src/libm/s_fabs.c +29 -0
  629. data/ext/alphatau/native/sdl/src/libm/s_floor.c +71 -0
  630. data/ext/alphatau/native/sdl/src/libm/s_scalbn.c +69 -0
  631. data/ext/alphatau/native/sdl/src/libm/s_sin.c +73 -0
  632. data/ext/alphatau/native/sdl/src/libm/s_tan.c +67 -0
  633. data/ext/alphatau/native/sdl/src/loadso/dlopen/SDL_sysloadso.c +88 -0
  634. data/ext/alphatau/native/sdl/src/loadso/dummy/SDL_sysloadso.c +54 -0
  635. data/ext/alphatau/native/sdl/src/loadso/windows/SDL_sysloadso.c +80 -0
  636. data/ext/alphatau/native/sdl/src/main/android/SDL_android_main.c +7 -0
  637. data/ext/alphatau/native/sdl/src/main/dummy/SDL_dummy_main.c +28 -0
  638. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BApp.h +399 -0
  639. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.cc +157 -0
  640. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.h +38 -0
  641. data/ext/alphatau/native/sdl/src/main/nacl/SDL_nacl_main.c +93 -0
  642. data/ext/alphatau/native/sdl/src/main/psp/SDL_psp_main.c +70 -0
  643. data/ext/alphatau/native/sdl/src/main/windows/SDL_windows_main.c +207 -0
  644. data/ext/alphatau/native/sdl/src/main/windows/version.rc +38 -0
  645. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur +0 -0
  646. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResources.rc +3 -0
  647. data/ext/alphatau/native/sdl/src/main/winrt/SDL_winrt_main_NonXAML.cpp +54 -0
  648. data/ext/alphatau/native/sdl/src/power/SDL_power.c +116 -0
  649. data/ext/alphatau/native/sdl/src/power/SDL_syspower.h +47 -0
  650. data/ext/alphatau/native/sdl/src/power/android/SDL_syspower.c +64 -0
  651. data/ext/alphatau/native/sdl/src/power/emscripten/SDL_syspower.c +62 -0
  652. data/ext/alphatau/native/sdl/src/power/haiku/SDL_syspower.c +128 -0
  653. data/ext/alphatau/native/sdl/src/power/linux/SDL_syspower.c +642 -0
  654. data/ext/alphatau/native/sdl/src/power/macosx/SDL_syspower.c +192 -0
  655. data/ext/alphatau/native/sdl/src/power/psp/SDL_syspower.c +68 -0
  656. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.h +32 -0
  657. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.m +113 -0
  658. data/ext/alphatau/native/sdl/src/power/windows/SDL_syspower.c +76 -0
  659. data/ext/alphatau/native/sdl/src/power/winrt/SDL_syspower.cpp +44 -0
  660. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.c +136 -0
  661. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.h +72 -0
  662. data/ext/alphatau/native/sdl/src/render/SDL_render.c +2292 -0
  663. data/ext/alphatau/native/sdl/src/render/SDL_sysrender.h +214 -0
  664. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw.c +414 -0
  665. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw_c.h +67 -0
  666. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_render_d3d.c +1813 -0
  667. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.c +274 -0
  668. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.h +34 -0
  669. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_d3d11.c +2559 -0
  670. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.cpp +116 -0
  671. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.h +40 -0
  672. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.c +1957 -0
  673. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.h +43 -0
  674. data/ext/alphatau/native/sdl/src/render/metal/SDL_render_metal.m +1428 -0
  675. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal.metal +109 -0
  676. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_ios.h +1899 -0
  677. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_osx.h +1903 -0
  678. data/ext/alphatau/native/sdl/src/render/metal/build-metal-shaders.sh +18 -0
  679. data/ext/alphatau/native/sdl/src/render/opengl/SDL_glfuncs.h +478 -0
  680. data/ext/alphatau/native/sdl/src/render/opengl/SDL_render_gl.c +1678 -0
  681. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.c +524 -0
  682. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.h +47 -0
  683. data/ext/alphatau/native/sdl/src/render/opengles/SDL_glesfuncs.h +65 -0
  684. data/ext/alphatau/native/sdl/src/render/opengles/SDL_render_gles.c +1278 -0
  685. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_gles2funcs.h +80 -0
  686. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_render_gles2.c +2256 -0
  687. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.c +569 -0
  688. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.h +70 -0
  689. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/Makefile +41 -0
  690. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_c.sno +181 -0
  691. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_h.sno +116 -0
  692. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2funcs_h.sno +82 -0
  693. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gles2funcs_into_gles2_define_overs_h.sno +42 -0
  694. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/gl2.h +686 -0
  695. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/readme.txt +70 -0
  696. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/testgles2.c +725 -0
  697. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/triangle.c +147 -0
  698. data/ext/alphatau/native/sdl/src/render/psp/SDL_render_psp.c +1016 -0
  699. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.c +336 -0
  700. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.h +27 -0
  701. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.c +777 -0
  702. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.h +27 -0
  703. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.c +341 -0
  704. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.h +27 -0
  705. data/ext/alphatau/native/sdl/src/render/software/SDL_draw.h +576 -0
  706. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.c +209 -0
  707. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.h +27 -0
  708. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.c +114 -0
  709. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.h +27 -0
  710. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw.c +882 -0
  711. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw_c.h +24 -0
  712. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.c +530 -0
  713. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.h +28 -0
  714. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor.c +546 -0
  715. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor_c.h +38 -0
  716. data/ext/alphatau/native/sdl/src/sensor/SDL_syssensor.h +99 -0
  717. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.c +211 -0
  718. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.h +31 -0
  719. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.h +30 -0
  720. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.m +234 -0
  721. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.c +110 -0
  722. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.h +23 -0
  723. data/ext/alphatau/native/sdl/src/stdlib/SDL_getenv.c +315 -0
  724. data/ext/alphatau/native/sdl/src/stdlib/SDL_iconv.c +934 -0
  725. data/ext/alphatau/native/sdl/src/stdlib/SDL_malloc.c +5376 -0
  726. data/ext/alphatau/native/sdl/src/stdlib/SDL_qsort.c +534 -0
  727. data/ext/alphatau/native/sdl/src/stdlib/SDL_stdlib.c +1155 -0
  728. data/ext/alphatau/native/sdl/src/stdlib/SDL_string.c +1737 -0
  729. data/ext/alphatau/native/sdl/src/test/SDL_test_assert.c +152 -0
  730. data/ext/alphatau/native/sdl/src/test/SDL_test_common.c +1826 -0
  731. data/ext/alphatau/native/sdl/src/test/SDL_test_compare.c +117 -0
  732. data/ext/alphatau/native/sdl/src/test/SDL_test_crc32.c +166 -0
  733. data/ext/alphatau/native/sdl/src/test/SDL_test_font.c +3250 -0
  734. data/ext/alphatau/native/sdl/src/test/SDL_test_fuzzer.c +534 -0
  735. data/ext/alphatau/native/sdl/src/test/SDL_test_harness.c +683 -0
  736. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlit.c +1559 -0
  737. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlitBlend.c +2845 -0
  738. data/ext/alphatau/native/sdl/src/test/SDL_test_imageFace.c +247 -0
  739. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitives.c +514 -0
  740. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitivesBlend.c +696 -0
  741. data/ext/alphatau/native/sdl/src/test/SDL_test_log.c +118 -0
  742. data/ext/alphatau/native/sdl/src/test/SDL_test_md5.c +338 -0
  743. data/ext/alphatau/native/sdl/src/test/SDL_test_memory.c +274 -0
  744. data/ext/alphatau/native/sdl/src/test/SDL_test_random.c +96 -0
  745. data/ext/alphatau/native/sdl/src/thread/SDL_systhread.h +70 -0
  746. data/ext/alphatau/native/sdl/src/thread/SDL_thread.c +503 -0
  747. data/ext/alphatau/native/sdl/src/thread/SDL_thread_c.h +95 -0
  748. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syscond.c +220 -0
  749. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex.c +165 -0
  750. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex_c.h +22 -0
  751. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syssem.c +217 -0
  752. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread.c +71 -0
  753. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread_c.h +26 -0
  754. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systls.c +38 -0
  755. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syscond.c +224 -0
  756. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex.c +136 -0
  757. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex_c.h +22 -0
  758. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syssem.c +161 -0
  759. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread.c +114 -0
  760. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread_c.h +24 -0
  761. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syscond.c +158 -0
  762. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex.c +195 -0
  763. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex_c.h +32 -0
  764. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syssem.c +209 -0
  765. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread.c +324 -0
  766. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread_c.h +27 -0
  767. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systls.c +70 -0
  768. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_syscond.cpp +164 -0
  769. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex.cpp +111 -0
  770. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex_c.h +30 -0
  771. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread.cpp +168 -0
  772. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread_c.h +26 -0
  773. data/ext/alphatau/native/sdl/src/thread/windows/SDL_sysmutex.c +110 -0
  774. data/ext/alphatau/native/sdl/src/thread/windows/SDL_syssem.c +152 -0
  775. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread.c +260 -0
  776. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread_c.h +32 -0
  777. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systls.c +72 -0
  778. data/ext/alphatau/native/sdl/src/timer/SDL_timer.c +373 -0
  779. data/ext/alphatau/native/sdl/src/timer/SDL_timer_c.h +34 -0
  780. data/ext/alphatau/native/sdl/src/timer/dummy/SDL_systimer.c +75 -0
  781. data/ext/alphatau/native/sdl/src/timer/haiku/SDL_systimer.c +80 -0
  782. data/ext/alphatau/native/sdl/src/timer/psp/SDL_systimer.c +91 -0
  783. data/ext/alphatau/native/sdl/src/timer/unix/SDL_systimer.c +232 -0
  784. data/ext/alphatau/native/sdl/src/timer/windows/SDL_systimer.c +200 -0
  785. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel.c +1581 -0
  786. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel_c.h +31 -0
  787. data/ext/alphatau/native/sdl/src/video/SDL_blit.c +296 -0
  788. data/ext/alphatau/native/sdl/src/video/SDL_blit.h +553 -0
  789. data/ext/alphatau/native/sdl/src/video/SDL_blit_0.c +483 -0
  790. data/ext/alphatau/native/sdl/src/video/SDL_blit_1.c +552 -0
  791. data/ext/alphatau/native/sdl/src/video/SDL_blit_A.c +1388 -0
  792. data/ext/alphatau/native/sdl/src/video/SDL_blit_N.c +2647 -0
  793. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.c +7419 -0
  794. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.h +30 -0
  795. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.c +162 -0
  796. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.h +24 -0
  797. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.c +164 -0
  798. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.h +25 -0
  799. data/ext/alphatau/native/sdl/src/video/SDL_bmp.c +702 -0
  800. data/ext/alphatau/native/sdl/src/video/SDL_clipboard.c +90 -0
  801. data/ext/alphatau/native/sdl/src/video/SDL_egl.c +899 -0
  802. data/ext/alphatau/native/sdl/src/video/SDL_egl_c.h +149 -0
  803. data/ext/alphatau/native/sdl/src/video/SDL_fillrect.c +343 -0
  804. data/ext/alphatau/native/sdl/src/video/SDL_pixels.c +1125 -0
  805. data/ext/alphatau/native/sdl/src/video/SDL_pixels_c.h +40 -0
  806. data/ext/alphatau/native/sdl/src/video/SDL_rect.c +531 -0
  807. data/ext/alphatau/native/sdl/src/video/SDL_rect_c.h +25 -0
  808. data/ext/alphatau/native/sdl/src/video/SDL_shape.c +309 -0
  809. data/ext/alphatau/native/sdl/src/video/SDL_shape_internals.h +69 -0
  810. data/ext/alphatau/native/sdl/src/video/SDL_stretch.c +353 -0
  811. data/ext/alphatau/native/sdl/src/video/SDL_surface.c +1232 -0
  812. data/ext/alphatau/native/sdl/src/video/SDL_sysvideo.h +467 -0
  813. data/ext/alphatau/native/sdl/src/video/SDL_video.c +4160 -0
  814. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_internal.h +91 -0
  815. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_utils.c +172 -0
  816. data/ext/alphatau/native/sdl/src/video/SDL_yuv.c +1834 -0
  817. data/ext/alphatau/native/sdl/src/video/SDL_yuv_c.h +30 -0
  818. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.c +48 -0
  819. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.h +32 -0
  820. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.c +123 -0
  821. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.h +27 -0
  822. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.c +62 -0
  823. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.h +34 -0
  824. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.c +391 -0
  825. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.h +36 -0
  826. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.c +37 -0
  827. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.h +29 -0
  828. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.c +266 -0
  829. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.h +33 -0
  830. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.c +151 -0
  831. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.h +29 -0
  832. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.c +259 -0
  833. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.h +51 -0
  834. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.c +175 -0
  835. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.h +52 -0
  836. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.c +175 -0
  837. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.h +45 -0
  838. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.h +36 -0
  839. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.m +103 -0
  840. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.h +32 -0
  841. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.m +483 -0
  842. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.h +36 -0
  843. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.m +720 -0
  844. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.h +29 -0
  845. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.m +145 -0
  846. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.h +63 -0
  847. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.m +134 -0
  848. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.h +46 -0
  849. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.m +490 -0
  850. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.h +52 -0
  851. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.m +477 -0
  852. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.h +34 -0
  853. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.m +279 -0
  854. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.h +68 -0
  855. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.m +428 -0
  856. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.h +49 -0
  857. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.m +132 -0
  858. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.h +45 -0
  859. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.m +113 -0
  860. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.h +118 -0
  861. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.m +254 -0
  862. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.h +55 -0
  863. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.m +231 -0
  864. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.h +155 -0
  865. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.m +1885 -0
  866. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.c +413 -0
  867. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.h +56 -0
  868. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.c +117 -0
  869. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.h +41 -0
  870. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.c +748 -0
  871. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.h +34 -0
  872. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.c +414 -0
  873. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.h +59 -0
  874. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.c +389 -0
  875. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.h +44 -0
  876. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.c +332 -0
  877. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.h +64 -0
  878. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.c +1335 -0
  879. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.h +25 -0
  880. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.c +131 -0
  881. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.h +38 -0
  882. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.c +418 -0
  883. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.h +170 -0
  884. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.c +565 -0
  885. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.h +82 -0
  886. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents.c +41 -0
  887. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents_c.h +27 -0
  888. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer.c +89 -0
  889. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer_c.h +27 -0
  890. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.c +144 -0
  891. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.h +30 -0
  892. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.c +716 -0
  893. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.h +40 -0
  894. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.c +178 -0
  895. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.h +32 -0
  896. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.c +275 -0
  897. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.h +42 -0
  898. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.c +119 -0
  899. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.h +49 -0
  900. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.c +354 -0
  901. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.h +58 -0
  902. data/ext/alphatau/native/sdl/src/video/haiku/SDL_BWin.h +679 -0
  903. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.cc +95 -0
  904. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.h +33 -0
  905. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.cc +41 -0
  906. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.h +39 -0
  907. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.cc +259 -0
  908. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.h +47 -0
  909. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.cc +190 -0
  910. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.h +44 -0
  911. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.cc +333 -0
  912. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.h +48 -0
  913. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.cc +176 -0
  914. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.h +55 -0
  915. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.cc +178 -0
  916. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.h +44 -0
  917. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.cc +233 -0
  918. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.h +55 -0
  919. data/ext/alphatau/native/sdl/src/video/khronos/EGL/egl.h +303 -0
  920. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglext.h +1241 -0
  921. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglplatform.h +132 -0
  922. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2.h +675 -0
  923. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2ext.h +3505 -0
  924. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2platform.h +38 -0
  925. data/ext/alphatau/native/sdl/src/video/khronos/KHR/khrplatform.h +284 -0
  926. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vk_platform.h +120 -0
  927. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vulkan.h +6458 -0
  928. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.c +171 -0
  929. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.h +53 -0
  930. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.c +42 -0
  931. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.h +31 -0
  932. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.c +501 -0
  933. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.h +45 -0
  934. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.c +189 -0
  935. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.h +48 -0
  936. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmsym.h +99 -0
  937. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.c +664 -0
  938. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.h +124 -0
  939. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.c +170 -0
  940. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.h +53 -0
  941. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.c +321 -0
  942. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.h +37 -0
  943. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.c +134 -0
  944. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.h +47 -0
  945. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.c +292 -0
  946. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.h +37 -0
  947. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.c +78 -0
  948. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.h +53 -0
  949. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirsym.h +143 -0
  950. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.c +423 -0
  951. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.h +49 -0
  952. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.c +176 -0
  953. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.h +52 -0
  954. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.c +374 -0
  955. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.h +93 -0
  956. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents.c +438 -0
  957. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents_c.h +30 -0
  958. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclglue.c +24 -0
  959. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.c +174 -0
  960. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.h +38 -0
  961. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.c +183 -0
  962. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.h +67 -0
  963. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.c +79 -0
  964. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.h +32 -0
  965. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.c +838 -0
  966. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.h +101 -0
  967. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.c +38 -0
  968. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.h +25 -0
  969. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents.c +290 -0
  970. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents_c.h +31 -0
  971. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl.c +210 -0
  972. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl_c.h +54 -0
  973. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse.c +41 -0
  974. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse_c.h +24 -0
  975. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.c +333 -0
  976. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.h +102 -0
  977. data/ext/alphatau/native/sdl/src/video/qnx/gl.c +285 -0
  978. data/ext/alphatau/native/sdl/src/video/qnx/keyboard.c +133 -0
  979. data/ext/alphatau/native/sdl/src/video/qnx/sdl_qnx.h +48 -0
  980. data/ext/alphatau/native/sdl/src/video/qnx/video.c +364 -0
  981. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents.c +45 -0
  982. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents_c.h +31 -0
  983. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.c +386 -0
  984. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.h +43 -0
  985. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.c +71 -0
  986. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.h +49 -0
  987. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.c +442 -0
  988. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.h +104 -0
  989. data/ext/alphatau/native/sdl/src/video/sdlgenblit.pl +535 -0
  990. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.h +47 -0
  991. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.m +516 -0
  992. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.h +35 -0
  993. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.m +111 -0
  994. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.h +30 -0
  995. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.m +73 -0
  996. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.h +31 -0
  997. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.m +208 -0
  998. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.h +58 -0
  999. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.m +131 -0
  1000. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.h +54 -0
  1001. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.m +378 -0
  1002. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.h +40 -0
  1003. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.m +250 -0
  1004. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.h +60 -0
  1005. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.m +384 -0
  1006. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.h +46 -0
  1007. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.m +249 -0
  1008. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.h +41 -0
  1009. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.m +328 -0
  1010. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.h +91 -0
  1011. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.m +532 -0
  1012. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.h +54 -0
  1013. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.m +222 -0
  1014. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.h +56 -0
  1015. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.m +465 -0
  1016. data/ext/alphatau/native/sdl/src/video/uikit/keyinfotable.h +174 -0
  1017. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.c +47 -0
  1018. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.h +48 -0
  1019. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.c +54 -0
  1020. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.h +47 -0
  1021. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.c +409 -0
  1022. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.h +91 -0
  1023. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.c +123 -0
  1024. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.h +32 -0
  1025. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.c +468 -0
  1026. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.h +103 -0
  1027. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.c +178 -0
  1028. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.h +107 -0
  1029. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents.c +1134 -0
  1030. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents_c.h +51 -0
  1031. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.c +396 -0
  1032. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.h +31 -0
  1033. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.c +93 -0
  1034. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.h +49 -0
  1035. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandsym.h +127 -0
  1036. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.c +265 -0
  1037. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.h +352 -0
  1038. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.c +517 -0
  1039. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.h +85 -0
  1040. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.c +176 -0
  1041. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.h +52 -0
  1042. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.c +684 -0
  1043. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.h +88 -0
  1044. data/ext/alphatau/native/sdl/src/video/windows/SDL_msctf.h +242 -0
  1045. data/ext/alphatau/native/sdl/src/video/windows/SDL_vkeys.h +76 -0
  1046. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.c +160 -0
  1047. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.h +36 -0
  1048. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.c +1229 -0
  1049. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.h +36 -0
  1050. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.c +127 -0
  1051. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.h +27 -0
  1052. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.c +1579 -0
  1053. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.h +40 -0
  1054. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.c +905 -0
  1055. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.h +29 -0
  1056. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.c +407 -0
  1057. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.h +47 -0
  1058. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.c +322 -0
  1059. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.h +33 -0
  1060. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.c +895 -0
  1061. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.h +142 -0
  1062. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.c +131 -0
  1063. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.h +49 -0
  1064. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.c +110 -0
  1065. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.h +40 -0
  1066. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowstaskdialog.h +156 -0
  1067. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.c +442 -0
  1068. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.h +199 -0
  1069. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.c +176 -0
  1070. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.h +52 -0
  1071. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.c +992 -0
  1072. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.h +86 -0
  1073. data/ext/alphatau/native/sdl/src/video/windows/wmmsg.h +1052 -0
  1074. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents.cpp +154 -0
  1075. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents_c.h +82 -0
  1076. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar.cpp +196 -0
  1077. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar_cpp.h +35 -0
  1078. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtkeyboard.cpp +430 -0
  1079. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.cpp +112 -0
  1080. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.h +29 -0
  1081. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse.cpp +224 -0
  1082. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse_c.h +40 -0
  1083. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.cpp +203 -0
  1084. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.h +70 -0
  1085. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtpointerinput.cpp +415 -0
  1086. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo.cpp +842 -0
  1087. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo_cpp.h +106 -0
  1088. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.c +199 -0
  1089. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.h +33 -0
  1090. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.c +212 -0
  1091. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.h +111 -0
  1092. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.c +1500 -0
  1093. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.h +31 -0
  1094. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.c +257 -0
  1095. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.h +31 -0
  1096. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.c +543 -0
  1097. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.h +36 -0
  1098. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.c +853 -0
  1099. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.h +28 -0
  1100. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.c +1112 -0
  1101. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.h +85 -0
  1102. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.c +448 -0
  1103. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.h +31 -0
  1104. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.c +946 -0
  1105. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.h +84 -0
  1106. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.c +109 -0
  1107. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.h +56 -0
  1108. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.c +115 -0
  1109. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.h +39 -0
  1110. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11sym.h +337 -0
  1111. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.c +54 -0
  1112. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.h +32 -0
  1113. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.c +497 -0
  1114. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.h +156 -0
  1115. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.c +243 -0
  1116. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.h +48 -0
  1117. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.c +1619 -0
  1118. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.h +111 -0
  1119. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.c +313 -0
  1120. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.h +42 -0
  1121. data/ext/alphatau/native/sdl/src/video/x11/edid-parse.c +754 -0
  1122. data/ext/alphatau/native/sdl/src/video/x11/edid.h +167 -0
  1123. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.c +350 -0
  1124. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.h +32 -0
  1125. data/ext/alphatau/native/sdl/src/video/yuv2rgb/LICENSE +27 -0
  1126. data/ext/alphatau/native/sdl/src/video/yuv2rgb/README.md +63 -0
  1127. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.c +687 -0
  1128. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.h +381 -0
  1129. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_sse_func.h +498 -0
  1130. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_std_func.h +228 -0
  1131. data/ext/alphatau/native/sdl/test/CMakeLists.txt +122 -0
  1132. data/ext/alphatau/native/sdl/test/COPYING +8 -0
  1133. data/ext/alphatau/native/sdl/test/Makefile.in +328 -0
  1134. data/ext/alphatau/native/sdl/test/README +47 -0
  1135. data/ext/alphatau/native/sdl/test/acinclude.m4 +359 -0
  1136. data/ext/alphatau/native/sdl/test/aclocal.m4 +359 -0
  1137. data/ext/alphatau/native/sdl/test/autogen.sh +12 -0
  1138. data/ext/alphatau/native/sdl/test/axis.bmp +0 -0
  1139. data/ext/alphatau/native/sdl/test/button.bmp +0 -0
  1140. data/ext/alphatau/native/sdl/test/checkkeys.c +248 -0
  1141. data/ext/alphatau/native/sdl/test/configure +5124 -0
  1142. data/ext/alphatau/native/sdl/test/configure.in +191 -0
  1143. data/ext/alphatau/native/sdl/test/controllermap.bmp +0 -0
  1144. data/ext/alphatau/native/sdl/test/controllermap.c +781 -0
  1145. data/ext/alphatau/native/sdl/test/emscripten/joystick-pre.js +25 -0
  1146. data/ext/alphatau/native/sdl/test/gcc-fat.sh +110 -0
  1147. data/ext/alphatau/native/sdl/test/icon.bmp +0 -0
  1148. data/ext/alphatau/native/sdl/test/loopwave.c +179 -0
  1149. data/ext/alphatau/native/sdl/test/loopwavequeue.c +149 -0
  1150. data/ext/alphatau/native/sdl/test/moose.dat +0 -0
  1151. data/ext/alphatau/native/sdl/test/nacl/Makefile +63 -0
  1152. data/ext/alphatau/native/sdl/test/nacl/background.js +40 -0
  1153. data/ext/alphatau/native/sdl/test/nacl/common.js +474 -0
  1154. data/ext/alphatau/native/sdl/test/nacl/index.html +21 -0
  1155. data/ext/alphatau/native/sdl/test/nacl/manifest.json +22 -0
  1156. data/ext/alphatau/native/sdl/test/picture.xbm +14 -0
  1157. data/ext/alphatau/native/sdl/test/relative_mode.markdown +58 -0
  1158. data/ext/alphatau/native/sdl/test/sample.bmp +0 -0
  1159. data/ext/alphatau/native/sdl/test/sample.wav +0 -0
  1160. data/ext/alphatau/native/sdl/test/shapes/p01_shape24.bmp +0 -0
  1161. data/ext/alphatau/native/sdl/test/shapes/p01_shape32alpha.bmp +0 -0
  1162. data/ext/alphatau/native/sdl/test/shapes/p01_shape8.bmp +0 -0
  1163. data/ext/alphatau/native/sdl/test/shapes/p02_shape24.bmp +0 -0
  1164. data/ext/alphatau/native/sdl/test/shapes/p02_shape32alpha.bmp +0 -0
  1165. data/ext/alphatau/native/sdl/test/shapes/p02_shape8.bmp +0 -0
  1166. data/ext/alphatau/native/sdl/test/shapes/p03_shape24.bmp +0 -0
  1167. data/ext/alphatau/native/sdl/test/shapes/p03_shape8.bmp +0 -0
  1168. data/ext/alphatau/native/sdl/test/shapes/p04_shape1.bmp +0 -0
  1169. data/ext/alphatau/native/sdl/test/shapes/p04_shape24.bmp +0 -0
  1170. data/ext/alphatau/native/sdl/test/shapes/p04_shape32alpha.bmp +0 -0
  1171. data/ext/alphatau/native/sdl/test/shapes/p04_shape8.bmp +0 -0
  1172. data/ext/alphatau/native/sdl/test/shapes/p05_shape8.bmp +0 -0
  1173. data/ext/alphatau/native/sdl/test/shapes/p06_shape1alpha.bmp +0 -0
  1174. data/ext/alphatau/native/sdl/test/shapes/p06_shape24.bmp +0 -0
  1175. data/ext/alphatau/native/sdl/test/shapes/p06_shape32alpha.bmp +0 -0
  1176. data/ext/alphatau/native/sdl/test/shapes/p06_shape8.bmp +0 -0
  1177. data/ext/alphatau/native/sdl/test/shapes/p07_shape24.bmp +0 -0
  1178. data/ext/alphatau/native/sdl/test/shapes/p07_shape32alpha.bmp +0 -0
  1179. data/ext/alphatau/native/sdl/test/shapes/p07_shape8.bmp +0 -0
  1180. data/ext/alphatau/native/sdl/test/shapes/p08_shape24.bmp +0 -0
  1181. data/ext/alphatau/native/sdl/test/shapes/p08_shape32alpha.bmp +0 -0
  1182. data/ext/alphatau/native/sdl/test/shapes/p08_shape8.bmp +0 -0
  1183. data/ext/alphatau/native/sdl/test/shapes/p09_shape24.bmp +0 -0
  1184. data/ext/alphatau/native/sdl/test/shapes/p09_shape32alpha.bmp +0 -0
  1185. data/ext/alphatau/native/sdl/test/shapes/p09_shape8.bmp +0 -0
  1186. data/ext/alphatau/native/sdl/test/shapes/p10_shape1.bmp +0 -0
  1187. data/ext/alphatau/native/sdl/test/shapes/p10_shape24.bmp +0 -0
  1188. data/ext/alphatau/native/sdl/test/shapes/p10_shape32alpha.bmp +0 -0
  1189. data/ext/alphatau/native/sdl/test/shapes/p10_shape8.bmp +0 -0
  1190. data/ext/alphatau/native/sdl/test/shapes/p11_shape24.bmp +0 -0
  1191. data/ext/alphatau/native/sdl/test/shapes/p11_shape32alpha.bmp +0 -0
  1192. data/ext/alphatau/native/sdl/test/shapes/p11_shape8.bmp +0 -0
  1193. data/ext/alphatau/native/sdl/test/shapes/p12_shape24.bmp +0 -0
  1194. data/ext/alphatau/native/sdl/test/shapes/p12_shape8.bmp +0 -0
  1195. data/ext/alphatau/native/sdl/test/shapes/p13_shape24.bmp +0 -0
  1196. data/ext/alphatau/native/sdl/test/shapes/p13_shape32alpha.bmp +0 -0
  1197. data/ext/alphatau/native/sdl/test/shapes/p13_shape8.bmp +0 -0
  1198. data/ext/alphatau/native/sdl/test/shapes/p14_shape24.bmp +0 -0
  1199. data/ext/alphatau/native/sdl/test/shapes/p14_shape8.bmp +0 -0
  1200. data/ext/alphatau/native/sdl/test/shapes/p15_shape24.bmp +0 -0
  1201. data/ext/alphatau/native/sdl/test/shapes/p15_shape32alpha.bmp +0 -0
  1202. data/ext/alphatau/native/sdl/test/shapes/p15_shape8.bmp +0 -0
  1203. data/ext/alphatau/native/sdl/test/shapes/p16_shape1.bmp +0 -0
  1204. data/ext/alphatau/native/sdl/test/shapes/p16_shape24.bmp +0 -0
  1205. data/ext/alphatau/native/sdl/test/shapes/p16_shape8.bmp +0 -0
  1206. data/ext/alphatau/native/sdl/test/shapes/trollface_24.bmp +0 -0
  1207. data/ext/alphatau/native/sdl/test/shapes/trollface_32alpha.bmp +0 -0
  1208. data/ext/alphatau/native/sdl/test/testatomic.c +727 -0
  1209. data/ext/alphatau/native/sdl/test/testaudiocapture.c +165 -0
  1210. data/ext/alphatau/native/sdl/test/testaudiohotplug.c +203 -0
  1211. data/ext/alphatau/native/sdl/test/testaudioinfo.c +74 -0
  1212. data/ext/alphatau/native/sdl/test/testautomation.c +124 -0
  1213. data/ext/alphatau/native/sdl/test/testautomation_audio.c +1038 -0
  1214. data/ext/alphatau/native/sdl/test/testautomation_clipboard.c +184 -0
  1215. data/ext/alphatau/native/sdl/test/testautomation_events.c +201 -0
  1216. data/ext/alphatau/native/sdl/test/testautomation_hints.c +168 -0
  1217. data/ext/alphatau/native/sdl/test/testautomation_keyboard.c +713 -0
  1218. data/ext/alphatau/native/sdl/test/testautomation_main.c +157 -0
  1219. data/ext/alphatau/native/sdl/test/testautomation_mouse.c +606 -0
  1220. data/ext/alphatau/native/sdl/test/testautomation_pixels.c +529 -0
  1221. data/ext/alphatau/native/sdl/test/testautomation_platform.c +584 -0
  1222. data/ext/alphatau/native/sdl/test/testautomation_rect.c +1696 -0
  1223. data/ext/alphatau/native/sdl/test/testautomation_render.c +1099 -0
  1224. data/ext/alphatau/native/sdl/test/testautomation_rwops.c +748 -0
  1225. data/ext/alphatau/native/sdl/test/testautomation_sdltest.c +1319 -0
  1226. data/ext/alphatau/native/sdl/test/testautomation_stdlib.c +319 -0
  1227. data/ext/alphatau/native/sdl/test/testautomation_suites.h +54 -0
  1228. data/ext/alphatau/native/sdl/test/testautomation_surface.c +647 -0
  1229. data/ext/alphatau/native/sdl/test/testautomation_syswm.c +61 -0
  1230. data/ext/alphatau/native/sdl/test/testautomation_timer.c +201 -0
  1231. data/ext/alphatau/native/sdl/test/testautomation_video.c +1811 -0
  1232. data/ext/alphatau/native/sdl/test/testbounds.c +40 -0
  1233. data/ext/alphatau/native/sdl/test/testcustomcursor.c +259 -0
  1234. data/ext/alphatau/native/sdl/test/testdisplayinfo.c +96 -0
  1235. data/ext/alphatau/native/sdl/test/testdraw2.c +305 -0
  1236. data/ext/alphatau/native/sdl/test/testdrawchessboard.c +147 -0
  1237. data/ext/alphatau/native/sdl/test/testdropfile.c +98 -0
  1238. data/ext/alphatau/native/sdl/test/testerror.c +76 -0
  1239. data/ext/alphatau/native/sdl/test/testfile.c +283 -0
  1240. data/ext/alphatau/native/sdl/test/testfilesystem.c +60 -0
  1241. data/ext/alphatau/native/sdl/test/testgamecontroller.c +375 -0
  1242. data/ext/alphatau/native/sdl/test/testgesture.c +309 -0
  1243. data/ext/alphatau/native/sdl/test/testgl2.c +416 -0
  1244. data/ext/alphatau/native/sdl/test/testgles.c +355 -0
  1245. data/ext/alphatau/native/sdl/test/testgles2.c +732 -0
  1246. data/ext/alphatau/native/sdl/test/testhaptic.c +369 -0
  1247. data/ext/alphatau/native/sdl/test/testhittesting.c +134 -0
  1248. data/ext/alphatau/native/sdl/test/testhotplug.c +162 -0
  1249. data/ext/alphatau/native/sdl/test/testiconv.c +88 -0
  1250. data/ext/alphatau/native/sdl/test/testime.c +801 -0
  1251. data/ext/alphatau/native/sdl/test/testintersections.c +363 -0
  1252. data/ext/alphatau/native/sdl/test/testjoystick.c +387 -0
  1253. data/ext/alphatau/native/sdl/test/testkeys.c +40 -0
  1254. data/ext/alphatau/native/sdl/test/testloadso.c +82 -0
  1255. data/ext/alphatau/native/sdl/test/testlock.c +128 -0
  1256. data/ext/alphatau/native/sdl/test/testmessage.c +193 -0
  1257. data/ext/alphatau/native/sdl/test/testmultiaudio.c +199 -0
  1258. data/ext/alphatau/native/sdl/test/testnative.c +237 -0
  1259. data/ext/alphatau/native/sdl/test/testnative.h +46 -0
  1260. data/ext/alphatau/native/sdl/test/testnativecocoa.m +51 -0
  1261. data/ext/alphatau/native/sdl/test/testnativew32.c +86 -0
  1262. data/ext/alphatau/native/sdl/test/testnativex11.c +53 -0
  1263. data/ext/alphatau/native/sdl/test/testoverlay2.c +408 -0
  1264. data/ext/alphatau/native/sdl/test/testplatform.c +442 -0
  1265. data/ext/alphatau/native/sdl/test/testpower.c +80 -0
  1266. data/ext/alphatau/native/sdl/test/testqsort.c +108 -0
  1267. data/ext/alphatau/native/sdl/test/testrelative.c +126 -0
  1268. data/ext/alphatau/native/sdl/test/testrendercopyex.c +233 -0
  1269. data/ext/alphatau/native/sdl/test/testrendertarget.c +335 -0
  1270. data/ext/alphatau/native/sdl/test/testresample.c +120 -0
  1271. data/ext/alphatau/native/sdl/test/testrumble.c +153 -0
  1272. data/ext/alphatau/native/sdl/test/testscale.c +224 -0
  1273. data/ext/alphatau/native/sdl/test/testsem.c +130 -0
  1274. data/ext/alphatau/native/sdl/test/testsensor.c +117 -0
  1275. data/ext/alphatau/native/sdl/test/testshader.c +500 -0
  1276. data/ext/alphatau/native/sdl/test/testshape.c +200 -0
  1277. data/ext/alphatau/native/sdl/test/testsprite2.c +409 -0
  1278. data/ext/alphatau/native/sdl/test/testspriteminimal.c +194 -0
  1279. data/ext/alphatau/native/sdl/test/teststreaming.c +190 -0
  1280. data/ext/alphatau/native/sdl/test/testthread.c +130 -0
  1281. data/ext/alphatau/native/sdl/test/testtimer.c +122 -0
  1282. data/ext/alphatau/native/sdl/test/testver.c +47 -0
  1283. data/ext/alphatau/native/sdl/test/testviewport.c +217 -0
  1284. data/ext/alphatau/native/sdl/test/testvulkan.c +1201 -0
  1285. data/ext/alphatau/native/sdl/test/testwm2.c +174 -0
  1286. data/ext/alphatau/native/sdl/test/testyuv.bmp +0 -0
  1287. data/ext/alphatau/native/sdl/test/testyuv.c +455 -0
  1288. data/ext/alphatau/native/sdl/test/testyuv_cvt.c +300 -0
  1289. data/ext/alphatau/native/sdl/test/testyuv_cvt.h +16 -0
  1290. data/ext/alphatau/native/sdl/test/torturethread.c +113 -0
  1291. data/ext/alphatau/native/sdl/test/utf8.txt +287 -0
  1292. data/ext/alphatau/native/sdl/visualtest/COPYING.txt +18 -0
  1293. data/ext/alphatau/native/sdl/visualtest/Makefile.in +37 -0
  1294. data/ext/alphatau/native/sdl/visualtest/README.txt +214 -0
  1295. data/ext/alphatau/native/sdl/visualtest/acinclude.m4 +359 -0
  1296. data/ext/alphatau/native/sdl/visualtest/autogen.sh +12 -0
  1297. data/ext/alphatau/native/sdl/visualtest/compile +1 -0
  1298. data/ext/alphatau/native/sdl/visualtest/config.h +23 -0
  1299. data/ext/alphatau/native/sdl/visualtest/config.h.in +22 -0
  1300. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +3 -0
  1301. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +5 -0
  1302. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +5 -0
  1303. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +1 -0
  1304. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +5 -0
  1305. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +24 -0
  1306. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +3 -0
  1307. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +5 -0
  1308. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +5 -0
  1309. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +3 -0
  1310. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +5 -0
  1311. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +5 -0
  1312. data/ext/alphatau/native/sdl/visualtest/configure +5203 -0
  1313. data/ext/alphatau/native/sdl/visualtest/configure.in +166 -0
  1314. data/ext/alphatau/native/sdl/visualtest/depcomp +1 -0
  1315. data/ext/alphatau/native/sdl/visualtest/docs/Doxyfile +1936 -0
  1316. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_action_configparser.h +149 -0
  1317. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_exhaustive_variator.h +64 -0
  1318. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_harness_argparser.h +75 -0
  1319. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_mischelper.h +28 -0
  1320. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_parsehelper.h +46 -0
  1321. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_process.h +112 -0
  1322. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_random_variator.h +61 -0
  1323. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_rwhelper.h +87 -0
  1324. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_screenshot.h +52 -0
  1325. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_sut_configparser.h +105 -0
  1326. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variator_common.h +122 -0
  1327. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variators.h +66 -0
  1328. data/ext/alphatau/native/sdl/visualtest/install-sh +1 -0
  1329. data/ext/alphatau/native/sdl/visualtest/launch_harness.cmd +2 -0
  1330. data/ext/alphatau/native/sdl/visualtest/launch_harness.sh +6 -0
  1331. data/ext/alphatau/native/sdl/visualtest/missing +1 -0
  1332. data/ext/alphatau/native/sdl/visualtest/src/action_configparser.c +396 -0
  1333. data/ext/alphatau/native/sdl/visualtest/src/harness_argparser.c +358 -0
  1334. data/ext/alphatau/native/sdl/visualtest/src/linux/linux_process.c +199 -0
  1335. data/ext/alphatau/native/sdl/visualtest/src/mischelper.c +28 -0
  1336. data/ext/alphatau/native/sdl/visualtest/src/parsehelper.c +231 -0
  1337. data/ext/alphatau/native/sdl/visualtest/src/rwhelper.c +131 -0
  1338. data/ext/alphatau/native/sdl/visualtest/src/screenshot.c +136 -0
  1339. data/ext/alphatau/native/sdl/visualtest/src/sut_configparser.c +232 -0
  1340. data/ext/alphatau/native/sdl/visualtest/src/testharness.c +533 -0
  1341. data/ext/alphatau/native/sdl/visualtest/src/variator_common.c +225 -0
  1342. data/ext/alphatau/native/sdl/visualtest/src/variator_exhaustive.c +132 -0
  1343. data/ext/alphatau/native/sdl/visualtest/src/variator_random.c +111 -0
  1344. data/ext/alphatau/native/sdl/visualtest/src/variators.c +93 -0
  1345. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_process.c +284 -0
  1346. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_screenshot.c +349 -0
  1347. data/ext/alphatau/native/sdl/visualtest/stamp-h1 +1 -0
  1348. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.actions +3 -0
  1349. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.config +6 -0
  1350. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.parameters +29 -0
  1351. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.actions +1 -0
  1352. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.c +101 -0
  1353. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.config +5 -0
  1354. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.parameters +3 -0
  1355. data/ext/alphatau/native/sdl/wayland-protocols/pointer-constraints-unstable-v1.xml +339 -0
  1356. data/ext/alphatau/native/sdl/wayland-protocols/relative-pointer-unstable-v1.xml +136 -0
  1357. data/ext/alphatau/native/sdl/wayland-protocols/wayland.xml +2746 -0
  1358. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell-unstable-v6.xml +1044 -0
  1359. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell.xml +1120 -0
  1360. data/lib/alphatau.rb +12 -0
  1361. data/lib/alphatau/version.rb +3 -0
  1362. metadata +1465 -0
@@ -0,0 +1,79 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ #ifndef SDL_audio_c_h_
23
+ #define SDL_audio_c_h_
24
+
25
+ #include "../SDL_internal.h"
26
+
27
+ #ifndef DEBUG_CONVERT
28
+ #define DEBUG_CONVERT 0
29
+ #endif
30
+
31
+ #if DEBUG_CONVERT
32
+ #define LOG_DEBUG_CONVERT(from, to) fprintf(stderr, "Converting %s to %s.\n", from, to);
33
+ #else
34
+ #define LOG_DEBUG_CONVERT(from, to)
35
+ #endif
36
+
37
+ /* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
38
+
39
+ #ifdef HAVE_LIBSAMPLERATE_H
40
+ #include "samplerate.h"
41
+ extern SDL_bool SRC_available;
42
+ extern int SRC_converter;
43
+ extern SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error);
44
+ extern int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data);
45
+ extern int (*SRC_src_reset)(SRC_STATE *state);
46
+ extern SRC_STATE* (*SRC_src_delete)(SRC_STATE *state);
47
+ extern const char* (*SRC_src_strerror)(int error);
48
+ #endif
49
+
50
+ /* Functions to get a list of "close" audio formats */
51
+ extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
52
+ extern SDL_AudioFormat SDL_NextAudioFormat(void);
53
+
54
+ /* Function to calculate the size and silence for a SDL_AudioSpec */
55
+ extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
56
+
57
+ /* Choose the audio filter functions below */
58
+ extern void SDL_ChooseAudioConverters(void);
59
+
60
+ /* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */
61
+ extern SDL_AudioFilter SDL_Convert_S8_to_F32;
62
+ extern SDL_AudioFilter SDL_Convert_U8_to_F32;
63
+ extern SDL_AudioFilter SDL_Convert_S16_to_F32;
64
+ extern SDL_AudioFilter SDL_Convert_U16_to_F32;
65
+ extern SDL_AudioFilter SDL_Convert_S32_to_F32;
66
+ extern SDL_AudioFilter SDL_Convert_F32_to_S8;
67
+ extern SDL_AudioFilter SDL_Convert_F32_to_U8;
68
+ extern SDL_AudioFilter SDL_Convert_F32_to_S16;
69
+ extern SDL_AudioFilter SDL_Convert_F32_to_U16;
70
+ extern SDL_AudioFilter SDL_Convert_F32_to_S32;
71
+
72
+ /* You need to call SDL_PrepareResampleFilter() before using the internal resampler.
73
+ SDL_AudioQuit() calls SDL_FreeResamplerFilter(), you should never call it yourself. */
74
+ extern int SDL_PrepareResampleFilter(void);
75
+ extern void SDL_FreeResampleFilter(void);
76
+
77
+ #endif /* SDL_audio_c_h_ */
78
+
79
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,1673 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+ #include "../SDL_internal.h"
22
+
23
+ /* Functions for audio drivers to perform runtime conversion of audio format */
24
+
25
+ /* FIXME: Channel weights when converting from more channels to fewer may need to be adjusted, see https://msdn.microsoft.com/en-us/library/windows/desktop/ff819070(v=vs.85).aspx
26
+ */
27
+
28
+ #include "SDL.h"
29
+ #include "SDL_audio.h"
30
+ #include "SDL_audio_c.h"
31
+
32
+ #include "SDL_loadso.h"
33
+ #include "SDL_assert.h"
34
+ #include "../SDL_dataqueue.h"
35
+ #include "SDL_cpuinfo.h"
36
+
37
+ #define DEBUG_AUDIOSTREAM 0
38
+
39
+ #ifdef __SSE3__
40
+ #define HAVE_SSE3_INTRINSICS 1
41
+ #endif
42
+
43
+ #if HAVE_SSE3_INTRINSICS
44
+ /* Convert from stereo to mono. Average left and right. */
45
+ static void SDLCALL
46
+ SDL_ConvertStereoToMono_SSE3(SDL_AudioCVT * cvt, SDL_AudioFormat format)
47
+ {
48
+ float *dst = (float *) cvt->buf;
49
+ const float *src = dst;
50
+ int i = cvt->len_cvt / 8;
51
+
52
+ LOG_DEBUG_CONVERT("stereo", "mono (using SSE3)");
53
+ SDL_assert(format == AUDIO_F32SYS);
54
+
55
+ /* We can only do this if dst is aligned to 16 bytes; since src is the
56
+ same pointer and it moves by 2, it can't be forcibly aligned. */
57
+ if ((((size_t) dst) & 15) == 0) {
58
+ /* Aligned! Do SSE blocks as long as we have 16 bytes available. */
59
+ const __m128 divby2 = _mm_set1_ps(0.5f);
60
+ while (i >= 4) { /* 4 * float32 */
61
+ _mm_store_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_load_ps(src), _mm_load_ps(src+4)), divby2));
62
+ i -= 4; src += 8; dst += 4;
63
+ }
64
+ }
65
+
66
+ /* Finish off any leftovers with scalar operations. */
67
+ while (i) {
68
+ *dst = (src[0] + src[1]) * 0.5f;
69
+ dst++; i--; src += 2;
70
+ }
71
+
72
+ cvt->len_cvt /= 2;
73
+ if (cvt->filters[++cvt->filter_index]) {
74
+ cvt->filters[cvt->filter_index] (cvt, format);
75
+ }
76
+ }
77
+ #endif
78
+
79
+ /* Convert from stereo to mono. Average left and right. */
80
+ static void SDLCALL
81
+ SDL_ConvertStereoToMono(SDL_AudioCVT * cvt, SDL_AudioFormat format)
82
+ {
83
+ float *dst = (float *) cvt->buf;
84
+ const float *src = dst;
85
+ int i;
86
+
87
+ LOG_DEBUG_CONVERT("stereo", "mono");
88
+ SDL_assert(format == AUDIO_F32SYS);
89
+
90
+ for (i = cvt->len_cvt / 8; i; --i, src += 2) {
91
+ *(dst++) = (src[0] + src[1]) * 0.5f;
92
+ }
93
+
94
+ cvt->len_cvt /= 2;
95
+ if (cvt->filters[++cvt->filter_index]) {
96
+ cvt->filters[cvt->filter_index] (cvt, format);
97
+ }
98
+ }
99
+
100
+
101
+ /* Convert from 5.1 to stereo. Average left and right, distribute center, discard LFE. */
102
+ static void SDLCALL
103
+ SDL_Convert51ToStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
104
+ {
105
+ float *dst = (float *) cvt->buf;
106
+ const float *src = dst;
107
+ int i;
108
+
109
+ LOG_DEBUG_CONVERT("5.1", "stereo");
110
+ SDL_assert(format == AUDIO_F32SYS);
111
+
112
+ /* SDL's 5.1 layout: FL+FR+FC+LFE+BL+BR */
113
+ for (i = cvt->len_cvt / (sizeof (float) * 6); i; --i, src += 6, dst += 2) {
114
+ const float front_center_distributed = src[2] * 0.5f;
115
+ dst[0] = (src[0] + front_center_distributed + src[4]) / 2.5f; /* left */
116
+ dst[1] = (src[1] + front_center_distributed + src[5]) / 2.5f; /* right */
117
+ }
118
+
119
+ cvt->len_cvt /= 3;
120
+ if (cvt->filters[++cvt->filter_index]) {
121
+ cvt->filters[cvt->filter_index] (cvt, format);
122
+ }
123
+ }
124
+
125
+
126
+ /* Convert from quad to stereo. Average left and right. */
127
+ static void SDLCALL
128
+ SDL_ConvertQuadToStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
129
+ {
130
+ float *dst = (float *) cvt->buf;
131
+ const float *src = dst;
132
+ int i;
133
+
134
+ LOG_DEBUG_CONVERT("quad", "stereo");
135
+ SDL_assert(format == AUDIO_F32SYS);
136
+
137
+ for (i = cvt->len_cvt / (sizeof (float) * 4); i; --i, src += 4, dst += 2) {
138
+ dst[0] = (src[0] + src[2]) * 0.5f; /* left */
139
+ dst[1] = (src[1] + src[3]) * 0.5f; /* right */
140
+ }
141
+
142
+ cvt->len_cvt /= 2;
143
+ if (cvt->filters[++cvt->filter_index]) {
144
+ cvt->filters[cvt->filter_index] (cvt, format);
145
+ }
146
+ }
147
+
148
+
149
+ /* Convert from 7.1 to 5.1. Distribute sides across front and back. */
150
+ static void SDLCALL
151
+ SDL_Convert71To51(SDL_AudioCVT * cvt, SDL_AudioFormat format)
152
+ {
153
+ float *dst = (float *) cvt->buf;
154
+ const float *src = dst;
155
+ int i;
156
+
157
+ LOG_DEBUG_CONVERT("7.1", "5.1");
158
+ SDL_assert(format == AUDIO_F32SYS);
159
+
160
+ for (i = cvt->len_cvt / (sizeof (float) * 8); i; --i, src += 8, dst += 6) {
161
+ const float surround_left_distributed = src[6] * 0.5f;
162
+ const float surround_right_distributed = src[7] * 0.5f;
163
+ dst[0] = (src[0] + surround_left_distributed) / 1.5f; /* FL */
164
+ dst[1] = (src[1] + surround_right_distributed) / 1.5f; /* FR */
165
+ dst[2] = src[2] / 1.5f; /* CC */
166
+ dst[3] = src[3] / 1.5f; /* LFE */
167
+ dst[4] = (src[4] + surround_left_distributed) / 1.5f; /* BL */
168
+ dst[5] = (src[5] + surround_right_distributed) / 1.5f; /* BR */
169
+ }
170
+
171
+ cvt->len_cvt /= 8;
172
+ cvt->len_cvt *= 6;
173
+ if (cvt->filters[++cvt->filter_index]) {
174
+ cvt->filters[cvt->filter_index] (cvt, format);
175
+ }
176
+ }
177
+
178
+
179
+ /* Convert from 5.1 to quad. Distribute center across front, discard LFE. */
180
+ static void SDLCALL
181
+ SDL_Convert51ToQuad(SDL_AudioCVT * cvt, SDL_AudioFormat format)
182
+ {
183
+ float *dst = (float *) cvt->buf;
184
+ const float *src = dst;
185
+ int i;
186
+
187
+ LOG_DEBUG_CONVERT("5.1", "quad");
188
+ SDL_assert(format == AUDIO_F32SYS);
189
+
190
+ /* SDL's 4.0 layout: FL+FR+BL+BR */
191
+ /* SDL's 5.1 layout: FL+FR+FC+LFE+BL+BR */
192
+ for (i = cvt->len_cvt / (sizeof (float) * 6); i; --i, src += 6, dst += 4) {
193
+ const float front_center_distributed = src[2] * 0.5f;
194
+ dst[0] = (src[0] + front_center_distributed) / 1.5f; /* FL */
195
+ dst[1] = (src[1] + front_center_distributed) / 1.5f; /* FR */
196
+ dst[2] = src[4] / 1.5f; /* BL */
197
+ dst[3] = src[5] / 1.5f; /* BR */
198
+ }
199
+
200
+ cvt->len_cvt /= 6;
201
+ cvt->len_cvt *= 4;
202
+ if (cvt->filters[++cvt->filter_index]) {
203
+ cvt->filters[cvt->filter_index] (cvt, format);
204
+ }
205
+ }
206
+
207
+
208
+ /* Upmix mono to stereo (by duplication) */
209
+ static void SDLCALL
210
+ SDL_ConvertMonoToStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
211
+ {
212
+ const float *src = (const float *) (cvt->buf + cvt->len_cvt);
213
+ float *dst = (float *) (cvt->buf + cvt->len_cvt * 2);
214
+ int i;
215
+
216
+ LOG_DEBUG_CONVERT("mono", "stereo");
217
+ SDL_assert(format == AUDIO_F32SYS);
218
+
219
+ for (i = cvt->len_cvt / sizeof (float); i; --i) {
220
+ src--;
221
+ dst -= 2;
222
+ dst[0] = dst[1] = *src;
223
+ }
224
+
225
+ cvt->len_cvt *= 2;
226
+ if (cvt->filters[++cvt->filter_index]) {
227
+ cvt->filters[cvt->filter_index] (cvt, format);
228
+ }
229
+ }
230
+
231
+
232
+ /* Upmix stereo to a pseudo-5.1 stream */
233
+ static void SDLCALL
234
+ SDL_ConvertStereoTo51(SDL_AudioCVT * cvt, SDL_AudioFormat format)
235
+ {
236
+ int i;
237
+ float lf, rf, ce;
238
+ const float *src = (const float *) (cvt->buf + cvt->len_cvt);
239
+ float *dst = (float *) (cvt->buf + cvt->len_cvt * 3);
240
+
241
+ LOG_DEBUG_CONVERT("stereo", "5.1");
242
+ SDL_assert(format == AUDIO_F32SYS);
243
+
244
+ for (i = cvt->len_cvt / (sizeof(float) * 2); i; --i) {
245
+ dst -= 6;
246
+ src -= 2;
247
+ lf = src[0];
248
+ rf = src[1];
249
+ ce = (lf + rf) * 0.5f;
250
+ /* !!! FIXME: FL and FR may clip */
251
+ dst[0] = lf + (lf - ce); /* FL */
252
+ dst[1] = rf + (rf - ce); /* FR */
253
+ dst[2] = ce; /* FC */
254
+ dst[3] = 0; /* LFE (only meant for special LFE effects) */
255
+ dst[4] = lf; /* BL */
256
+ dst[5] = rf; /* BR */
257
+ }
258
+
259
+ cvt->len_cvt *= 3;
260
+ if (cvt->filters[++cvt->filter_index]) {
261
+ cvt->filters[cvt->filter_index] (cvt, format);
262
+ }
263
+ }
264
+
265
+
266
+ /* Upmix quad to a pseudo-5.1 stream */
267
+ static void SDLCALL
268
+ SDL_ConvertQuadTo51(SDL_AudioCVT * cvt, SDL_AudioFormat format)
269
+ {
270
+ int i;
271
+ float lf, rf, lb, rb, ce;
272
+ const float *src = (const float *) (cvt->buf + cvt->len_cvt);
273
+ float *dst = (float *) (cvt->buf + cvt->len_cvt * 3 / 2);
274
+
275
+ LOG_DEBUG_CONVERT("quad", "5.1");
276
+ SDL_assert(format == AUDIO_F32SYS);
277
+ SDL_assert(cvt->len_cvt % (sizeof(float) * 4) == 0);
278
+
279
+ for (i = cvt->len_cvt / (sizeof(float) * 4); i; --i) {
280
+ dst -= 6;
281
+ src -= 4;
282
+ lf = src[0];
283
+ rf = src[1];
284
+ lb = src[2];
285
+ rb = src[3];
286
+ ce = (lf + rf) * 0.5f;
287
+ /* !!! FIXME: FL and FR may clip */
288
+ dst[0] = lf + (lf - ce); /* FL */
289
+ dst[1] = rf + (rf - ce); /* FR */
290
+ dst[2] = ce; /* FC */
291
+ dst[3] = 0; /* LFE (only meant for special LFE effects) */
292
+ dst[4] = lb; /* BL */
293
+ dst[5] = rb; /* BR */
294
+ }
295
+
296
+ cvt->len_cvt = cvt->len_cvt * 3 / 2;
297
+ if (cvt->filters[++cvt->filter_index]) {
298
+ cvt->filters[cvt->filter_index] (cvt, format);
299
+ }
300
+ }
301
+
302
+
303
+ /* Upmix stereo to a pseudo-4.0 stream (by duplication) */
304
+ static void SDLCALL
305
+ SDL_ConvertStereoToQuad(SDL_AudioCVT * cvt, SDL_AudioFormat format)
306
+ {
307
+ const float *src = (const float *) (cvt->buf + cvt->len_cvt);
308
+ float *dst = (float *) (cvt->buf + cvt->len_cvt * 2);
309
+ float lf, rf;
310
+ int i;
311
+
312
+ LOG_DEBUG_CONVERT("stereo", "quad");
313
+ SDL_assert(format == AUDIO_F32SYS);
314
+
315
+ for (i = cvt->len_cvt / (sizeof(float) * 2); i; --i) {
316
+ dst -= 4;
317
+ src -= 2;
318
+ lf = src[0];
319
+ rf = src[1];
320
+ dst[0] = lf; /* FL */
321
+ dst[1] = rf; /* FR */
322
+ dst[2] = lf; /* BL */
323
+ dst[3] = rf; /* BR */
324
+ }
325
+
326
+ cvt->len_cvt *= 2;
327
+ if (cvt->filters[++cvt->filter_index]) {
328
+ cvt->filters[cvt->filter_index] (cvt, format);
329
+ }
330
+ }
331
+
332
+
333
+ /* Upmix 5.1 to 7.1 */
334
+ static void SDLCALL
335
+ SDL_Convert51To71(SDL_AudioCVT * cvt, SDL_AudioFormat format)
336
+ {
337
+ float lf, rf, lb, rb, ls, rs;
338
+ int i;
339
+ const float *src = (const float *) (cvt->buf + cvt->len_cvt);
340
+ float *dst = (float *) (cvt->buf + cvt->len_cvt * 4 / 3);
341
+
342
+ LOG_DEBUG_CONVERT("5.1", "7.1");
343
+ SDL_assert(format == AUDIO_F32SYS);
344
+ SDL_assert(cvt->len_cvt % (sizeof(float) * 6) == 0);
345
+
346
+ for (i = cvt->len_cvt / (sizeof(float) * 6); i; --i) {
347
+ dst -= 8;
348
+ src -= 6;
349
+ lf = src[0];
350
+ rf = src[1];
351
+ lb = src[4];
352
+ rb = src[5];
353
+ ls = (lf + lb) * 0.5f;
354
+ rs = (rf + rb) * 0.5f;
355
+ /* !!! FIXME: these four may clip */
356
+ lf += lf - ls;
357
+ rf += rf - ls;
358
+ lb += lb - ls;
359
+ rb += rb - ls;
360
+ dst[3] = src[3]; /* LFE */
361
+ dst[2] = src[2]; /* FC */
362
+ dst[7] = rs; /* SR */
363
+ dst[6] = ls; /* SL */
364
+ dst[5] = rb; /* BR */
365
+ dst[4] = lb; /* BL */
366
+ dst[1] = rf; /* FR */
367
+ dst[0] = lf; /* FL */
368
+ }
369
+
370
+ cvt->len_cvt = cvt->len_cvt * 4 / 3;
371
+
372
+ if (cvt->filters[++cvt->filter_index]) {
373
+ cvt->filters[cvt->filter_index] (cvt, format);
374
+ }
375
+ }
376
+
377
+ /* SDL's resampler uses a "bandlimited interpolation" algorithm:
378
+ https://ccrma.stanford.edu/~jos/resample/ */
379
+
380
+ #define RESAMPLER_ZERO_CROSSINGS 5
381
+ #define RESAMPLER_BITS_PER_SAMPLE 16
382
+ #define RESAMPLER_SAMPLES_PER_ZERO_CROSSING (1 << ((RESAMPLER_BITS_PER_SAMPLE / 2) + 1))
383
+ #define RESAMPLER_FILTER_SIZE ((RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS) + 1)
384
+
385
+ /* This is a "modified" bessel function, so you can't use POSIX j0() */
386
+ static double
387
+ bessel(const double x)
388
+ {
389
+ const double xdiv2 = x / 2.0;
390
+ double i0 = 1.0f;
391
+ double f = 1.0f;
392
+ int i = 1;
393
+
394
+ while (SDL_TRUE) {
395
+ const double diff = SDL_pow(xdiv2, i * 2) / SDL_pow(f, 2);
396
+ if (diff < 1.0e-21f) {
397
+ break;
398
+ }
399
+ i0 += diff;
400
+ i++;
401
+ f *= (double) i;
402
+ }
403
+
404
+ return i0;
405
+ }
406
+
407
+ /* build kaiser table with cardinal sine applied to it, and array of differences between elements. */
408
+ static void
409
+ kaiser_and_sinc(float *table, float *diffs, const int tablelen, const double beta)
410
+ {
411
+ const int lenm1 = tablelen - 1;
412
+ const int lenm1div2 = lenm1 / 2;
413
+ int i;
414
+
415
+ table[0] = 1.0f;
416
+ for (i = 1; i < tablelen; i++) {
417
+ const double kaiser = bessel(beta * SDL_sqrt(1.0 - SDL_pow(((i - lenm1) / 2.0) / lenm1div2, 2.0))) / bessel(beta);
418
+ table[tablelen - i] = (float) kaiser;
419
+ }
420
+
421
+ for (i = 1; i < tablelen; i++) {
422
+ const float x = (((float) i) / ((float) RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) * ((float) M_PI);
423
+ table[i] *= SDL_sinf(x) / x;
424
+ diffs[i - 1] = table[i] - table[i - 1];
425
+ }
426
+ diffs[lenm1] = 0.0f;
427
+ }
428
+
429
+
430
+ static SDL_SpinLock ResampleFilterSpinlock = 0;
431
+ static float *ResamplerFilter = NULL;
432
+ static float *ResamplerFilterDifference = NULL;
433
+
434
+ int
435
+ SDL_PrepareResampleFilter(void)
436
+ {
437
+ SDL_AtomicLock(&ResampleFilterSpinlock);
438
+ if (!ResamplerFilter) {
439
+ /* if dB > 50, beta=(0.1102 * (dB - 8.7)), according to Matlab. */
440
+ const double dB = 80.0;
441
+ const double beta = 0.1102 * (dB - 8.7);
442
+ const size_t alloclen = RESAMPLER_FILTER_SIZE * sizeof (float);
443
+
444
+ ResamplerFilter = (float *) SDL_malloc(alloclen);
445
+ if (!ResamplerFilter) {
446
+ SDL_AtomicUnlock(&ResampleFilterSpinlock);
447
+ return SDL_OutOfMemory();
448
+ }
449
+
450
+ ResamplerFilterDifference = (float *) SDL_malloc(alloclen);
451
+ if (!ResamplerFilterDifference) {
452
+ SDL_free(ResamplerFilter);
453
+ ResamplerFilter = NULL;
454
+ SDL_AtomicUnlock(&ResampleFilterSpinlock);
455
+ return SDL_OutOfMemory();
456
+ }
457
+ kaiser_and_sinc(ResamplerFilter, ResamplerFilterDifference, RESAMPLER_FILTER_SIZE, beta);
458
+ }
459
+ SDL_AtomicUnlock(&ResampleFilterSpinlock);
460
+ return 0;
461
+ }
462
+
463
+ void
464
+ SDL_FreeResampleFilter(void)
465
+ {
466
+ SDL_free(ResamplerFilter);
467
+ SDL_free(ResamplerFilterDifference);
468
+ ResamplerFilter = NULL;
469
+ ResamplerFilterDifference = NULL;
470
+ }
471
+
472
+ static int
473
+ ResamplerPadding(const int inrate, const int outrate)
474
+ {
475
+ if (inrate == outrate) {
476
+ return 0;
477
+ } else if (inrate > outrate) {
478
+ return (int) SDL_ceil(((float) (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * inrate) / ((float) outrate)));
479
+ }
480
+ return RESAMPLER_SAMPLES_PER_ZERO_CROSSING;
481
+ }
482
+
483
+ /* lpadding and rpadding are expected to be buffers of (ResamplePadding(inrate, outrate) * chans * sizeof (float)) bytes. */
484
+ static int
485
+ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
486
+ const float *lpadding, const float *rpadding,
487
+ const float *inbuf, const int inbuflen,
488
+ float *outbuf, const int outbuflen)
489
+ {
490
+ const double finrate = (double) inrate;
491
+ const double outtimeincr = 1.0 / ((float) outrate);
492
+ const double ratio = ((float) outrate) / ((float) inrate);
493
+ const int paddinglen = ResamplerPadding(inrate, outrate);
494
+ const int framelen = chans * (int)sizeof (float);
495
+ const int inframes = inbuflen / framelen;
496
+ const int wantedoutframes = (int) ((inbuflen / framelen) * ratio); /* outbuflen isn't total to write, it's total available. */
497
+ const int maxoutframes = outbuflen / framelen;
498
+ const int outframes = SDL_min(wantedoutframes, maxoutframes);
499
+ float *dst = outbuf;
500
+ double outtime = 0.0;
501
+ int i, j, chan;
502
+
503
+ for (i = 0; i < outframes; i++) {
504
+ const int srcindex = (int) (outtime * inrate);
505
+ const double intime = ((double) srcindex) / finrate;
506
+ const double innexttime = ((double) (srcindex + 1)) / finrate;
507
+ const double interpolation1 = 1.0 - ((innexttime - outtime) / (innexttime - intime));
508
+ const int filterindex1 = (int) (interpolation1 * RESAMPLER_SAMPLES_PER_ZERO_CROSSING);
509
+ const double interpolation2 = 1.0 - interpolation1;
510
+ const int filterindex2 = (int) (interpolation2 * RESAMPLER_SAMPLES_PER_ZERO_CROSSING);
511
+
512
+ for (chan = 0; chan < chans; chan++) {
513
+ float outsample = 0.0f;
514
+
515
+ /* do this twice to calculate the sample, once for the "left wing" and then same for the right. */
516
+ /* !!! FIXME: do both wings in one loop */
517
+ for (j = 0; (filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
518
+ const int srcframe = srcindex - j;
519
+ /* !!! FIXME: we can bubble this conditional out of here by doing a pre loop. */
520
+ const float insample = (srcframe < 0) ? lpadding[((paddinglen + srcframe) * chans) + chan] : inbuf[(srcframe * chans) + chan];
521
+ outsample += (float)(insample * (ResamplerFilter[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation1 * ResamplerFilterDifference[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
522
+ }
523
+
524
+ for (j = 0; (filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
525
+ const int srcframe = srcindex + 1 + j;
526
+ /* !!! FIXME: we can bubble this conditional out of here by doing a post loop. */
527
+ const float insample = (srcframe >= inframes) ? rpadding[((srcframe - inframes) * chans) + chan] : inbuf[(srcframe * chans) + chan];
528
+ outsample += (float)(insample * (ResamplerFilter[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation2 * ResamplerFilterDifference[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
529
+ }
530
+ *(dst++) = outsample;
531
+ }
532
+
533
+ outtime += outtimeincr;
534
+ }
535
+
536
+ return outframes * chans * sizeof (float);
537
+ }
538
+
539
+ int
540
+ SDL_ConvertAudio(SDL_AudioCVT * cvt)
541
+ {
542
+ /* !!! FIXME: (cvt) should be const; stack-copy it here. */
543
+ /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */
544
+
545
+ /* Make sure there's data to convert */
546
+ if (cvt->buf == NULL) {
547
+ return SDL_SetError("No buffer allocated for conversion");
548
+ }
549
+
550
+ /* Return okay if no conversion is necessary */
551
+ cvt->len_cvt = cvt->len;
552
+ if (cvt->filters[0] == NULL) {
553
+ return 0;
554
+ }
555
+
556
+ /* Set up the conversion and go! */
557
+ cvt->filter_index = 0;
558
+ cvt->filters[0] (cvt, cvt->src_format);
559
+ return 0;
560
+ }
561
+
562
+ static void SDLCALL
563
+ SDL_Convert_Byteswap(SDL_AudioCVT *cvt, SDL_AudioFormat format)
564
+ {
565
+ #if DEBUG_CONVERT
566
+ printf("Converting byte order\n");
567
+ #endif
568
+
569
+ switch (SDL_AUDIO_BITSIZE(format)) {
570
+ #define CASESWAP(b) \
571
+ case b: { \
572
+ Uint##b *ptr = (Uint##b *) cvt->buf; \
573
+ int i; \
574
+ for (i = cvt->len_cvt / sizeof (*ptr); i; --i, ++ptr) { \
575
+ *ptr = SDL_Swap##b(*ptr); \
576
+ } \
577
+ break; \
578
+ }
579
+
580
+ CASESWAP(16);
581
+ CASESWAP(32);
582
+ CASESWAP(64);
583
+
584
+ #undef CASESWAP
585
+
586
+ default: SDL_assert(!"unhandled byteswap datatype!"); break;
587
+ }
588
+
589
+ if (cvt->filters[++cvt->filter_index]) {
590
+ /* flip endian flag for data. */
591
+ if (format & SDL_AUDIO_MASK_ENDIAN) {
592
+ format &= ~SDL_AUDIO_MASK_ENDIAN;
593
+ } else {
594
+ format |= SDL_AUDIO_MASK_ENDIAN;
595
+ }
596
+ cvt->filters[cvt->filter_index](cvt, format);
597
+ }
598
+ }
599
+
600
+ static int
601
+ SDL_AddAudioCVTFilter(SDL_AudioCVT *cvt, const SDL_AudioFilter filter)
602
+ {
603
+ if (cvt->filter_index >= SDL_AUDIOCVT_MAX_FILTERS) {
604
+ return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS);
605
+ }
606
+ if (filter == NULL) {
607
+ return SDL_SetError("Audio filter pointer is NULL");
608
+ }
609
+ cvt->filters[cvt->filter_index++] = filter;
610
+ cvt->filters[cvt->filter_index] = NULL; /* Moving terminator */
611
+ return 0;
612
+ }
613
+
614
+ static int
615
+ SDL_BuildAudioTypeCVTToFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat src_fmt)
616
+ {
617
+ int retval = 0; /* 0 == no conversion necessary. */
618
+
619
+ if ((SDL_AUDIO_ISBIGENDIAN(src_fmt) != 0) == (SDL_BYTEORDER == SDL_LIL_ENDIAN)) {
620
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) {
621
+ return -1;
622
+ }
623
+ retval = 1; /* added a converter. */
624
+ }
625
+
626
+ if (!SDL_AUDIO_ISFLOAT(src_fmt)) {
627
+ const Uint16 src_bitsize = SDL_AUDIO_BITSIZE(src_fmt);
628
+ const Uint16 dst_bitsize = 32;
629
+ SDL_AudioFilter filter = NULL;
630
+
631
+ switch (src_fmt & ~SDL_AUDIO_MASK_ENDIAN) {
632
+ case AUDIO_S8: filter = SDL_Convert_S8_to_F32; break;
633
+ case AUDIO_U8: filter = SDL_Convert_U8_to_F32; break;
634
+ case AUDIO_S16: filter = SDL_Convert_S16_to_F32; break;
635
+ case AUDIO_U16: filter = SDL_Convert_U16_to_F32; break;
636
+ case AUDIO_S32: filter = SDL_Convert_S32_to_F32; break;
637
+ default: SDL_assert(!"Unexpected audio format!"); break;
638
+ }
639
+
640
+ if (!filter) {
641
+ return SDL_SetError("No conversion from source format to float available");
642
+ }
643
+
644
+ if (SDL_AddAudioCVTFilter(cvt, filter) < 0) {
645
+ return -1;
646
+ }
647
+ if (src_bitsize < dst_bitsize) {
648
+ const int mult = (dst_bitsize / src_bitsize);
649
+ cvt->len_mult *= mult;
650
+ cvt->len_ratio *= mult;
651
+ } else if (src_bitsize > dst_bitsize) {
652
+ cvt->len_ratio /= (src_bitsize / dst_bitsize);
653
+ }
654
+
655
+ retval = 1; /* added a converter. */
656
+ }
657
+
658
+ return retval;
659
+ }
660
+
661
+ static int
662
+ SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt)
663
+ {
664
+ int retval = 0; /* 0 == no conversion necessary. */
665
+
666
+ if (!SDL_AUDIO_ISFLOAT(dst_fmt)) {
667
+ const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt);
668
+ const Uint16 src_bitsize = 32;
669
+ SDL_AudioFilter filter = NULL;
670
+ switch (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN) {
671
+ case AUDIO_S8: filter = SDL_Convert_F32_to_S8; break;
672
+ case AUDIO_U8: filter = SDL_Convert_F32_to_U8; break;
673
+ case AUDIO_S16: filter = SDL_Convert_F32_to_S16; break;
674
+ case AUDIO_U16: filter = SDL_Convert_F32_to_U16; break;
675
+ case AUDIO_S32: filter = SDL_Convert_F32_to_S32; break;
676
+ default: SDL_assert(!"Unexpected audio format!"); break;
677
+ }
678
+
679
+ if (!filter) {
680
+ return SDL_SetError("No conversion from float to destination format available");
681
+ }
682
+
683
+ if (SDL_AddAudioCVTFilter(cvt, filter) < 0) {
684
+ return -1;
685
+ }
686
+ if (src_bitsize < dst_bitsize) {
687
+ const int mult = (dst_bitsize / src_bitsize);
688
+ cvt->len_mult *= mult;
689
+ cvt->len_ratio *= mult;
690
+ } else if (src_bitsize > dst_bitsize) {
691
+ cvt->len_ratio /= (src_bitsize / dst_bitsize);
692
+ }
693
+ retval = 1; /* added a converter. */
694
+ }
695
+
696
+ if ((SDL_AUDIO_ISBIGENDIAN(dst_fmt) != 0) == (SDL_BYTEORDER == SDL_LIL_ENDIAN)) {
697
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) {
698
+ return -1;
699
+ }
700
+ retval = 1; /* added a converter. */
701
+ }
702
+
703
+ return retval;
704
+ }
705
+
706
+ static void
707
+ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format)
708
+ {
709
+ /* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator).
710
+ !!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates,
711
+ !!! FIXME in 2.1: so we steal the ninth and tenth slot. :( */
712
+ const int inrate = (int) (size_t) cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1];
713
+ const int outrate = (int) (size_t) cvt->filters[SDL_AUDIOCVT_MAX_FILTERS];
714
+ const float *src = (const float *) cvt->buf;
715
+ const int srclen = cvt->len_cvt;
716
+ /*float *dst = (float *) cvt->buf;
717
+ const int dstlen = (cvt->len * cvt->len_mult);*/
718
+ /* !!! FIXME: remove this if we can get the resampler to work in-place again. */
719
+ float *dst = (float *) (cvt->buf + srclen);
720
+ const int dstlen = (cvt->len * cvt->len_mult) - srclen;
721
+ const int paddingsamples = (ResamplerPadding(inrate, outrate) * chans);
722
+ float *padding;
723
+
724
+ SDL_assert(format == AUDIO_F32SYS);
725
+
726
+ /* we keep no streaming state here, so pad with silence on both ends. */
727
+ padding = (float *) SDL_calloc(paddingsamples ? paddingsamples : 1, sizeof (float));
728
+ if (!padding) {
729
+ SDL_OutOfMemory();
730
+ return;
731
+ }
732
+
733
+ cvt->len_cvt = SDL_ResampleAudio(chans, inrate, outrate, padding, padding, src, srclen, dst, dstlen);
734
+
735
+ SDL_free(padding);
736
+
737
+ SDL_memmove(cvt->buf, dst, cvt->len_cvt); /* !!! FIXME: remove this if we can get the resampler to work in-place again. */
738
+
739
+ if (cvt->filters[++cvt->filter_index]) {
740
+ cvt->filters[cvt->filter_index](cvt, format);
741
+ }
742
+ }
743
+
744
+ /* !!! FIXME: We only have this macro salsa because SDL_AudioCVT doesn't
745
+ !!! FIXME: store channel info, so we have to have function entry
746
+ !!! FIXME: points for each supported channel count and multiple
747
+ !!! FIXME: vs arbitrary. When we rev the ABI, clean this up. */
748
+ #define RESAMPLER_FUNCS(chans) \
749
+ static void SDLCALL \
750
+ SDL_ResampleCVT_c##chans(SDL_AudioCVT *cvt, SDL_AudioFormat format) { \
751
+ SDL_ResampleCVT(cvt, chans, format); \
752
+ }
753
+ RESAMPLER_FUNCS(1)
754
+ RESAMPLER_FUNCS(2)
755
+ RESAMPLER_FUNCS(4)
756
+ RESAMPLER_FUNCS(6)
757
+ RESAMPLER_FUNCS(8)
758
+ #undef RESAMPLER_FUNCS
759
+
760
+ static SDL_AudioFilter
761
+ ChooseCVTResampler(const int dst_channels)
762
+ {
763
+ switch (dst_channels) {
764
+ case 1: return SDL_ResampleCVT_c1;
765
+ case 2: return SDL_ResampleCVT_c2;
766
+ case 4: return SDL_ResampleCVT_c4;
767
+ case 6: return SDL_ResampleCVT_c6;
768
+ case 8: return SDL_ResampleCVT_c8;
769
+ default: break;
770
+ }
771
+
772
+ return NULL;
773
+ }
774
+
775
+ static int
776
+ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, const int dst_channels,
777
+ const int src_rate, const int dst_rate)
778
+ {
779
+ SDL_AudioFilter filter;
780
+
781
+ if (src_rate == dst_rate) {
782
+ return 0; /* no conversion necessary. */
783
+ }
784
+
785
+ filter = ChooseCVTResampler(dst_channels);
786
+ if (filter == NULL) {
787
+ return SDL_SetError("No conversion available for these rates");
788
+ }
789
+
790
+ if (SDL_PrepareResampleFilter() < 0) {
791
+ return -1;
792
+ }
793
+
794
+ /* Update (cvt) with filter details... */
795
+ if (SDL_AddAudioCVTFilter(cvt, filter) < 0) {
796
+ return -1;
797
+ }
798
+
799
+ /* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator).
800
+ !!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates,
801
+ !!! FIXME in 2.1: so we steal the ninth and tenth slot. :( */
802
+ if (cvt->filter_index >= (SDL_AUDIOCVT_MAX_FILTERS-2)) {
803
+ return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS-2);
804
+ }
805
+ cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1] = (SDL_AudioFilter) (size_t) src_rate;
806
+ cvt->filters[SDL_AUDIOCVT_MAX_FILTERS] = (SDL_AudioFilter) (size_t) dst_rate;
807
+
808
+ if (src_rate < dst_rate) {
809
+ const double mult = ((double) dst_rate) / ((double) src_rate);
810
+ cvt->len_mult *= (int) SDL_ceil(mult);
811
+ cvt->len_ratio *= mult;
812
+ } else {
813
+ cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate);
814
+ }
815
+
816
+ /* !!! FIXME: remove this if we can get the resampler to work in-place again. */
817
+ /* the buffer is big enough to hold the destination now, but
818
+ we need it large enough to hold a separate scratch buffer. */
819
+ cvt->len_mult *= 2;
820
+
821
+ return 1; /* added a converter. */
822
+ }
823
+
824
+ static SDL_bool
825
+ SDL_SupportedAudioFormat(const SDL_AudioFormat fmt)
826
+ {
827
+ switch (fmt) {
828
+ case AUDIO_U8:
829
+ case AUDIO_S8:
830
+ case AUDIO_U16LSB:
831
+ case AUDIO_S16LSB:
832
+ case AUDIO_U16MSB:
833
+ case AUDIO_S16MSB:
834
+ case AUDIO_S32LSB:
835
+ case AUDIO_S32MSB:
836
+ case AUDIO_F32LSB:
837
+ case AUDIO_F32MSB:
838
+ return SDL_TRUE; /* supported. */
839
+
840
+ default:
841
+ break;
842
+ }
843
+
844
+ return SDL_FALSE; /* unsupported. */
845
+ }
846
+
847
+ static SDL_bool
848
+ SDL_SupportedChannelCount(const int channels)
849
+ {
850
+ switch (channels) {
851
+ case 1: /* mono */
852
+ case 2: /* stereo */
853
+ case 4: /* quad */
854
+ case 6: /* 5.1 */
855
+ case 8: /* 7.1 */
856
+ return SDL_TRUE; /* supported. */
857
+
858
+ default:
859
+ break;
860
+ }
861
+
862
+ return SDL_FALSE; /* unsupported. */
863
+ }
864
+
865
+
866
+ /* Creates a set of audio filters to convert from one format to another.
867
+ Returns 0 if no conversion is needed, 1 if the audio filter is set up,
868
+ or -1 if an error like invalid parameter, unsupported format, etc. occurred.
869
+ */
870
+
871
+ int
872
+ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
873
+ SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate,
874
+ SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate)
875
+ {
876
+ /* Sanity check target pointer */
877
+ if (cvt == NULL) {
878
+ return SDL_InvalidParamError("cvt");
879
+ }
880
+
881
+ /* Make sure we zero out the audio conversion before error checking */
882
+ SDL_zerop(cvt);
883
+
884
+ if (!SDL_SupportedAudioFormat(src_fmt)) {
885
+ return SDL_SetError("Invalid source format");
886
+ } else if (!SDL_SupportedAudioFormat(dst_fmt)) {
887
+ return SDL_SetError("Invalid destination format");
888
+ } else if (!SDL_SupportedChannelCount(src_channels)) {
889
+ return SDL_SetError("Invalid source channels");
890
+ } else if (!SDL_SupportedChannelCount(dst_channels)) {
891
+ return SDL_SetError("Invalid destination channels");
892
+ } else if (src_rate == 0) {
893
+ return SDL_SetError("Source rate is zero");
894
+ } else if (dst_rate == 0) {
895
+ return SDL_SetError("Destination rate is zero");
896
+ }
897
+
898
+ #if DEBUG_CONVERT
899
+ printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
900
+ src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate);
901
+ #endif
902
+
903
+ /* Start off with no conversion necessary */
904
+ cvt->src_format = src_fmt;
905
+ cvt->dst_format = dst_fmt;
906
+ cvt->needed = 0;
907
+ cvt->filter_index = 0;
908
+ SDL_zero(cvt->filters);
909
+ cvt->len_mult = 1;
910
+ cvt->len_ratio = 1.0;
911
+ cvt->rate_incr = ((double) dst_rate) / ((double) src_rate);
912
+
913
+ /* Make sure we've chosen audio conversion functions (MMX, scalar, etc.) */
914
+ SDL_ChooseAudioConverters();
915
+
916
+ /* Type conversion goes like this now:
917
+ - byteswap to CPU native format first if necessary.
918
+ - convert to native Float32 if necessary.
919
+ - resample and change channel count if necessary.
920
+ - convert back to native format.
921
+ - byteswap back to foreign format if necessary.
922
+
923
+ The expectation is we can process data faster in float32
924
+ (possibly with SIMD), and making several passes over the same
925
+ buffer is likely to be CPU cache-friendly, avoiding the
926
+ biggest performance hit in modern times. Previously we had
927
+ (script-generated) custom converters for every data type and
928
+ it was a bloat on SDL compile times and final library size. */
929
+
930
+ /* see if we can skip float conversion entirely. */
931
+ if (src_rate == dst_rate && src_channels == dst_channels) {
932
+ if (src_fmt == dst_fmt) {
933
+ return 0;
934
+ }
935
+
936
+ /* just a byteswap needed? */
937
+ if ((src_fmt & ~SDL_AUDIO_MASK_ENDIAN) == (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN)) {
938
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) {
939
+ return -1;
940
+ }
941
+ cvt->needed = 1;
942
+ return 1;
943
+ }
944
+ }
945
+
946
+ /* Convert data types, if necessary. Updates (cvt). */
947
+ if (SDL_BuildAudioTypeCVTToFloat(cvt, src_fmt) < 0) {
948
+ return -1; /* shouldn't happen, but just in case... */
949
+ }
950
+
951
+ /* Channel conversion */
952
+ if (src_channels < dst_channels) {
953
+ /* Upmixing */
954
+ /* Mono -> Stereo [-> ...] */
955
+ if ((src_channels == 1) && (dst_channels > 1)) {
956
+ if (SDL_AddAudioCVTFilter(cvt, SDL_ConvertMonoToStereo) < 0) {
957
+ return -1;
958
+ }
959
+ cvt->len_mult *= 2;
960
+ src_channels = 2;
961
+ cvt->len_ratio *= 2;
962
+ }
963
+ /* [Mono ->] Stereo -> 5.1 [-> 7.1] */
964
+ if ((src_channels == 2) && (dst_channels >= 6)) {
965
+ if (SDL_AddAudioCVTFilter(cvt, SDL_ConvertStereoTo51) < 0) {
966
+ return -1;
967
+ }
968
+ src_channels = 6;
969
+ cvt->len_mult *= 3;
970
+ cvt->len_ratio *= 3;
971
+ }
972
+ /* Quad -> 5.1 [-> 7.1] */
973
+ if ((src_channels == 4) && (dst_channels >= 6)) {
974
+ if (SDL_AddAudioCVTFilter(cvt, SDL_ConvertQuadTo51) < 0) {
975
+ return -1;
976
+ }
977
+ src_channels = 6;
978
+ cvt->len_mult = (cvt->len_mult * 3 + 1) / 2;
979
+ cvt->len_ratio *= 1.5;
980
+ }
981
+ /* [[Mono ->] Stereo ->] 5.1 -> 7.1 */
982
+ if ((src_channels == 6) && (dst_channels == 8)) {
983
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert51To71) < 0) {
984
+ return -1;
985
+ }
986
+ src_channels = 8;
987
+ cvt->len_mult = (cvt->len_mult * 4 + 2) / 3;
988
+ /* Should be numerically exact with every valid input to this
989
+ function */
990
+ cvt->len_ratio = cvt->len_ratio * 4 / 3;
991
+ }
992
+ /* [Mono ->] Stereo -> Quad */
993
+ if ((src_channels == 2) && (dst_channels == 4)) {
994
+ if (SDL_AddAudioCVTFilter(cvt, SDL_ConvertStereoToQuad) < 0) {
995
+ return -1;
996
+ }
997
+ src_channels = 4;
998
+ cvt->len_mult *= 2;
999
+ cvt->len_ratio *= 2;
1000
+ }
1001
+ } else if (src_channels > dst_channels) {
1002
+ /* Downmixing */
1003
+ /* 7.1 -> 5.1 [-> Stereo [-> Mono]] */
1004
+ /* 7.1 -> 5.1 [-> Quad] */
1005
+ if ((src_channels == 8) && (dst_channels <= 6)) {
1006
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert71To51) < 0) {
1007
+ return -1;
1008
+ }
1009
+ src_channels = 6;
1010
+ cvt->len_ratio *= 0.75;
1011
+ }
1012
+ /* [7.1 ->] 5.1 -> Stereo [-> Mono] */
1013
+ if ((src_channels == 6) && (dst_channels <= 2)) {
1014
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert51ToStereo) < 0) {
1015
+ return -1;
1016
+ }
1017
+ src_channels = 2;
1018
+ cvt->len_ratio /= 3;
1019
+ }
1020
+ /* 5.1 -> Quad */
1021
+ if ((src_channels == 6) && (dst_channels == 4)) {
1022
+ if (SDL_AddAudioCVTFilter(cvt, SDL_Convert51ToQuad) < 0) {
1023
+ return -1;
1024
+ }
1025
+ src_channels = 4;
1026
+ cvt->len_ratio = cvt->len_ratio * 2 / 3;
1027
+ }
1028
+ /* Quad -> Stereo [-> Mono] */
1029
+ if ((src_channels == 4) && (dst_channels <= 2)) {
1030
+ if (SDL_AddAudioCVTFilter(cvt, SDL_ConvertQuadToStereo) < 0) {
1031
+ return -1;
1032
+ }
1033
+ src_channels = 2;
1034
+ cvt->len_ratio /= 2;
1035
+ }
1036
+ /* [... ->] Stereo -> Mono */
1037
+ if ((src_channels == 2) && (dst_channels == 1)) {
1038
+ SDL_AudioFilter filter = NULL;
1039
+
1040
+ #if HAVE_SSE3_INTRINSICS
1041
+ if (SDL_HasSSE3()) {
1042
+ filter = SDL_ConvertStereoToMono_SSE3;
1043
+ }
1044
+ #endif
1045
+
1046
+ if (!filter) {
1047
+ filter = SDL_ConvertStereoToMono;
1048
+ }
1049
+
1050
+ if (SDL_AddAudioCVTFilter(cvt, filter) < 0) {
1051
+ return -1;
1052
+ }
1053
+
1054
+ src_channels = 1;
1055
+ cvt->len_ratio /= 2;
1056
+ }
1057
+ }
1058
+
1059
+ if (src_channels != dst_channels) {
1060
+ /* All combinations of supported channel counts should have been
1061
+ handled by now, but let's be defensive */
1062
+ return SDL_SetError("Invalid channel combination");
1063
+ }
1064
+
1065
+ /* Do rate conversion, if necessary. Updates (cvt). */
1066
+ if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) < 0) {
1067
+ return -1; /* shouldn't happen, but just in case... */
1068
+ }
1069
+
1070
+ /* Move to final data type. */
1071
+ if (SDL_BuildAudioTypeCVTFromFloat(cvt, dst_fmt) < 0) {
1072
+ return -1; /* shouldn't happen, but just in case... */
1073
+ }
1074
+
1075
+ cvt->needed = (cvt->filter_index != 0);
1076
+ return (cvt->needed);
1077
+ }
1078
+
1079
+ typedef int (*SDL_ResampleAudioStreamFunc)(SDL_AudioStream *stream, const void *inbuf, const int inbuflen, void *outbuf, const int outbuflen);
1080
+ typedef void (*SDL_ResetAudioStreamResamplerFunc)(SDL_AudioStream *stream);
1081
+ typedef void (*SDL_CleanupAudioStreamResamplerFunc)(SDL_AudioStream *stream);
1082
+
1083
+ struct _SDL_AudioStream
1084
+ {
1085
+ SDL_AudioCVT cvt_before_resampling;
1086
+ SDL_AudioCVT cvt_after_resampling;
1087
+ SDL_DataQueue *queue;
1088
+ SDL_bool first_run;
1089
+ Uint8 *staging_buffer;
1090
+ int staging_buffer_size;
1091
+ int staging_buffer_filled;
1092
+ Uint8 *work_buffer_base; /* maybe unaligned pointer from SDL_realloc(). */
1093
+ int work_buffer_len;
1094
+ int src_sample_frame_size;
1095
+ SDL_AudioFormat src_format;
1096
+ Uint8 src_channels;
1097
+ int src_rate;
1098
+ int dst_sample_frame_size;
1099
+ SDL_AudioFormat dst_format;
1100
+ Uint8 dst_channels;
1101
+ int dst_rate;
1102
+ double rate_incr;
1103
+ Uint8 pre_resample_channels;
1104
+ int packetlen;
1105
+ int resampler_padding_samples;
1106
+ float *resampler_padding;
1107
+ void *resampler_state;
1108
+ SDL_ResampleAudioStreamFunc resampler_func;
1109
+ SDL_ResetAudioStreamResamplerFunc reset_resampler_func;
1110
+ SDL_CleanupAudioStreamResamplerFunc cleanup_resampler_func;
1111
+ };
1112
+
1113
+ static Uint8 *
1114
+ EnsureStreamBufferSize(SDL_AudioStream *stream, const int newlen)
1115
+ {
1116
+ Uint8 *ptr;
1117
+ size_t offset;
1118
+
1119
+ if (stream->work_buffer_len >= newlen) {
1120
+ ptr = stream->work_buffer_base;
1121
+ } else {
1122
+ ptr = (Uint8 *) SDL_realloc(stream->work_buffer_base, newlen + 32);
1123
+ if (!ptr) {
1124
+ SDL_OutOfMemory();
1125
+ return NULL;
1126
+ }
1127
+ /* Make sure we're aligned to 16 bytes for SIMD code. */
1128
+ stream->work_buffer_base = ptr;
1129
+ stream->work_buffer_len = newlen;
1130
+ }
1131
+
1132
+ offset = ((size_t) ptr) & 15;
1133
+ return offset ? ptr + (16 - offset) : ptr;
1134
+ }
1135
+
1136
+ #ifdef HAVE_LIBSAMPLERATE_H
1137
+ static int
1138
+ SDL_ResampleAudioStream_SRC(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen)
1139
+ {
1140
+ const float *inbuf = (const float *) _inbuf;
1141
+ float *outbuf = (float *) _outbuf;
1142
+ const int framelen = sizeof(float) * stream->pre_resample_channels;
1143
+ SRC_STATE *state = (SRC_STATE *)stream->resampler_state;
1144
+ SRC_DATA data;
1145
+ int result;
1146
+
1147
+ SDL_assert(inbuf != ((const float *) outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */
1148
+
1149
+ data.data_in = (float *)inbuf; /* Older versions of libsamplerate had a non-const pointer, but didn't write to it */
1150
+ data.input_frames = inbuflen / framelen;
1151
+ data.input_frames_used = 0;
1152
+
1153
+ data.data_out = outbuf;
1154
+ data.output_frames = outbuflen / framelen;
1155
+
1156
+ data.end_of_input = 0;
1157
+ data.src_ratio = stream->rate_incr;
1158
+
1159
+ result = SRC_src_process(state, &data);
1160
+ if (result != 0) {
1161
+ SDL_SetError("src_process() failed: %s", SRC_src_strerror(result));
1162
+ return 0;
1163
+ }
1164
+
1165
+ /* If this fails, we need to store them off somewhere */
1166
+ SDL_assert(data.input_frames_used == data.input_frames);
1167
+
1168
+ return data.output_frames_gen * (sizeof(float) * stream->pre_resample_channels);
1169
+ }
1170
+
1171
+ static void
1172
+ SDL_ResetAudioStreamResampler_SRC(SDL_AudioStream *stream)
1173
+ {
1174
+ SRC_src_reset((SRC_STATE *)stream->resampler_state);
1175
+ }
1176
+
1177
+ static void
1178
+ SDL_CleanupAudioStreamResampler_SRC(SDL_AudioStream *stream)
1179
+ {
1180
+ SRC_STATE *state = (SRC_STATE *)stream->resampler_state;
1181
+ if (state) {
1182
+ SRC_src_delete(state);
1183
+ }
1184
+
1185
+ stream->resampler_state = NULL;
1186
+ stream->resampler_func = NULL;
1187
+ stream->reset_resampler_func = NULL;
1188
+ stream->cleanup_resampler_func = NULL;
1189
+ }
1190
+
1191
+ static SDL_bool
1192
+ SetupLibSampleRateResampling(SDL_AudioStream *stream)
1193
+ {
1194
+ int result = 0;
1195
+ SRC_STATE *state = NULL;
1196
+
1197
+ if (SRC_available) {
1198
+ state = SRC_src_new(SRC_converter, stream->pre_resample_channels, &result);
1199
+ if (!state) {
1200
+ SDL_SetError("src_new() failed: %s", SRC_src_strerror(result));
1201
+ }
1202
+ }
1203
+
1204
+ if (!state) {
1205
+ SDL_CleanupAudioStreamResampler_SRC(stream);
1206
+ return SDL_FALSE;
1207
+ }
1208
+
1209
+ stream->resampler_state = state;
1210
+ stream->resampler_func = SDL_ResampleAudioStream_SRC;
1211
+ stream->reset_resampler_func = SDL_ResetAudioStreamResampler_SRC;
1212
+ stream->cleanup_resampler_func = SDL_CleanupAudioStreamResampler_SRC;
1213
+
1214
+ return SDL_TRUE;
1215
+ }
1216
+ #endif /* HAVE_LIBSAMPLERATE_H */
1217
+
1218
+
1219
+ static int
1220
+ SDL_ResampleAudioStream(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen)
1221
+ {
1222
+ const Uint8 *inbufend = ((const Uint8 *) _inbuf) + inbuflen;
1223
+ const float *inbuf = (const float *) _inbuf;
1224
+ float *outbuf = (float *) _outbuf;
1225
+ const int chans = (int) stream->pre_resample_channels;
1226
+ const int inrate = stream->src_rate;
1227
+ const int outrate = stream->dst_rate;
1228
+ const int paddingsamples = stream->resampler_padding_samples;
1229
+ const int paddingbytes = paddingsamples * sizeof (float);
1230
+ float *lpadding = (float *) stream->resampler_state;
1231
+ const float *rpadding = (const float *) inbufend; /* we set this up so there are valid padding samples at the end of the input buffer. */
1232
+ const int cpy = SDL_min(inbuflen, paddingbytes);
1233
+ int retval;
1234
+
1235
+ SDL_assert(inbuf != ((const float *) outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */
1236
+
1237
+ retval = SDL_ResampleAudio(chans, inrate, outrate, lpadding, rpadding, inbuf, inbuflen, outbuf, outbuflen);
1238
+
1239
+ /* update our left padding with end of current input, for next run. */
1240
+ SDL_memcpy((lpadding + paddingsamples) - (cpy / sizeof (float)), inbufend - cpy, cpy);
1241
+ return retval;
1242
+ }
1243
+
1244
+ static void
1245
+ SDL_ResetAudioStreamResampler(SDL_AudioStream *stream)
1246
+ {
1247
+ /* set all the padding to silence. */
1248
+ const int len = stream->resampler_padding_samples;
1249
+ SDL_memset(stream->resampler_state, '\0', len * sizeof (float));
1250
+ }
1251
+
1252
+ static void
1253
+ SDL_CleanupAudioStreamResampler(SDL_AudioStream *stream)
1254
+ {
1255
+ SDL_free(stream->resampler_state);
1256
+ }
1257
+
1258
+ SDL_AudioStream *
1259
+ SDL_NewAudioStream(const SDL_AudioFormat src_format,
1260
+ const Uint8 src_channels,
1261
+ const int src_rate,
1262
+ const SDL_AudioFormat dst_format,
1263
+ const Uint8 dst_channels,
1264
+ const int dst_rate)
1265
+ {
1266
+ const int packetlen = 4096; /* !!! FIXME: good enough for now. */
1267
+ Uint8 pre_resample_channels;
1268
+ SDL_AudioStream *retval;
1269
+
1270
+ retval = (SDL_AudioStream *) SDL_calloc(1, sizeof (SDL_AudioStream));
1271
+ if (!retval) {
1272
+ return NULL;
1273
+ }
1274
+
1275
+ /* If increasing channels, do it after resampling, since we'd just
1276
+ do more work to resample duplicate channels. If we're decreasing, do
1277
+ it first so we resample the interpolated data instead of interpolating
1278
+ the resampled data (!!! FIXME: decide if that works in practice, though!). */
1279
+ pre_resample_channels = SDL_min(src_channels, dst_channels);
1280
+
1281
+ retval->first_run = SDL_TRUE;
1282
+ retval->src_sample_frame_size = (SDL_AUDIO_BITSIZE(src_format) / 8) * src_channels;
1283
+ retval->src_format = src_format;
1284
+ retval->src_channels = src_channels;
1285
+ retval->src_rate = src_rate;
1286
+ retval->dst_sample_frame_size = (SDL_AUDIO_BITSIZE(dst_format) / 8) * dst_channels;
1287
+ retval->dst_format = dst_format;
1288
+ retval->dst_channels = dst_channels;
1289
+ retval->dst_rate = dst_rate;
1290
+ retval->pre_resample_channels = pre_resample_channels;
1291
+ retval->packetlen = packetlen;
1292
+ retval->rate_incr = ((double) dst_rate) / ((double) src_rate);
1293
+ retval->resampler_padding_samples = ResamplerPadding(retval->src_rate, retval->dst_rate) * pre_resample_channels;
1294
+ retval->resampler_padding = (float *) SDL_calloc(retval->resampler_padding_samples ? retval->resampler_padding_samples : 1, sizeof (float));
1295
+
1296
+ if (retval->resampler_padding == NULL) {
1297
+ SDL_FreeAudioStream(retval);
1298
+ SDL_OutOfMemory();
1299
+ return NULL;
1300
+ }
1301
+
1302
+ retval->staging_buffer_size = ((retval->resampler_padding_samples / retval->pre_resample_channels) * retval->src_sample_frame_size);
1303
+ if (retval->staging_buffer_size > 0) {
1304
+ retval->staging_buffer = (Uint8 *) SDL_malloc(retval->staging_buffer_size);
1305
+ if (retval->staging_buffer == NULL) {
1306
+ SDL_FreeAudioStream(retval);
1307
+ SDL_OutOfMemory();
1308
+ return NULL;
1309
+ }
1310
+ }
1311
+
1312
+ /* Not resampling? It's an easy conversion (and maybe not even that!) */
1313
+ if (src_rate == dst_rate) {
1314
+ retval->cvt_before_resampling.needed = SDL_FALSE;
1315
+ if (SDL_BuildAudioCVT(&retval->cvt_after_resampling, src_format, src_channels, dst_rate, dst_format, dst_channels, dst_rate) < 0) {
1316
+ SDL_FreeAudioStream(retval);
1317
+ return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */
1318
+ }
1319
+ } else {
1320
+ /* Don't resample at first. Just get us to Float32 format. */
1321
+ /* !!! FIXME: convert to int32 on devices without hardware float. */
1322
+ if (SDL_BuildAudioCVT(&retval->cvt_before_resampling, src_format, src_channels, src_rate, AUDIO_F32SYS, pre_resample_channels, src_rate) < 0) {
1323
+ SDL_FreeAudioStream(retval);
1324
+ return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */
1325
+ }
1326
+
1327
+ #ifdef HAVE_LIBSAMPLERATE_H
1328
+ SetupLibSampleRateResampling(retval);
1329
+ #endif
1330
+
1331
+ if (!retval->resampler_func) {
1332
+ retval->resampler_state = SDL_calloc(retval->resampler_padding_samples, sizeof (float));
1333
+ if (!retval->resampler_state) {
1334
+ SDL_FreeAudioStream(retval);
1335
+ SDL_OutOfMemory();
1336
+ return NULL;
1337
+ }
1338
+
1339
+ if (SDL_PrepareResampleFilter() < 0) {
1340
+ SDL_free(retval->resampler_state);
1341
+ retval->resampler_state = NULL;
1342
+ SDL_FreeAudioStream(retval);
1343
+ return NULL;
1344
+ }
1345
+
1346
+ retval->resampler_func = SDL_ResampleAudioStream;
1347
+ retval->reset_resampler_func = SDL_ResetAudioStreamResampler;
1348
+ retval->cleanup_resampler_func = SDL_CleanupAudioStreamResampler;
1349
+ }
1350
+
1351
+ /* Convert us to the final format after resampling. */
1352
+ if (SDL_BuildAudioCVT(&retval->cvt_after_resampling, AUDIO_F32SYS, pre_resample_channels, dst_rate, dst_format, dst_channels, dst_rate) < 0) {
1353
+ SDL_FreeAudioStream(retval);
1354
+ return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */
1355
+ }
1356
+ }
1357
+
1358
+ retval->queue = SDL_NewDataQueue(packetlen, packetlen * 2);
1359
+ if (!retval->queue) {
1360
+ SDL_FreeAudioStream(retval);
1361
+ return NULL; /* SDL_NewDataQueue should have called SDL_SetError. */
1362
+ }
1363
+
1364
+ return retval;
1365
+ }
1366
+
1367
+ static int
1368
+ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, int *maxputbytes)
1369
+ {
1370
+ int buflen = len;
1371
+ int workbuflen;
1372
+ Uint8 *workbuf;
1373
+ Uint8 *resamplebuf = NULL;
1374
+ int resamplebuflen = 0;
1375
+ int neededpaddingbytes;
1376
+ int paddingbytes;
1377
+
1378
+ /* !!! FIXME: several converters can take advantage of SIMD, but only
1379
+ !!! FIXME: if the data is aligned to 16 bytes. EnsureStreamBufferSize()
1380
+ !!! FIXME: guarantees the buffer will align, but the
1381
+ !!! FIXME: converters will iterate over the data backwards if
1382
+ !!! FIXME: the output grows, and this means we won't align if buflen
1383
+ !!! FIXME: isn't a multiple of 16. In these cases, we should chop off
1384
+ !!! FIXME: a few samples at the end and convert them separately. */
1385
+
1386
+ /* no padding prepended on first run. */
1387
+ neededpaddingbytes = stream->resampler_padding_samples * sizeof (float);
1388
+ paddingbytes = stream->first_run ? 0 : neededpaddingbytes;
1389
+ stream->first_run = SDL_FALSE;
1390
+
1391
+ /* Make sure the work buffer can hold all the data we need at once... */
1392
+ workbuflen = buflen;
1393
+ if (stream->cvt_before_resampling.needed) {
1394
+ workbuflen *= stream->cvt_before_resampling.len_mult;
1395
+ }
1396
+
1397
+ if (stream->dst_rate != stream->src_rate) {
1398
+ /* resamples can't happen in place, so make space for second buf. */
1399
+ const int framesize = stream->pre_resample_channels * sizeof (float);
1400
+ const int frames = workbuflen / framesize;
1401
+ resamplebuflen = ((int) SDL_ceil(frames * stream->rate_incr)) * framesize;
1402
+ #if DEBUG_AUDIOSTREAM
1403
+ printf("AUDIOSTREAM: will resample %d bytes to %d (ratio=%.6f)\n", workbuflen, resamplebuflen, stream->rate_incr);
1404
+ #endif
1405
+ workbuflen += resamplebuflen;
1406
+ }
1407
+
1408
+ if (stream->cvt_after_resampling.needed) {
1409
+ /* !!! FIXME: buffer might be big enough already? */
1410
+ workbuflen *= stream->cvt_after_resampling.len_mult;
1411
+ }
1412
+
1413
+ workbuflen += neededpaddingbytes;
1414
+
1415
+ #if DEBUG_AUDIOSTREAM
1416
+ printf("AUDIOSTREAM: Putting %d bytes of preconverted audio, need %d byte work buffer\n", buflen, workbuflen);
1417
+ #endif
1418
+
1419
+ workbuf = EnsureStreamBufferSize(stream, workbuflen);
1420
+ if (!workbuf) {
1421
+ return -1; /* probably out of memory. */
1422
+ }
1423
+
1424
+ resamplebuf = workbuf; /* default if not resampling. */
1425
+
1426
+ SDL_memcpy(workbuf + paddingbytes, buf, buflen);
1427
+
1428
+ if (stream->cvt_before_resampling.needed) {
1429
+ stream->cvt_before_resampling.buf = workbuf + paddingbytes;
1430
+ stream->cvt_before_resampling.len = buflen;
1431
+ if (SDL_ConvertAudio(&stream->cvt_before_resampling) == -1) {
1432
+ return -1; /* uhoh! */
1433
+ }
1434
+ buflen = stream->cvt_before_resampling.len_cvt;
1435
+
1436
+ #if DEBUG_AUDIOSTREAM
1437
+ printf("AUDIOSTREAM: After initial conversion we have %d bytes\n", buflen);
1438
+ #endif
1439
+ }
1440
+
1441
+ if (stream->dst_rate != stream->src_rate) {
1442
+ /* save off some samples at the end; they are used for padding now so
1443
+ the resampler is coherent and then used at the start of the next
1444
+ put operation. Prepend last put operation's padding, too. */
1445
+
1446
+ /* prepend prior put's padding. :P */
1447
+ if (paddingbytes) {
1448
+ SDL_memcpy(workbuf, stream->resampler_padding, paddingbytes);
1449
+ buflen += paddingbytes;
1450
+ }
1451
+
1452
+ /* save off the data at the end for the next run. */
1453
+ SDL_memcpy(stream->resampler_padding, workbuf + (buflen - neededpaddingbytes), neededpaddingbytes);
1454
+
1455
+ resamplebuf = workbuf + buflen; /* skip to second piece of workbuf. */
1456
+ SDL_assert(buflen >= neededpaddingbytes);
1457
+ if (buflen > neededpaddingbytes) {
1458
+ buflen = stream->resampler_func(stream, workbuf, buflen - neededpaddingbytes, resamplebuf, resamplebuflen);
1459
+ } else {
1460
+ buflen = 0;
1461
+ }
1462
+
1463
+ #if DEBUG_AUDIOSTREAM
1464
+ printf("AUDIOSTREAM: After resampling we have %d bytes\n", buflen);
1465
+ #endif
1466
+ }
1467
+
1468
+ if (stream->cvt_after_resampling.needed && (buflen > 0)) {
1469
+ stream->cvt_after_resampling.buf = resamplebuf;
1470
+ stream->cvt_after_resampling.len = buflen;
1471
+ if (SDL_ConvertAudio(&stream->cvt_after_resampling) == -1) {
1472
+ return -1; /* uhoh! */
1473
+ }
1474
+ buflen = stream->cvt_after_resampling.len_cvt;
1475
+
1476
+ #if DEBUG_AUDIOSTREAM
1477
+ printf("AUDIOSTREAM: After final conversion we have %d bytes\n", buflen);
1478
+ #endif
1479
+ }
1480
+
1481
+ #if DEBUG_AUDIOSTREAM
1482
+ printf("AUDIOSTREAM: Final output is %d bytes\n", buflen);
1483
+ #endif
1484
+
1485
+ if (maxputbytes) {
1486
+ const int maxbytes = *maxputbytes;
1487
+ if (buflen > maxbytes)
1488
+ buflen = maxbytes;
1489
+ *maxputbytes -= buflen;
1490
+ }
1491
+
1492
+ /* resamplebuf holds the final output, even if we didn't resample. */
1493
+ return buflen ? SDL_WriteToDataQueue(stream->queue, resamplebuf, buflen) : 0;
1494
+ }
1495
+
1496
+ int
1497
+ SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len)
1498
+ {
1499
+ /* !!! FIXME: several converters can take advantage of SIMD, but only
1500
+ !!! FIXME: if the data is aligned to 16 bytes. EnsureStreamBufferSize()
1501
+ !!! FIXME: guarantees the buffer will align, but the
1502
+ !!! FIXME: converters will iterate over the data backwards if
1503
+ !!! FIXME: the output grows, and this means we won't align if buflen
1504
+ !!! FIXME: isn't a multiple of 16. In these cases, we should chop off
1505
+ !!! FIXME: a few samples at the end and convert them separately. */
1506
+
1507
+ #if DEBUG_AUDIOSTREAM
1508
+ printf("AUDIOSTREAM: wants to put %d preconverted bytes\n", buflen);
1509
+ #endif
1510
+
1511
+ if (!stream) {
1512
+ return SDL_InvalidParamError("stream");
1513
+ } else if (!buf) {
1514
+ return SDL_InvalidParamError("buf");
1515
+ } else if (len == 0) {
1516
+ return 0; /* nothing to do. */
1517
+ } else if ((len % stream->src_sample_frame_size) != 0) {
1518
+ return SDL_SetError("Can't add partial sample frames");
1519
+ }
1520
+
1521
+ if (!stream->cvt_before_resampling.needed &&
1522
+ (stream->dst_rate == stream->src_rate) &&
1523
+ !stream->cvt_after_resampling.needed) {
1524
+ #if DEBUG_AUDIOSTREAM
1525
+ printf("AUDIOSTREAM: no conversion needed at all, queueing %d bytes.\n", len);
1526
+ #endif
1527
+ return SDL_WriteToDataQueue(stream->queue, buf, len);
1528
+ }
1529
+
1530
+ while (len > 0) {
1531
+ int amount;
1532
+
1533
+ /* If we don't have a staging buffer or we're given enough data that
1534
+ we don't need to store it for later, skip the staging process.
1535
+ */
1536
+ if (!stream->staging_buffer_filled && len >= stream->staging_buffer_size) {
1537
+ return SDL_AudioStreamPutInternal(stream, buf, len, NULL);
1538
+ }
1539
+
1540
+ /* If there's not enough data to fill the staging buffer, just save it */
1541
+ if ((stream->staging_buffer_filled + len) < stream->staging_buffer_size) {
1542
+ SDL_memcpy(stream->staging_buffer + stream->staging_buffer_filled, buf, len);
1543
+ stream->staging_buffer_filled += len;
1544
+ return 0;
1545
+ }
1546
+
1547
+ /* Fill the staging buffer, process it, and continue */
1548
+ amount = (stream->staging_buffer_size - stream->staging_buffer_filled);
1549
+ SDL_assert(amount > 0);
1550
+ SDL_memcpy(stream->staging_buffer + stream->staging_buffer_filled, buf, amount);
1551
+ stream->staging_buffer_filled = 0;
1552
+ if (SDL_AudioStreamPutInternal(stream, stream->staging_buffer, stream->staging_buffer_size, NULL) < 0) {
1553
+ return -1;
1554
+ }
1555
+ buf = (void *)((Uint8 *)buf + amount);
1556
+ len -= amount;
1557
+ }
1558
+ return 0;
1559
+ }
1560
+
1561
+ int SDL_AudioStreamFlush(SDL_AudioStream *stream)
1562
+ {
1563
+ if (!stream) {
1564
+ return SDL_InvalidParamError("stream");
1565
+ }
1566
+
1567
+ #if DEBUG_AUDIOSTREAM
1568
+ printf("AUDIOSTREAM: flushing! staging_buffer_filled=%d bytes\n", stream->staging_buffer_filled);
1569
+ #endif
1570
+
1571
+ /* shouldn't use a staging buffer if we're not resampling. */
1572
+ SDL_assert((stream->dst_rate != stream->src_rate) || (stream->staging_buffer_filled == 0));
1573
+
1574
+ if (stream->staging_buffer_filled > 0) {
1575
+ /* push the staging buffer + silence. We need to flush out not just
1576
+ the staging buffer, but the piece that the stream was saving off
1577
+ for right-side resampler padding. */
1578
+ const SDL_bool first_run = stream->first_run;
1579
+ const int filled = stream->staging_buffer_filled;
1580
+ int actual_input_frames = filled / stream->src_sample_frame_size;
1581
+ if (!first_run)
1582
+ actual_input_frames += stream->resampler_padding_samples / stream->pre_resample_channels;
1583
+
1584
+ if (actual_input_frames > 0) { /* don't bother if nothing to flush. */
1585
+ /* This is how many bytes we're expecting without silence appended. */
1586
+ int flush_remaining = ((int) SDL_ceil(actual_input_frames * stream->rate_incr)) * stream->dst_sample_frame_size;
1587
+
1588
+ #if DEBUG_AUDIOSTREAM
1589
+ printf("AUDIOSTREAM: flushing with padding to get max %d bytes!\n", flush_remaining);
1590
+ #endif
1591
+
1592
+ SDL_memset(stream->staging_buffer + filled, '\0', stream->staging_buffer_size - filled);
1593
+ if (SDL_AudioStreamPutInternal(stream, stream->staging_buffer, stream->staging_buffer_size, &flush_remaining) < 0) {
1594
+ return -1;
1595
+ }
1596
+
1597
+ /* we have flushed out (or initially filled) the pending right-side
1598
+ resampler padding, but we need to push more silence to guarantee
1599
+ the staging buffer is fully flushed out, too. */
1600
+ SDL_memset(stream->staging_buffer, '\0', filled);
1601
+ if (SDL_AudioStreamPutInternal(stream, stream->staging_buffer, stream->staging_buffer_size, &flush_remaining) < 0) {
1602
+ return -1;
1603
+ }
1604
+ }
1605
+ }
1606
+
1607
+ stream->staging_buffer_filled = 0;
1608
+ stream->first_run = SDL_TRUE;
1609
+
1610
+ return 0;
1611
+ }
1612
+
1613
+ /* get converted/resampled data from the stream */
1614
+ int
1615
+ SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len)
1616
+ {
1617
+ #if DEBUG_AUDIOSTREAM
1618
+ printf("AUDIOSTREAM: want to get %d converted bytes\n", len);
1619
+ #endif
1620
+
1621
+ if (!stream) {
1622
+ return SDL_InvalidParamError("stream");
1623
+ } else if (!buf) {
1624
+ return SDL_InvalidParamError("buf");
1625
+ } else if (len <= 0) {
1626
+ return 0; /* nothing to do. */
1627
+ } else if ((len % stream->dst_sample_frame_size) != 0) {
1628
+ return SDL_SetError("Can't request partial sample frames");
1629
+ }
1630
+
1631
+ return (int) SDL_ReadFromDataQueue(stream->queue, buf, len);
1632
+ }
1633
+
1634
+ /* number of converted/resampled bytes available */
1635
+ int
1636
+ SDL_AudioStreamAvailable(SDL_AudioStream *stream)
1637
+ {
1638
+ return stream ? (int) SDL_CountDataQueue(stream->queue) : 0;
1639
+ }
1640
+
1641
+ void
1642
+ SDL_AudioStreamClear(SDL_AudioStream *stream)
1643
+ {
1644
+ if (!stream) {
1645
+ SDL_InvalidParamError("stream");
1646
+ } else {
1647
+ SDL_ClearDataQueue(stream->queue, stream->packetlen * 2);
1648
+ if (stream->reset_resampler_func) {
1649
+ stream->reset_resampler_func(stream);
1650
+ }
1651
+ stream->first_run = SDL_TRUE;
1652
+ stream->staging_buffer_filled = 0;
1653
+ }
1654
+ }
1655
+
1656
+ /* dispose of a stream */
1657
+ void
1658
+ SDL_FreeAudioStream(SDL_AudioStream *stream)
1659
+ {
1660
+ if (stream) {
1661
+ if (stream->cleanup_resampler_func) {
1662
+ stream->cleanup_resampler_func(stream);
1663
+ }
1664
+ SDL_FreeDataQueue(stream->queue);
1665
+ SDL_free(stream->staging_buffer);
1666
+ SDL_free(stream->work_buffer_base);
1667
+ SDL_free(stream->resampler_padding);
1668
+ SDL_free(stream);
1669
+ }
1670
+ }
1671
+
1672
+ /* vi: set ts=4 sw=4 expandtab: */
1673
+