CLuaInstance: Add script function 'channelRezap'

- Alternative rezap method for movie plugins
 - Set Lua api version to 1.21


Origin commit data
------------------
Branch: ni/coolstream
Commit: b9afbb1e2c
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-12-08 (Tue, 08 Dec 2015)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2015-12-08 06:16:03 +01:00
parent 8fda2ba2b2
commit 994ff285d3
6 changed files with 32 additions and 15 deletions

View File

@@ -113,3 +113,11 @@ int CLuaInstance::zapitStopPlayBack(lua_State *L)
g_Zapit->startPlayBack();
return 0;
}
int CLuaInstance::channelRezap(lua_State */*L*/)
{
CNeutrinoApp::getInstance()->channelRezap();
if (CNeutrinoApp::getInstance()->getMode() == CNeutrinoApp::mode_radio)
CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
return 0;
}

View File

@@ -4,3 +4,4 @@ static int ShowPicture(lua_State *L);
static int StopPicture(lua_State *L);
static int PlayFile(lua_State *L);
static int zapitStopPlayBack(lua_State *L);
static int channelRezap(lua_State *L);

View File

@@ -589,6 +589,7 @@ const luaL_Reg CLuaInstance::methods[] =
{ "StopPicture", CLuaInstance::StopPicture },
{ "PlayFile", CLuaInstance::PlayFile },
{ "zapitStopPlayBack", CLuaInstance::zapitStopPlayBack },
{ "channelRezap", CLuaInstance::channelRezap },
{ NULL, NULL }
};

View File

@@ -34,7 +34,7 @@ extern "C" {
#include <vector>
#define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 19
#define LUA_API_VERSION_MINOR 21
typedef std::pair<lua_Integer, Font*> fontmap_pair_t;
typedef std::map<lua_Integer, Font*> fontmap_t;

View File

@@ -3547,13 +3547,8 @@ void CNeutrinoApp::tvMode( bool rezap )
g_RemoteControl->tvMode();
SetChannelMode(g_settings.channel_mode);
if( rezap ) {
t_channel_id last_chid = CZapit::getInstance()->GetLastTVChannel();
if(CServiceManager::getInstance()->FindChannel(last_chid))
channelList->zapTo_ChannelID(last_chid, true); /* force re-zap */
else
channelList->zapTo(0, true);
}
if( rezap )
channelRezap();
#ifdef USEACTIONLOG
g_ActionLog->println("mode: tv");
#endif
@@ -3778,16 +3773,27 @@ void CNeutrinoApp::radioMode( bool rezap)
if (g_settings.radiotext_enable && !g_Radiotext)
g_Radiotext = new CRadioText;
if( rezap ) {
t_channel_id last_chid = CZapit::getInstance()->GetLastRADIOChannel();
if(CServiceManager::getInstance()->FindChannel(last_chid))
channelList->zapTo_ChannelID(last_chid, true); /* force re-zap */
else
channelList->zapTo(0, true); /* force re-zap */
}
if( rezap )
channelRezap();
frameBuffer->showFrame("radiomode.jpg");
}
void CNeutrinoApp::channelRezap()
{
t_channel_id last_chid = 0;
if (mode == mode_tv)
last_chid = CZapit::getInstance()->GetLastTVChannel();
else if (mode == mode_radio)
last_chid = CZapit::getInstance()->GetLastRADIOChannel();
else
return;
if(CServiceManager::getInstance()->FindChannel(last_chid))
channelList->zapTo_ChannelID(last_chid, true);
else
channelList->zapTo(0, true);
}
//switching from current mode to tv or radio mode or to optional parameter prev_mode
void CNeutrinoApp::switchTvRadioMode(const int prev_mode)
{

View File

@@ -234,6 +234,7 @@ public:
void screensaver(bool);
//signal/event handler before restart of neutrino gui
sigc::signal<bool> OnBeforeRestart;
void channelRezap();
};
#endif