mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
gui/luainstance.cpp: add function to start file/url play
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#include <gui/widget/messagebox.h>
|
#include <gui/widget/messagebox.h>
|
||||||
#include <gui/filebrowser.h>
|
#include <gui/filebrowser.h>
|
||||||
|
#include <gui/movieplayer.h>
|
||||||
#include <driver/pictureviewer/pictureviewer.h>
|
#include <driver/pictureviewer/pictureviewer.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
|
|
||||||
@@ -408,6 +409,7 @@ const luaL_Reg CLuaInstance::methods[] =
|
|||||||
{ "Blit", CLuaInstance::Blit },
|
{ "Blit", CLuaInstance::Blit },
|
||||||
{ "GetLanguage", CLuaInstance::GetLanguage },
|
{ "GetLanguage", CLuaInstance::GetLanguage },
|
||||||
{ "runScript", CLuaInstance::runScriptExt },
|
{ "runScript", CLuaInstance::runScriptExt },
|
||||||
|
{ "PlayFile", CLuaInstance::PlayFile },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -565,6 +567,28 @@ int CLuaInstance::DisplayImage(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CLuaInstance::PlayFile(lua_State *L)
|
||||||
|
{
|
||||||
|
printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
|
if (numargs < 3) {
|
||||||
|
printf("CLuaInstance::%s: not enough arguments (%d, expected 3)\n", __func__, numargs);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const char *title;
|
||||||
|
const char *fname;
|
||||||
|
|
||||||
|
title = luaL_checkstring(L, 2);
|
||||||
|
fname = luaL_checkstring(L, 3);
|
||||||
|
printf("CLuaInstance::%s: title %s file %s\n", __func__, title, fname);
|
||||||
|
std::string st(title);
|
||||||
|
std::string sf(fname);
|
||||||
|
CMoviePlayerGui::getInstance().SetFile(st, sf);
|
||||||
|
CMoviePlayerGui::getInstance().exec(NULL, "http");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int CLuaInstance::GetSize(lua_State *L)
|
int CLuaInstance::GetSize(lua_State *L)
|
||||||
{
|
{
|
||||||
DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
@@ -191,6 +191,7 @@ 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 PlayFile(lua_State *L);
|
||||||
|
|
||||||
void MenuRegister(lua_State *L);
|
void MenuRegister(lua_State *L);
|
||||||
static int MenuNew(lua_State *L);
|
static int MenuNew(lua_State *L);
|
||||||
|
Reference in New Issue
Block a user