neutrino-mp tmdb -> neutrino-hd

Origin commit data
------------------
Branch: ni/coolstream
Commit: f07b01b418
Author: TangoCash <eric@loxat.de>
Date: 2016-03-04 (Fri, 04 Mar 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2016-03-04 13:57:14 +01:00
committed by Michael Liebmann
parent f35562bc78
commit 5018ce6dd2
6 changed files with 539 additions and 7 deletions

View File

@@ -48,6 +48,8 @@
#include <gui/filebrowser.h>
#include <gui/customcolor.h>
#include <gui/pictureviewer.h>
#include <gui/tmdb.h>
#include <driver/record.h>
#include <zapit/bouquets.h>
#include <zapit/getservices.h>
@@ -118,6 +120,7 @@ CEpgData::CEpgData()
{
bigFonts = false;
frameBuffer = CFrameBuffer::getInstance();
tmdbtoggle = false;
}
void CEpgData::start()
@@ -182,7 +185,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8
// check the wordwidth - add to this line if size ok
int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord);
if ((aktWordWidth+aktWidth)<(ox - 20 - 15))
if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (tmdbtoggle? (std::min((sb-10)*342/513,342)) :0)))
{//space ok, add
aktWidth += aktWordWidth;
aktLine += aktWord;
@@ -217,12 +220,15 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8
addTextToArray( aktLine + aktWord, screening );
}
void CEpgData::showText( int startPos, int ypos )
void CEpgData::showText( int startPos, int ypos, bool cover )
{
// recalculate
medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight();
medlinecount = sb / medlineheight;
int cover_height = std::min(sb-10,513);
int cover_width = std::min((sb-10)*342/513,342);
int cover_offset = cover ? cover_width+3 : 0;
int textSize = epgText.size();
int y=ypos;
const char tok = ' ';
@@ -236,6 +242,9 @@ void CEpgData::showText( int startPos, int ypos )
max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " "));
}
frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box
if (cover) {
if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, 1))
cover_offset = 0; }
for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight)
{
if(epgText[i].second){
@@ -262,7 +271,18 @@ void CEpgData::showText( int startPos, int ypos )
count = 0;
}
else{
g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT);
g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT);
}
}
if (stars > 0 && startPos == 0){
int icon_w,icon_h;
frameBuffer->getIconSize(ICONSDIR"/star-off.png", &icon_w, &icon_h);
for (int i=1; i < 11;i++) {
frameBuffer->paintIcon(ICONSDIR"/star-off.png", sx+3+cover_offset+i*icon_w+3, ypos+3);
}
for (int i=1; i < stars+1;i++) {
frameBuffer->paintIcon(ICONSDIR"/star-on.png", sx+3+cover_offset+i*icon_w+3, ypos+3);
}
}
@@ -458,6 +478,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
startzeit=*a_startzeit;
id=a_id;
tmdbtoggle = false;
stars = 0;
CComponentsHeader* header = NULL;
CComponentsPicture* headerPic = NULL;
CComponentsText* headerText = NULL;
@@ -770,7 +793,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if (showPos+scrollCount<textCount)
{
showPos += scrollCount;
showText(showPos, sy + toph);
showText(showPos, sy + toph, tmdbtoggle);
}
break;
@@ -779,7 +802,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if (showPos<0)
showPos=0;
else
showText(showPos, sy + toph);
showText(showPos, sy + toph, tmdbtoggle);
break;
case CRCInput::RC_page_up:
if(isCurrentEPG(channel_id)){
@@ -884,6 +907,41 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
printf("timerd not available\n");
}
break;
case CRCInput::RC_info:
{
if (!tmdbtoggle) {
cTmdb* tmdb = new cTmdb(epgData.title);
if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) {
epgText_saved = epgText;
epgText.clear();
if (tmdb->hasCover()) {
tmdbtoggle = !tmdbtoggle;
processTextToArray(tmdb->CreateEPGText());
textCount = epgText.size();
stars = tmdb->getStars();
showText(showPos, sy + toph, tmdbtoggle);
} else {
processTextToArray(tmdb->CreateEPGText());
textCount = epgText.size();
stars = tmdb->getStars();
showText(showPos, sy + toph, tmdbtoggle);
tmdbtoggle = !tmdbtoggle;
}
} else {
ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk);
}
if (tmdb)
delete tmdb;
} else {
epgText.clear();
epgText = epgText_saved;
textCount = epgText.size();
stars=0;
showText(showPos, sy + toph);
tmdbtoggle = !tmdbtoggle;
}
break;
}
// 31.05.2002 dirch zapto timer
case CRCInput::RC_yellow:
@@ -932,7 +990,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
}
break;
}
case CRCInput::RC_info:
case CRCInput::RC_help:
bigFonts = bigFonts ? false : true;
frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy);
@@ -1165,6 +1222,7 @@ const struct button_label EpgButtons[] =
{
{ NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT },
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
{ NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL },
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }
};