Added love.audio.setVolume()

This commit is contained in:
rxi
2017-05-06 09:11:06 +01:00
parent a41497715c
commit f44a8862bc

View File

@@ -5,14 +5,23 @@
* under the terms of the MIT license. See LICENSE for details.
*/
#include "lib/cmixer/cmixer.h"
#include "luaobj.h"
int l_audio_setVolume(lua_State *L) {
double n = luaL_checknumber(L, 1);
cm_set_master_gain(n);
return 0;
}
int l_source_new(lua_State *L);
int luaopen_audio(lua_State *L) {
luaL_Reg reg[] = {
{ "newSource", l_source_new },
{ "newSource", l_source_new },
{ "setVolume", l_audio_setVolume },
{ 0, 0 },
};
luaL_newlib(L, reg);