diff options
Diffstat (limited to 'src/lua/modules/audio/je_lua_source.cpp')
-rw-r--r-- | src/lua/modules/audio/je_lua_source.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lua/modules/audio/je_lua_source.cpp b/src/lua/modules/audio/je_lua_source.cpp index bf43ceb..afb6cfe 100644 --- a/src/lua/modules/audio/je_lua_source.cpp +++ b/src/lua/modules/audio/je_lua_source.cpp @@ -1,6 +1,6 @@ #include "libjin/jin.h" #include "lua/modules/luax.h" -#include "lua/common/common.h" +#include "lua/common/je_lua_common.h" #include "lua/modules/types.h" namespace JinEngine @@ -12,48 +12,48 @@ namespace JinEngine typedef Ref<Source>& SourceRef; - static inline SourceRef checkSource(lua_State* L) + LUA_IMPLEMENT inline SourceRef checkSource(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_AUDIO_SOURCE); return proxy->getRef<Source>(); } - static int l_play(lua_State* L) + LUA_IMPLEMENT int l_play(lua_State* L) { SourceRef ref = checkSource(L); ref->play(); return 0; } - static int l_stop(lua_State* L) + LUA_IMPLEMENT int l_stop(lua_State* L) { SourceRef ref = checkSource(L); ref->stop(); return 0; } - static int l_pause(lua_State* L) + LUA_IMPLEMENT int l_pause(lua_State* L) { SourceRef ref = checkSource(L); ref->pause(); return 0; } - static int l_rewind(lua_State* L) + LUA_IMPLEMENT int l_rewind(lua_State* L) { SourceRef ref = checkSource(L); ref->rewind(); return 0; } - static int l_resume(lua_State* L) + LUA_IMPLEMENT int l_resume(lua_State* L) { SourceRef ref = checkSource(L); ref->resume(); return 0; } - static int l_isStop(lua_State* L) + LUA_IMPLEMENT int l_isStop(lua_State* L) { SourceRef ref = checkSource(L); bool isStop = ref->isStopped(); @@ -61,7 +61,7 @@ namespace JinEngine return 1; } - static int l_isPaused(lua_State* L) + LUA_IMPLEMENT int l_isPaused(lua_State* L) { SourceRef ref = checkSource(L); bool isPaused = ref->isPaused(); @@ -69,7 +69,7 @@ namespace JinEngine return 1; } - static int l_setVolume(lua_State* L) + LUA_IMPLEMENT int l_setVolume(lua_State* L) { SourceRef ref = checkSource(L); float volume = luax_checknumber(L, 2); @@ -77,7 +77,7 @@ namespace JinEngine return 0; } - static int l_setLoop(lua_State* L) + LUA_IMPLEMENT int l_setLoop(lua_State* L) { SourceRef ref = checkSource(L); bool loop = luax_checkbool(L, 2); @@ -85,14 +85,14 @@ namespace JinEngine return 0; } - static int l_gc(lua_State* L) + LUA_IMPLEMENT int l_gc(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_AUDIO_SOURCE); proxy->release(); return 0; } - static const luaL_Reg f[] = { + LUA_IMPLEMENT const luaL_Reg f[] = { { "__gc", l_gc }, { "play", l_play }, { "stop", l_stop }, @@ -106,7 +106,7 @@ namespace JinEngine { 0, 0 } }; - int luaopen_Source(lua_State* L) + LUA_EXPORT int luaopen_Source(lua_State* L) { luax_newtype(L, JIN_AUDIO_SOURCE, f); return 0; |