Added love.audio.setVolume()
This commit is contained in:
@@ -5,14 +5,23 @@
|
|||||||
* under the terms of the MIT license. See LICENSE for details.
|
* under the terms of the MIT license. See LICENSE for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "lib/cmixer/cmixer.h"
|
||||||
#include "luaobj.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 l_source_new(lua_State *L);
|
||||||
|
|
||||||
int luaopen_audio(lua_State *L) {
|
int luaopen_audio(lua_State *L) {
|
||||||
luaL_Reg reg[] = {
|
luaL_Reg reg[] = {
|
||||||
{ "newSource", l_source_new },
|
{ "newSource", l_source_new },
|
||||||
|
{ "setVolume", l_audio_setVolume },
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
};
|
};
|
||||||
luaL_newlib(L, reg);
|
luaL_newlib(L, reg);
|
||||||
|
|||||||
Reference in New Issue
Block a user