From c511a44a2b01a1ec1efca7ed2fa9be3bc4bded69 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 10 Sep 2014 21:14:00 +0200 Subject: [PATCH] CLuaInstance: Add cVideo functions - cVideo::SetBlank() - cVideo::ShowPicture() - cVideo::StopPicture() --- src/gui/luainstance.cpp | 27 +++++++++++++++++++++++++++ src/gui/luainstance.h | 3 +++ 2 files changed, 30 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 4fe489c53..7b4bdb8c0 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -34,6 +34,7 @@ #include #include #include "luainstance.h" +#include /* the magic color that tells us we are using one of the palette colors */ #define MAGIC_COLOR 0x42424200 @@ -457,6 +458,9 @@ const luaL_Reg CLuaInstance::methods[] = { "getRenderWidth", CLuaInstance::getRenderWidth }, { "GetSize", CLuaInstance::GetSize }, { "DisplayImage", CLuaInstance::DisplayImage }, + { "setBlank", CLuaInstance::setBlank }, + { "ShowPicture", CLuaInstance::ShowPicture }, + { "StopPicture", CLuaInstance::StopPicture }, { "Blit", CLuaInstance::Blit }, { "GetLanguage", CLuaInstance::GetLanguage }, { "runScript", CLuaInstance::runScriptExt }, @@ -618,6 +622,29 @@ int CLuaInstance::DisplayImage(lua_State *L) return 0; } +extern cVideo * videoDecoder; + +int CLuaInstance::setBlank(lua_State *L) +{ + int enable = 1; + enable = luaL_checkint(L, 2); + videoDecoder->setBlank((enable==1)?true:false); + return 0; +} + +int CLuaInstance::ShowPicture(lua_State *L) +{ + const char *fname = luaL_checkstring(L, 2); + videoDecoder->ShowPicture(fname); + return 0; +} + +int CLuaInstance::StopPicture(lua_State */*L*/) +{ + videoDecoder->StopPicture(); + return 0; +} + int CLuaInstance::PlayFile(lua_State *L) { printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 1104f729e..83117aa85 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -193,6 +193,9 @@ private: static int runScriptExt(lua_State *L); static int GetSize(lua_State *L); static int DisplayImage(lua_State *L); + static int setBlank(lua_State *L); + static int ShowPicture(lua_State *L); + static int StopPicture(lua_State *L); static int PlayFile(lua_State *L); static int strFind(lua_State *L);