Conflicts:
	src/gui/channellist.cpp
	src/gui/epgview.cpp
	src/gui/epgview.h
	src/gui/eventlist.cpp


Origin commit data
------------------
Branch: ni/coolstream
Commit: 3210b958a8
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-05-03 (Wed, 03 May 2017)



------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-05-03 22:57:24 +02:00
11 changed files with 273 additions and 153 deletions

View File

@@ -120,12 +120,26 @@ CEventList::CEventList()
oldEventID = -1;
bgRightBoxPaint = false;
header = NULL;
pb = NULL;
Bottombox = NULL;
}
CEventList::~CEventList()
{
delete header;
header = NULL;
ResetModules();
}
void CEventList::ResetModules()
{
if (header){
delete header; header = NULL;
}
if (Bottombox){
delete Bottombox; Bottombox = NULL;
}
if (pb){
delete pb; pb = NULL;
}
}
void CEventList::UpdateTimerList(void)
@@ -291,8 +305,10 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth();
//fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute);
listmaxshow = (height-theight-iheight-0)/fheight;
height = theight+iheight+0+listmaxshow*fheight; // recalc height
botboxheight = fheight1+2*OFFSET_INNER_MIN;
listmaxshow = (height-theight-iheight-botboxheight-0)/fheight;
height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height
y = getScreenStartY(height);
// calculate width of right info_zone
@@ -682,6 +698,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
void CEventList::hide()
{
ResetModules();
frameBuffer->paintBackgroundBoxRel(x,y, full_width,height);
}
@@ -804,6 +821,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
// paint 2nd line text
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color);
if (i_radius)
showProgressBar(currpos);
}
}
@@ -855,57 +875,103 @@ void CEventList::paintDescription(int index)
void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next)
{
int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE;
if (header == NULL){
header = new CComponentsHeader();
header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use
header->enableClock(true, "%H:%M", "%H %M", true);
header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction);
header->setDimensionsAll(x, y, full_width, theight);
}
//header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
if (header->isPainted())
header->getChannelLogoObject()->hide();
header->setChannelLogo(_channel_id,_channelname);
header->setCaption(_channelname,CTextBox::CENTER);
header->paint(CC_SAVE_SCREEN_NO);
paintBottomBox(_channelname_prev, _channelname_next);
}
void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next)
{
int by = y + height - iheight - botboxheight;
int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE;
if (!header)
header = new CComponentsFrmChain();
header->setDimensionsAll(x, y, full_width, theight);
header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction);
header->setCorner(RADIUS_LARGE, CORNER_TOP);
header->clear();
int x_off = OFFSET_INNER_MID;
int mid_width = full_width * 40 / 100; // 40%
int max_height = theight - 2*OFFSET_INNER_MIN;
int side_width = ((full_width - mid_width) / 2) - (2 * x_off);
//create an logo object
CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header);
if (midLogo->hasLogo())
{
midLogo->setWidth(min(midLogo->getWidth(), mid_width), true);
if (midLogo->getHeight() > max_height)
midLogo->setHeight(max_height, true);
midLogo->setPos(CC_CENTERED, CC_CENTERED);
// recalc widths
side_width = ((full_width - midLogo->getWidth()) / 2) - (4 * x_off);
}
else {
header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available
int w_midText = g_Font[font_mid]->getRenderWidth(_channelname);
CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
midText->setXPos(full_width/2 - midText->getWidth()/2);
midText->doPaintBg(false);
if (!Bottombox){
Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight);
Bottombox->setColorBody(COL_MENUFOOT_PLUS_0);
Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction);
Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0);
}else{
if (Bottombox->isPainted())
Bottombox->hideCCItems();
Bottombox->clear();
}
if (!_channelname_prev.empty()) {
CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox);
lpic->doPaintBg(false);
lpic->enableSaveBg();
CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
lText->doPaintBg(false);
lText->enableSaveBg();
}
if (!_channelname_next.empty()) {
int x_pos = full_width - side_width - x_off;
CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox);
int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID;
rpic->doPaintBg(false);
rpic->setXPos(x_pos);
rpic->enableSaveBg();
CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth());
rText->doPaintBg(false);
rText->enableSaveBg();
}
Bottombox->paint(false);
}
void CEventList::showProgressBar(int pos)
{
int epg_done= -1;
if ((( time(NULL)- evtlist[pos].startTime )>= 0 ) && (evtlist[pos].duration > 0))
{
unsigned nProcentagePassed = ((time(NULL) - evtlist[pos].startTime) * 100 / evtlist[pos].duration);
if (nProcentagePassed<= 100)
epg_done= nProcentagePassed;
}
if (!pb)
{
int pbw = 104;
int pbx = x + (full_width - pbw)/2;
int pbh = botboxheight - 12;
int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2;
pb = new CProgressBar(pbx, pby, pbw, pbh);
pb->setType(CProgressBar::PB_TIMESCALE);
pb->doPaintBg(false);
}
//show progressbar
if (epg_done > 0)
{
pb->setValues(epg_done, 100);
pb->paint(true);
}
else
{
pb->hide();
}
if (header->isPainted()) //clean up background of header for new captions
header->kill(header->getColorBody());
header->paint(CC_SAVE_SCREEN_NO);
}
void CEventList::paint(t_channel_id channel_id)