mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CLuaInstVideo: Add getNeutrinoMode()
- Set Lua api version to 1.28 Example: video = video.new() if video.getNeutrinoMode() == NMODE.TS then messagebox.exec{title="Attention!", text="Movie player is busy.", buttons={ "ok" } } end
This commit is contained in:
@@ -61,6 +61,7 @@ void CLuaInstVideo::LuaVideoRegister(lua_State *L)
|
||||
{ "zapitStopPlayBack", CLuaInstVideo::zapitStopPlayBack },
|
||||
{ "channelRezap", CLuaInstVideo::channelRezap },
|
||||
{ "createChannelIDfromUrl", CLuaInstVideo::createChannelIDfromUrl },
|
||||
{ "getNeutrinoMode", CLuaInstVideo::getNeutrinoMode },
|
||||
{ "__gc", CLuaInstVideo::VideoDelete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -186,6 +187,12 @@ int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CLuaInstVideo::getNeutrinoMode(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)CNeutrinoApp::getInstance()->getMode());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CLuaInstVideo::VideoDelete(lua_State *L)
|
||||
{
|
||||
CLuaVideo *D = VideoCheckData(L, 1);
|
||||
|
@@ -54,6 +54,7 @@ class CLuaInstVideo
|
||||
static int zapitStopPlayBack(lua_State *L);
|
||||
static int channelRezap(lua_State *L);
|
||||
static int createChannelIDfromUrl(lua_State *L);
|
||||
static int getNeutrinoMode(lua_State *L);
|
||||
static int VideoDelete(lua_State *L);
|
||||
|
||||
static void videoFunctionDeprecated(lua_State *L, std::string oldFunc);
|
||||
|
@@ -307,7 +307,6 @@ static void set_lua_variables(lua_State *L)
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
|
||||
table_key curl_status[] =
|
||||
{
|
||||
{ "OK", (lua_Integer)CLuaInstCurl::LUA_CURL_OK },
|
||||
@@ -318,6 +317,23 @@ static void set_lua_variables(lua_State *L)
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
table_key neutrino_mode[] =
|
||||
{
|
||||
{ "UNKNOWN", (lua_Integer)CNeutrinoApp::mode_unknown },
|
||||
{ "TV", (lua_Integer)CNeutrinoApp::mode_tv },
|
||||
{ "RADIO", (lua_Integer)CNeutrinoApp::mode_radio },
|
||||
{ "SCART", (lua_Integer)CNeutrinoApp::mode_scart },
|
||||
{ "STANDBY", (lua_Integer)CNeutrinoApp::mode_standby },
|
||||
{ "AUDIO", (lua_Integer)CNeutrinoApp::mode_audio },
|
||||
{ "PIC", (lua_Integer)CNeutrinoApp::mode_pic },
|
||||
{ "TS", (lua_Integer)CNeutrinoApp::mode_ts },
|
||||
{ "OFF", (lua_Integer)CNeutrinoApp::mode_off },
|
||||
{ "WEBTV", (lua_Integer)CNeutrinoApp::mode_webtv },
|
||||
{ "MASK", (lua_Integer)CNeutrinoApp::mode_mask },
|
||||
{ "NOREZAP", (lua_Integer)CNeutrinoApp::norezap },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
/* list of environment variable arrays to be exported */
|
||||
lua_envexport e[] =
|
||||
{
|
||||
@@ -331,6 +347,7 @@ static void set_lua_variables(lua_State *L)
|
||||
{ "CC", ccomponents },
|
||||
{ "DYNFONT", dynfont },
|
||||
{ "CURL", curl_status },
|
||||
{ "NMODE", neutrino_mode },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@@ -31,7 +31,7 @@ extern "C" {
|
||||
#include "luainstance_helpers.h"
|
||||
|
||||
#define LUA_API_VERSION_MAJOR 1
|
||||
#define LUA_API_VERSION_MINOR 27
|
||||
#define LUA_API_VERSION_MINOR 28
|
||||
|
||||
/* inspired by Steve Kemp http://www.steve.org.uk/ */
|
||||
class CLuaInstance
|
||||
|
Reference in New Issue
Block a user