sdlfreeaudio.bmx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ' Copyright (c) 2014-2022 Bruce A Henderson
  2. '
  3. ' This software is provided 'as-is', without any express or implied
  4. ' warranty. In no event will the authors be held liable for any damages
  5. ' arising from the use of this software.
  6. '
  7. ' Permission is granted to anyone to use this software for any purpose,
  8. ' including commercial applications, and to alter it and redistribute it
  9. ' freely, subject to the following restrictions:
  10. '
  11. ' 1. The origin of this software must not be misrepresented; you must not
  12. ' claim that you wrote the original software. If you use this software
  13. ' in a product, an acknowledgment in the product documentation would be
  14. ' appreciated but is not required.
  15. '
  16. ' 2. Altered source versions must be plainly marked as such, and must not be
  17. ' misrepresented as being the original software.
  18. '
  19. ' 3. This notice may not be removed or altered from any source
  20. ' distribution.
  21. '
  22. SuperStrict
  23. Rem
  24. bbdoc: SDL FreeAudio Driver
  25. End Rem
  26. Module SDL.SDLFreeAudio
  27. Import SDL.SDL
  28. Import BRL.FreeAudioAudio
  29. ?win32x86
  30. Import "../../sdl.mod/sdl.mod/include/win32x86/*.h"
  31. ?win32x64
  32. Import "../../sdl.mod/sdl.mod/include/win32x64/*.h"
  33. ?osx
  34. Import "../../sdl.mod/sdl.mod/include/macos/*.h"
  35. ?linuxx86
  36. Import "../../sdl.mod/sdl.mod/include/linuxx86/*.h"
  37. ?linuxx64
  38. Import "../../sdl.mod/sdl.mod/include/linuxx64/*.h"
  39. ?raspberrypi
  40. Import "../../sdl.mod/sdl.mod/include/raspberrypi/*.h"
  41. ?android
  42. Import "../../sdl.mod/sdl.mod/include/android/*.h"
  43. ?ios
  44. Import "../../sdl.mod/sdl.mod/include/ios/*.h"
  45. ?haikux64
  46. Import "../../sdl.mod/sdl.mod/include/haikux64/*.h"
  47. ?
  48. Import "../../sdl.mod/sdl.mod/SDL/include/*.h"
  49. Import "glue.cpp"
  50. Type TSDLFreeAudioDriver Extends TFreeAudioAudioDriver
  51. Method Startup:Int() Override
  52. Local device:Byte Ptr = OpenSDLAudioDevice()
  53. Local res:Int=-1
  54. If device Then
  55. res=fa_Reset(device)
  56. End If
  57. Return res <> -1
  58. End Method
  59. Function Create:TFreeAudioAudioDriver( name:String,Mode:Int ) Override
  60. Local t:TSDLFreeAudioDriver = New TSDLFreeAudioDriver
  61. t._name=name
  62. t._mode=Mode
  63. Return t
  64. End Function
  65. End Type
  66. Extern
  67. Function OpenSDLAudioDevice:Byte Ptr()
  68. End Extern
  69. TSDLFreeAudioDriver.Create "FreeAudio SDL", 8