MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / GetSoundState

Method GetSoundState

LuaSTGPlus/LuaWrapper.cpp:1557–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555 return 0;
1556 }
1557 static int GetSoundState(lua_State* L)LNOEXCEPT
1558 {
1559 const char* s = luaL_checkstring(L, 1);
1560 ResSound* p = LRES.FindSound(s);
1561 if (!p)
1562 return luaL_error(L, "sound '%s' not found.", s);
1563 if (p->IsPlaying())
1564 lua_pushstring(L, "playing");
1565 else if (p->IsStopped())
1566 lua_pushstring(L, "stopped");
1567 else
1568 lua_pushstring(L, "paused");
1569 return 1;
1570 }
1571 static int PlayMusic(lua_State* L)LNOEXCEPT
1572 {
1573 const char* s = luaL_checkstring(L, 1);

Callers

nothing calls this directly

Calls 3

FindSoundMethod · 0.80
IsPlayingMethod · 0.45
IsStoppedMethod · 0.45

Tested by

no test coverage detected