mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
CLuaInstance: Add cVideo functions
- cVideo::SetBlank() - cVideo::ShowPicture() - cVideo::StopPicture()
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
#include "luainstance.h"
|
#include "luainstance.h"
|
||||||
|
#include <video.h>
|
||||||
|
|
||||||
/* the magic color that tells us we are using one of the palette colors */
|
/* the magic color that tells us we are using one of the palette colors */
|
||||||
#define MAGIC_COLOR 0x42424200
|
#define MAGIC_COLOR 0x42424200
|
||||||
@@ -457,6 +458,9 @@ const luaL_Reg CLuaInstance::methods[] =
|
|||||||
{ "getRenderWidth", CLuaInstance::getRenderWidth },
|
{ "getRenderWidth", CLuaInstance::getRenderWidth },
|
||||||
{ "GetSize", CLuaInstance::GetSize },
|
{ "GetSize", CLuaInstance::GetSize },
|
||||||
{ "DisplayImage", CLuaInstance::DisplayImage },
|
{ "DisplayImage", CLuaInstance::DisplayImage },
|
||||||
|
{ "setBlank", CLuaInstance::setBlank },
|
||||||
|
{ "ShowPicture", CLuaInstance::ShowPicture },
|
||||||
|
{ "StopPicture", CLuaInstance::StopPicture },
|
||||||
{ "Blit", CLuaInstance::Blit },
|
{ "Blit", CLuaInstance::Blit },
|
||||||
{ "GetLanguage", CLuaInstance::GetLanguage },
|
{ "GetLanguage", CLuaInstance::GetLanguage },
|
||||||
{ "runScript", CLuaInstance::runScriptExt },
|
{ "runScript", CLuaInstance::runScriptExt },
|
||||||
@@ -618,6 +622,29 @@ int CLuaInstance::DisplayImage(lua_State *L)
|
|||||||
return 0;
|
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)
|
int CLuaInstance::PlayFile(lua_State *L)
|
||||||
{
|
{
|
||||||
printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
@@ -193,6 +193,9 @@ private:
|
|||||||
static int runScriptExt(lua_State *L);
|
static int runScriptExt(lua_State *L);
|
||||||
static int GetSize(lua_State *L);
|
static int GetSize(lua_State *L);
|
||||||
static int DisplayImage(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 PlayFile(lua_State *L);
|
||||||
|
|
||||||
static int strFind(lua_State *L);
|
static int strFind(lua_State *L);
|
||||||
|
Reference in New Issue
Block a user