SoundManager.lua 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class "SoundManager"
  2. function SoundManager:SoundManager(...)
  3. for k,v in pairs(arg) do
  4. if type(v) == "table" then
  5. if v.__ptr ~= nil then
  6. arg[k] = v.__ptr
  7. end
  8. end
  9. end
  10. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  11. self.__ptr = Polycore.SoundManager(unpack(arg))
  12. Polycore.__ptr_lookup[self.__ptr] = self
  13. end
  14. end
  15. function SoundManager:setListenerPosition(position)
  16. local retVal = Polycore.SoundManager_setListenerPosition(self.__ptr, position.__ptr)
  17. end
  18. function SoundManager:setListenerOrientation(orientation)
  19. local retVal = Polycore.SoundManager_setListenerOrientation(self.__ptr, orientation.__ptr)
  20. end
  21. function SoundManager:initAL()
  22. local retVal = Polycore.SoundManager_initAL(self.__ptr)
  23. end
  24. function SoundManager:setGlobalVolume(globalVolume)
  25. local retVal = Polycore.SoundManager_setGlobalVolume(self.__ptr, globalVolume)
  26. end
  27. function SoundManager:__delete()
  28. Polycore.__ptr_lookup[self.__ptr] = nil
  29. Polycore.delete_SoundManager(self.__ptr)
  30. end