| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- class "Sound"
- function Sound:Sound(...)
- for k,v in pairs(arg) do
- if type(v) == "table" then
- if v.__ptr ~= nil then
- arg[k] = v.__ptr
- end
- end
- end
- if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
- self.__ptr = Polycore.Sound(unpack(arg))
- end
- end
- function Sound:Play(once)
- local retVal = Polycore.Sound_Play(self.__ptr, once)
- end
- function Sound:Stop()
- local retVal = Polycore.Sound_Stop(self.__ptr)
- end
- function Sound:loadWAV(fileName)
- local retVal = Polycore.Sound_loadWAV(self.__ptr, fileName)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = ALuint("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- end
- function Sound:loadOGG(fileName)
- local retVal = Polycore.Sound_loadOGG(self.__ptr, fileName)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = ALuint("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- end
- function Sound:GenSource(buffer)
- local retVal = Polycore.Sound_GenSource(self.__ptr, buffer.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = ALuint("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- end
- function Sound:checkALError(operation)
- local retVal = Polycore.Sound_checkALError(self.__ptr, operation)
- end
- function Sound:soundError(err)
- local retVal = Polycore.Sound_soundError(self.__ptr, err)
- end
- function Sound:soundCheck(result, err)
- local retVal = Polycore.Sound_soundCheck(self.__ptr, result, err)
- end
|