add primetime feature to channellist

use green button in favorites to show whats showing on primetime


Origin commit data
------------------
Commit: eb8b55fa72
Author: TangoCash <eric@loxat.de>
Date: 2019-03-03 (Sun, 03 Mar 2019)
This commit is contained in:
TangoCash
2019-03-03 22:20:23 +01:00
committed by vanhofen
parent e75c2a9d11
commit 1f3b4a0499
9 changed files with 59 additions and 5 deletions

View File

@@ -176,6 +176,14 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
CChannelEventList events;
if (displayNext) {
time_t atime = time(NULL);
if (g_settings.channellist_primetime && primetime)
{
struct tm * timeinfo;
timeinfo = localtime (&atime);
timeinfo->tm_hour = 20;
timeinfo->tm_min = 0;
atime = mktime(timeinfo);
}
unsigned int count;
for (count = from; count < to; count++) {
CEitManager::getInstance()->getEventsServiceKey((*chanlist)[count]->getEpgID(), events);
@@ -471,6 +479,7 @@ int CChannelList::exec()
{
displayNext = 0; // always start with current events
displayList = 1; // always start with event list
primetime = 0;
int nNewChannel = show();
if ( nNewChannel > -1 && nNewChannel < (int) (*chanlist).size()) {
if(this->historyMode && (*chanlist)[nNewChannel]) {
@@ -865,8 +874,14 @@ int CChannelList::show()
#if 0
if (g_settings.channellist_additional)
displayList = !displayList;
else
displayNext = !displayNext;
else {
if (primetime && displayNext)
primetime = 0;
else {
primetime = 0;
displayNext = !displayNext;
}
}
#endif
paint();
@@ -886,7 +901,17 @@ int CChannelList::show()
CNeutrinoApp::getInstance()->SetChannelMode(mode);
oldselected = selected;
paint();
} else {
if (g_settings.channellist_primetime) {
if (displayNext && !primetime)
primetime = 1;
else {
primetime = 1;
displayNext = !displayNext;
}
paint();
}
}
}
}
else if (!empty && edit_state && move_state != beMoving && msg == CRCInput::RC_stop )
@@ -1831,7 +1856,16 @@ void CChannelList::paintButtonBar(bool is_current)
break;
}
} else
continue;
{
if (g_settings.channellist_primetime)
{
if (displayNext && primetime)
Button[bcnt].locale = LOCALE_INFOVIEWER_NOW;
else
Button[bcnt].locale = LOCALE_CHANNELLIST_PRIMETIME;
} else
continue;
}
}
if (i == 3) {
//manage now/next button
@@ -1844,7 +1878,7 @@ void CChannelList::paintButtonBar(bool is_current)
else
Button[bcnt].locale = LOCALE_INFOVIEWER_NEXT;
} else {
if (displayNext)
if (displayNext && !primetime)
Button[bcnt].locale = LOCALE_INFOVIEWER_NOW;
else
Button[bcnt].locale = LOCALE_INFOVIEWER_NEXT;
@@ -2312,7 +2346,8 @@ void CChannelList::paintBody()
//NI
#if 0
// disable displayNext
displayNext = false;
if (!g_settings.channellist_primetime)
displayNext = false;
#endif
// paint background for right box
frameBuffer->paintBoxRel(x+width,y+theight+pig_height,infozone_width,infozone_height,COL_MENUCONTENT_PLUS_0);
@@ -2570,6 +2605,8 @@ void CChannelList::showdescription(int index)
ffheight = g_Font[eventFont]->getHeight();
CZapitChannel* chan = (*chanlist)[index];
CChannelEvent *p_event = &chan->currentEvent;
if (displayNext && primetime)
p_event = &chan->nextEvent;
epgData.info1.clear();
epgData.info2.clear();
epgText.clear();

View File

@@ -131,6 +131,7 @@ private:
bool vlist; // "virtual" list, not bouquet
bool displayNext;
bool displayList;
bool primetime;
bool minitv_is_active;
bool headerNew;

View File

@@ -1387,6 +1387,11 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist)
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL);
menu_chanlist->addItem(mc);
// channellist primetime
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_PRIMETIME, &g_settings.channellist_primetime, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_PRIMETIME);
menu_chanlist->addItem(mc);
// epg align
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN);