- channellist: move zaphistory/current_transponder handling into sepatate function

Conflicts:
	src/neutrino.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-03-22 00:09:41 +01:00
committed by Thilo Graf
parent 1bf83a035f
commit ef99e41f93
3 changed files with 33 additions and 33 deletions

View File

@@ -1220,36 +1220,12 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force)
} }
} }
/* Called only from "all" channel list */ int CChannelList::showLiveBouquet(int key)
int CChannelList::numericZap(int key)
{ {
int res = -1; int res = -1;
if (showEmptyError()) if (showEmptyError())
return res; return res;
/*
TODO?
Move handling of key_zaphistory and key_current_transponder
into sepatate functions?
These keys do not zap numeric. Pseudo bouquets are shown.
*/
// quickzap "0" to last seen channel
if (key == g_settings.key_lastchannel)
{
t_channel_id channel_id = lastChList.getlast(1);
if (channel_id && SameTP(channel_id))
{
lastChList.clear_storedelay(); // ignore store delay
int new_mode = lastChList.get_mode(channel_id);
if (new_mode >= 0)
CNeutrinoApp::getInstance()->SetChannelMode(new_mode);
zapTo_ChannelID(channel_id);
res = 0;
}
return res;
}
// zap history bouquet // zap history bouquet
if (key == g_settings.key_zaphistory) if (key == g_settings.key_zaphistory)
{ {
@@ -1306,7 +1282,33 @@ int CChannelList::numericZap(int key)
return res; return res;
} }
// real numeric zap return res;
}
/* Called only from "all" channel list */
int CChannelList::numericZap(int key)
{
int res = -1;
if (showEmptyError())
return res;
// quickzap "0" to last seen channel
if (key == g_settings.key_lastchannel)
{
t_channel_id channel_id = lastChList.getlast(1);
if (channel_id && SameTP(channel_id))
{
lastChList.clear_storedelay(); // ignore store delay
int new_mode = lastChList.get_mode(channel_id);
if (new_mode >= 0)
CNeutrinoApp::getInstance()->SetChannelMode(new_mode);
zapTo_ChannelID(channel_id);
res = 0;
}
return res;
}
// numeric zap
size_t maxchansize = MaxChanNr().size(); size_t maxchansize = MaxChanNr().size();
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth();
int fh = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); int fh = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight();

View File

@@ -214,6 +214,7 @@ public:
bool adjustToChannelID(const t_channel_id channel_id); bool adjustToChannelID(const t_channel_id channel_id);
bool showInfo(int pos, int epgpos = 0); bool showInfo(int pos, int epgpos = 0);
void updateEvents(unsigned int from, unsigned int to); void updateEvents(unsigned int from, unsigned int to);
int showLiveBouquet(int key);
int numericZap(int key); int numericZap(int key);
int show(); int show();
int exec(); int exec();

View File

@@ -2521,7 +2521,7 @@ void CNeutrinoApp::quickZap(int msg)
else else
ret = channelList->quickZap(msg); ret = channelList->quickZap(msg);
if (!ret) { if (!ret) {
res = channelList->numericZap(g_settings.key_zaphistory); res = channelList->showLiveBouquet(g_settings.key_zaphistory);
StartSubtitles(res < 0); StartSubtitles(res < 0);
} }
} }
@@ -2712,9 +2712,7 @@ void CNeutrinoApp::RealRun()
numericZap(msg); numericZap(msg);
} }
else if (msg == (neutrino_msg_t) g_settings.key_zaphistory || msg == (neutrino_msg_t) g_settings.key_current_transponder) { else if (msg == (neutrino_msg_t) g_settings.key_zaphistory || msg == (neutrino_msg_t) g_settings.key_current_transponder) {
InfoClock->disableInfoClock(); showChannelList(msg);
numericZap(msg);
InfoClock->enableInfoClock();
} }
#ifdef SCREENSHOT #ifdef SCREENSHOT
else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
@@ -2823,8 +2821,7 @@ void CNeutrinoApp::RealRun()
StartSubtitles(); StartSubtitles();
} }
else if (CRCInput::isNumeric(msg)) { else if (CRCInput::isNumeric(msg)) {
numericZap( msg ); numericZap(msg);
} }
/* FIXME ??? */ /* FIXME ??? */
else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) {
@@ -2958,7 +2955,7 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu)
SetChannelMode(LIST_MODE_PROV); SetChannelMode(LIST_MODE_PROV);
nNewChannel = bouquetList->exec(true); nNewChannel = bouquetList->exec(true);
} else if (msg == (neutrino_msg_t) g_settings.key_zaphistory || msg == (neutrino_msg_t) g_settings.key_current_transponder) { } else if (msg == (neutrino_msg_t) g_settings.key_zaphistory || msg == (neutrino_msg_t) g_settings.key_current_transponder) {
channelList->numericZap(msg); channelList->showLiveBouquet(msg);
} }
_repeat: _repeat:
printf("CNeutrinoApp::showChannelList: nNewChannel %d\n", nNewChannel);fflush(stdout); printf("CNeutrinoApp::showChannelList: nNewChannel %d\n", nNewChannel);fflush(stdout);