From 7c2f33bdf37de7acf9b0728a115377081344db1c Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 11 Nov 2018 20:18:26 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/audio/je_lua_source.cpp | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/lua/modules/audio/je_lua_source.cpp') diff --git a/src/lua/modules/audio/je_lua_source.cpp b/src/lua/modules/audio/je_lua_source.cpp index 04f0528..2297fea 100644 --- a/src/lua/modules/audio/je_lua_source.cpp +++ b/src/lua/modules/audio/je_lua_source.cpp @@ -10,9 +10,9 @@ namespace JinEngine namespace Lua { - typedef Shared& SourceRef; + typedef Shared& SharedSource; - LUA_IMPLEMENT inline SourceRef checkSource(lua_State* L) + LUA_IMPLEMENT inline SharedSource checkSource(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_AUDIO_SOURCE); return proxy->getShared(); @@ -20,68 +20,68 @@ namespace JinEngine LUA_IMPLEMENT int l_play(lua_State* L) { - SourceRef ref = checkSource(L); - ref->play(); + SharedSource shared = checkSource(L); + shared->play(); return 0; } LUA_IMPLEMENT int l_stop(lua_State* L) { - SourceRef ref = checkSource(L); - ref->stop(); + SharedSource shared = checkSource(L); + shared->stop(); return 0; } LUA_IMPLEMENT int l_pause(lua_State* L) { - SourceRef ref = checkSource(L); - ref->pause(); + SharedSource shared = checkSource(L); + shared->pause(); return 0; } LUA_IMPLEMENT int l_rewind(lua_State* L) { - SourceRef ref = checkSource(L); - ref->rewind(); + SharedSource shared = checkSource(L); + shared->rewind(); return 0; } LUA_IMPLEMENT int l_resume(lua_State* L) { - SourceRef ref = checkSource(L); - ref->resume(); + SharedSource shared = checkSource(L); + shared->resume(); return 0; } LUA_IMPLEMENT int l_isStop(lua_State* L) { - SourceRef ref = checkSource(L); - bool isStop = ref->isStopped(); + SharedSource shared = checkSource(L); + bool isStop = shared->isStopped(); luax_pushboolean(L, isStop); return 1; } LUA_IMPLEMENT int l_isPaused(lua_State* L) { - SourceRef ref = checkSource(L); - bool isPaused = ref->isPaused(); + SharedSource shared = checkSource(L); + bool isPaused = shared->isPaused(); luax_pushboolean(L, isPaused); return 1; } LUA_IMPLEMENT int l_setVolume(lua_State* L) { - SourceRef ref = checkSource(L); + SharedSource shared = checkSource(L); float volume = luax_checknumber(L, 2); - ref->setVolume(volume); + shared->setVolume(volume); return 0; } LUA_IMPLEMENT int l_setLoop(lua_State* L) { - SourceRef ref = checkSource(L); + SharedSource shared = checkSource(L); bool loop = luax_checkbool(L, 2); - ref->setLoop(loop); + shared->setLoop(loop); return 0; } -- cgit v1.1-26-g67d0