2
0

SoundManager.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. class "SoundManager"
  2. function SoundManager:SoundManager(...)
  3. local arg = {...}
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycode.SoundManager(unpack(arg))
  13. end
  14. end
  15. function SoundManager:setListenerPosition(position)
  16. local retVal = Polycode.SoundManager_setListenerPosition(self.__ptr, position.__ptr)
  17. end
  18. function SoundManager:setListenerOrientation(orientation)
  19. local retVal = Polycode.SoundManager_setListenerOrientation(self.__ptr, orientation.__ptr)
  20. end
  21. function SoundManager:recordSound(rate, sampleSize)
  22. local retVal = Polycode.SoundManager_recordSound(self.__ptr, rate, sampleSize)
  23. return retVal
  24. end
  25. function SoundManager:Update()
  26. local retVal = Polycode.SoundManager_Update(self.__ptr)
  27. end
  28. function SoundManager:setGlobalVolume(globalVolume)
  29. local retVal = Polycode.SoundManager_setGlobalVolume(self.__ptr, globalVolume)
  30. end
  31. function SoundManager:__delete()
  32. if self then Polycode.delete_SoundManager(self.__ptr) end
  33. end