CLuaInstance: Add script function 'zapitSetStandby'

- Necessary for some video plugins
 - Set Lua api version to 1.7


Origin commit data
------------------
Branch: ni/coolstream
Commit: 6f66e21940
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-11-13 (Fri, 13 Nov 2015)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2015-11-13 23:13:31 +01:00
parent e0e1dd631c
commit 94e11ad2a0
2 changed files with 14 additions and 1 deletions

View File

@@ -471,6 +471,7 @@ void CLuaInstance::runScript(const char *fileName, std::vector<std::string> *arg
if (error_string) if (error_string)
*error_string = std::string(lua_tostring(lua, -1)); *error_string = std::string(lua_tostring(lua, -1));
} }
g_Zapit->setStandby(false);
} }
// Example: runScript(fileName, "Arg1", "Arg2", "Arg3", ..., NULL); // Example: runScript(fileName, "Arg1", "Arg2", "Arg3", ..., NULL);
@@ -523,6 +524,7 @@ const luaL_Reg CLuaInstance::methods[] =
{ "setBlank", CLuaInstance::setBlank }, { "setBlank", CLuaInstance::setBlank },
{ "ShowPicture", CLuaInstance::ShowPicture }, { "ShowPicture", CLuaInstance::ShowPicture },
{ "StopPicture", CLuaInstance::StopPicture }, { "StopPicture", CLuaInstance::StopPicture },
{ "zapitSetStandby", CLuaInstance::zapitSetStandby },
{ "Blit", CLuaInstance::Blit }, { "Blit", CLuaInstance::Blit },
{ "GetLanguage", CLuaInstance::GetLanguage }, { "GetLanguage", CLuaInstance::GetLanguage },
{ "runScript", CLuaInstance::runScriptExt }, { "runScript", CLuaInstance::runScriptExt },
@@ -712,6 +714,16 @@ int CLuaInstance::StopPicture(lua_State */*L*/)
return 0; return 0;
} }
int CLuaInstance::zapitSetStandby(lua_State *L)
{
bool standby = true;
int numargs = lua_gettop(L);
if (numargs > 1)
standby = _luaL_checkbool(L, 2);
g_Zapit->setStandby(standby);
return 0;
}
int CLuaInstance::PlayFile(lua_State *L) int CLuaInstance::PlayFile(lua_State *L)
{ {
printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L));

View File

@@ -34,7 +34,7 @@ extern "C" {
#include <vector> #include <vector>
#define LUA_API_VERSION_MAJOR 1 #define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 6 #define LUA_API_VERSION_MINOR 7
/* this is stored as userdata in the lua_State */ /* this is stored as userdata in the lua_State */
struct CLuaData struct CLuaData
@@ -230,6 +230,7 @@ private:
static int setBlank(lua_State *L); static int setBlank(lua_State *L);
static int ShowPicture(lua_State *L); static int ShowPicture(lua_State *L);
static int StopPicture(lua_State *L); static int StopPicture(lua_State *L);
static int zapitSetStandby(lua_State *L);
static int PlayFile(lua_State *L); static int PlayFile(lua_State *L);
static int strFind(lua_State *L); static int strFind(lua_State *L);