mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CLuaInstance: Add script function zapitStopPlayBack
- For safe running ShowPicture() in the plugin - Set Lua api version to 1.19
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include <global.h>
|
||||
#include <system/debug.h>
|
||||
#include <gui/movieplayer.h>
|
||||
#include <zapit/zapit.h>
|
||||
#include <video.h>
|
||||
#include <neutrino.h>
|
||||
|
||||
@@ -97,3 +98,18 @@ int CLuaInstance::PlayFile(lua_State *L)
|
||||
lua_pushinteger(L, ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CLuaInstance::zapitStopPlayBack(lua_State *L)
|
||||
{
|
||||
bool stop = true;
|
||||
int numargs = lua_gettop(L);
|
||||
if (numargs > 1)
|
||||
stop = _luaL_checkbool(L, 2);
|
||||
if (stop) {
|
||||
CMoviePlayerGui::getInstance().stopPlayBack();
|
||||
g_Zapit->stopPlayBack();
|
||||
}
|
||||
else
|
||||
g_Zapit->startPlayBack();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -3,3 +3,4 @@ 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 zapitStopPlayBack(lua_State *L);
|
||||
|
@@ -588,6 +588,7 @@ const luaL_Reg CLuaInstance::methods[] =
|
||||
{ "ShowPicture", CLuaInstance::ShowPicture },
|
||||
{ "StopPicture", CLuaInstance::StopPicture },
|
||||
{ "PlayFile", CLuaInstance::PlayFile },
|
||||
{ "zapitStopPlayBack", CLuaInstance::zapitStopPlayBack },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@@ -34,7 +34,7 @@ extern "C" {
|
||||
#include <vector>
|
||||
|
||||
#define LUA_API_VERSION_MAJOR 1
|
||||
#define LUA_API_VERSION_MINOR 18
|
||||
#define LUA_API_VERSION_MINOR 19
|
||||
|
||||
typedef std::pair<lua_Integer, Font*> fontmap_pair_t;
|
||||
typedef std::map<lua_Integer, Font*> fontmap_t;
|
||||
|
Reference in New Issue
Block a user