Source:pause; Source:stop; Source:isPlaying;

This commit is contained in:
bjorn 2020-11-20 14:04:51 -07:00 committed by Bjorn
parent cbf0416988
commit f7169ec236
1 changed files with 21 additions and 0 deletions

View File

@ -7,6 +7,24 @@ static int l_lovrSourcePlay(lua_State* L) {
return 0;
}
static int l_lovrSourcePause(lua_State* L) {
Source* source = luax_checktype(L, 1, Source);
lovrSourcePause(source);
return 0;
}
static int l_lovrSourceStop(lua_State* L) {
Source* source = luax_checktype(L, 1, Source);
lovrSourceStop(source);
return 0;
}
static int l_lovrSourceIsPlaying(lua_State* L) {
Source* source = luax_checktype(L, 1, Source);
lua_pushboolean(L, lovrSourceIsPlaying(source));
return 1;
}
static int l_lovrSourceIsLooping(lua_State* L) {
Source* source = luax_checktype(L, 1, Source);
lua_pushboolean(L, lovrSourceIsLooping(source));
@ -34,6 +52,9 @@ static int l_lovrSourceSetVolume(lua_State* L) {
const luaL_Reg lovrSource[] = {
{ "play", l_lovrSourcePlay },
{ "pause", l_lovrSourcePause },
{ "stop", l_lovrSourceStop },
{ "isPlaying", l_lovrSourceIsPlaying },
{ "isLooping", l_lovrSourceIsLooping },
{ "setLooping", l_lovrSourceSetLooping },
{ "getVolume", l_lovrSourceGetVolume },