From 0397eaa08543987f7b64a9a0b21d83e6678ab9d3 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 14 Nov 2015 18:38:37 +0100 Subject: [PATCH] CLuaInstance: Add script function 'enableInfoClock' - Set Lua api version to 1.8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5031496d0330c3bfee93c327695653bb08ae6a0 Author: Michael Liebmann Date: 2015-11-14 (Sat, 14 Nov 2015) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 14 ++++++++++++++ src/gui/luainstance.h | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 2662476df..a0785436c 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -533,6 +534,7 @@ const luaL_Reg CLuaInstance::methods[] = { "strSub", CLuaInstance::strSub }, { "checkVersion", CLuaInstance::checkVersion }, { "createChannelIDfromUrl", CLuaInstance::createChannelIDfromUrl }, + { "enableInfoClock", CLuaInstance::enableInfoClock }, { NULL, NULL } }; @@ -2747,3 +2749,15 @@ int CLuaInstance::createChannelIDfromUrl(lua_State *L) } // -------------------------------------------------------------------------------- + +int CLuaInstance::enableInfoClock(lua_State *L) +{ + bool enable = true; + int numargs = lua_gettop(L); + if (numargs > 1) + enable = _luaL_checkbool(L, 2); + CInfoClock::getInstance()->enableInfoClock(enable); + return 0; +} + +// -------------------------------------------------------------------------------- diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 58a346822..1c0887d72 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -34,7 +34,7 @@ extern "C" { #include #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 7 +#define LUA_API_VERSION_MINOR 8 /* this is stored as userdata in the lua_State */ struct CLuaData @@ -321,6 +321,7 @@ private: static int checkVersion(lua_State *L); static int createChannelIDfromUrl(lua_State *L); + static int enableInfoClock(lua_State *L); }; #endif /* _LUAINSTANCE_H */