mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
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:
@@ -113,3 +113,11 @@ int CLuaInstance::zapitStopPlayBack(lua_State *L)
|
|||||||
g_Zapit->startPlayBack();
|
g_Zapit->startPlayBack();
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
@@ -4,3 +4,4 @@ static int ShowPicture(lua_State *L);
|
|||||||
static int StopPicture(lua_State *L);
|
static int StopPicture(lua_State *L);
|
||||||
static int PlayFile(lua_State *L);
|
static int PlayFile(lua_State *L);
|
||||||
static int zapitStopPlayBack(lua_State *L);
|
static int zapitStopPlayBack(lua_State *L);
|
||||||
|
static int channelRezap(lua_State *L);
|
||||||
|
@@ -589,6 +589,7 @@ const luaL_Reg CLuaInstance::methods[] =
|
|||||||
{ "StopPicture", CLuaInstance::StopPicture },
|
{ "StopPicture", CLuaInstance::StopPicture },
|
||||||
{ "PlayFile", CLuaInstance::PlayFile },
|
{ "PlayFile", CLuaInstance::PlayFile },
|
||||||
{ "zapitStopPlayBack", CLuaInstance::zapitStopPlayBack },
|
{ "zapitStopPlayBack", CLuaInstance::zapitStopPlayBack },
|
||||||
|
{ "channelRezap", CLuaInstance::channelRezap },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ extern "C" {
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define LUA_API_VERSION_MAJOR 1
|
#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::pair<lua_Integer, Font*> fontmap_pair_t;
|
||||||
typedef std::map<lua_Integer, Font*> fontmap_t;
|
typedef std::map<lua_Integer, Font*> fontmap_t;
|
||||||
|
@@ -3547,13 +3547,8 @@ void CNeutrinoApp::tvMode( bool rezap )
|
|||||||
|
|
||||||
g_RemoteControl->tvMode();
|
g_RemoteControl->tvMode();
|
||||||
SetChannelMode(g_settings.channel_mode);
|
SetChannelMode(g_settings.channel_mode);
|
||||||
if( rezap ) {
|
if( rezap )
|
||||||
t_channel_id last_chid = CZapit::getInstance()->GetLastTVChannel();
|
channelRezap();
|
||||||
if(CServiceManager::getInstance()->FindChannel(last_chid))
|
|
||||||
channelList->zapTo_ChannelID(last_chid, true); /* force re-zap */
|
|
||||||
else
|
|
||||||
channelList->zapTo(0, true);
|
|
||||||
}
|
|
||||||
#ifdef USEACTIONLOG
|
#ifdef USEACTIONLOG
|
||||||
g_ActionLog->println("mode: tv");
|
g_ActionLog->println("mode: tv");
|
||||||
#endif
|
#endif
|
||||||
@@ -3778,16 +3773,27 @@ void CNeutrinoApp::radioMode( bool rezap)
|
|||||||
if (g_settings.radiotext_enable && !g_Radiotext)
|
if (g_settings.radiotext_enable && !g_Radiotext)
|
||||||
g_Radiotext = new CRadioText;
|
g_Radiotext = new CRadioText;
|
||||||
|
|
||||||
if( rezap ) {
|
if( rezap )
|
||||||
t_channel_id last_chid = CZapit::getInstance()->GetLastRADIOChannel();
|
channelRezap();
|
||||||
if(CServiceManager::getInstance()->FindChannel(last_chid))
|
|
||||||
channelList->zapTo_ChannelID(last_chid, true); /* force re-zap */
|
|
||||||
else
|
|
||||||
channelList->zapTo(0, true); /* force re-zap */
|
|
||||||
}
|
|
||||||
frameBuffer->showFrame("radiomode.jpg");
|
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
|
//switching from current mode to tv or radio mode or to optional parameter prev_mode
|
||||||
void CNeutrinoApp::switchTvRadioMode(const int prev_mode)
|
void CNeutrinoApp::switchTvRadioMode(const int prev_mode)
|
||||||
{
|
{
|
||||||
|
@@ -234,6 +234,7 @@ public:
|
|||||||
void screensaver(bool);
|
void screensaver(bool);
|
||||||
//signal/event handler before restart of neutrino gui
|
//signal/event handler before restart of neutrino gui
|
||||||
sigc::signal<bool> OnBeforeRestart;
|
sigc::signal<bool> OnBeforeRestart;
|
||||||
|
void channelRezap();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user