diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index b85592897..31682a851 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -223,7 +223,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *c = avc->streams[best_stream]->codec; #else AVCodecContext *c = avcodec_alloc_context3(codec); @@ -456,7 +456,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) #else if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) @@ -477,7 +477,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; @@ -507,7 +507,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; #else diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 97d94ff75..6474321e3 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -123,6 +123,7 @@ std::string CPictureViewer::DownloadImage(std::string url) curl_easy_setopt(ch, CURLOPT_URL, url.c_str()); curl_easy_setopt(ch, CURLOPT_CONNECTTIMEOUT, 3); curl_easy_setopt(ch, CURLOPT_TIMEOUT, 4); + curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L); CURLcode res = curl_easy_perform(ch); if (res != CURLE_OK){ printf("[%s] curl_easy_perform() failed:%s\n",__func__, curl_easy_strerror(res)); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 97eb84848..86d92b02e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2024,7 +2024,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * codec = st->codec; #else AVCodecParameters * codec = st->codecpar; @@ -2257,7 +2257,7 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -2313,7 +2313,7 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 9a9a8a682..b1b2bac3b 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -858,7 +858,7 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -931,7 +931,7 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 2f278031c..960a3f0bf 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2009,2011,2013,2015-2017 Stefan Seyfried + Copyright (C) 2017 Sven Hoefer License: GPL @@ -72,7 +73,6 @@ CBouquetList::CBouquetList(const char * const Name) name = g_Locale->getText(LOCALE_BOUQUETLIST_HEAD); else name = Name; - } CBouquetList::~CBouquetList() @@ -416,7 +416,8 @@ int CBouquetList::show(bool bShowChannelList) int h_max_icon = 0; favonly = !bShowChannelList; - for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ + for (unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); count++) + { int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); @@ -424,26 +425,32 @@ int CBouquetList::show(bool bShowChannelList) h_max_icon = std::max(h_max_icon, icol_h); } - int need_width = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0])*(w_max_icon + w_max_text + 20); - CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + item_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - width = w_max (need_width, 20); - height = h_max (16 * fheight, 40); + /* + We align width to needed footer space, + but this manual calculation isn't a good idea. + It would be better to get the needed width from + CComponententsFooter class. + */ + width = (sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]))*(w_max_icon + w_max_text + 2*OFFSET_INNER_MID); + height = 16*item_height; - footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - listmaxshow = (height - theight - footerHeight)/fheight; - height = theight + footerHeight + listmaxshow * fheight; // recalc height + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + footer_height = header_height; + listmaxshow = (height - header_height - footer_height)/item_height; + height = header_height + footer_height + listmaxshow*item_height; // recalc height - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; + x = getScreenStartX(width); + y = getScreenStartY(height); int lmaxpos= 1; int i= Bouquets.size(); while ((i= i/10)!=0) lmaxpos++; + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); + COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); @@ -476,7 +483,7 @@ int CBouquetList::show(bool bShowChannelList) { selected = oldselected; if(fader.StartFadeOut()) { - timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + timeoutEnd = CRCInput::calcTimeoutEnd(1); msg = 0; } else loop=false; @@ -568,7 +575,7 @@ int CBouquetList::show(bool bShowChannelList) pos = 1; } } else { - chn = chn * 10 + CRCInput::getNumericValue(msg); + chn = chn*10 + CRCInput::getNumericValue(msg); pos++; } @@ -599,6 +606,7 @@ int CBouquetList::show(bool bShowChannelList) fader.StopFade(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + if (save_bouquets) { save_bouquets = false; #if 0 @@ -610,7 +618,8 @@ int CBouquetList::show(bool bShowChannelList) if (g_settings.epg_scan == CEpgScan::SCAN_SEL) CEpgScan::getInstance()->Start(); } - if(zapOnExit) + + if (zapOnExit) return (selected); return (res); @@ -618,13 +627,13 @@ int CBouquetList::show(bool bShowChannelList) void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height+10); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } void CBouquetList::paintItem(int pos) { - int ypos = y+ theight+0 + pos*fheight; + int ypos = y + header_height + pos*item_height; bool iscurrent = true; int npos = liststart + pos; const char * lname = NULL; @@ -641,8 +650,8 @@ void CBouquetList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if (npos < (int) Bouquets.size()) lname = (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bFav) ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : Bouquets[npos]->channelList->getName(); @@ -668,33 +677,33 @@ void CBouquetList::paintItem(int pos) } } - if(npos < (int) Bouquets.size()) { - char tmp[10]; - sprintf((char*) tmp, "%d", npos+ 1); + if (npos < (int) Bouquets.size()) { + char num[10]; + sprintf((char*) num, "%d", npos + 1); int iw = 0, ih = 0; if ((g_settings.epg_scan == CEpgScan::SCAN_SEL) && Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bScanEpg) { frameBuffer->getIconSize(NEUTRINO_ICON_EPG, &iw, &ih); if (iw && ih) { - int icon_x = (x+width-2) - RADIUS_LARGE/2 - iw; - frameBuffer->paintIcon(NEUTRINO_ICON_EPG, icon_x - iw, ypos, fheight); - iw = iw + 4 + RADIUS_LARGE/2; + int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw; + frameBuffer->paintIcon(NEUTRINO_ICON_EPG, icon_x, ypos, item_height); + iw = iw + OFFSET_INNER_MID; } } if (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bUseCI) { - int iw2; - frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED2, &iw2, &ih); + int iw2 = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED, &iw2, &ih); if (iw2 && ih) { - int icon_x = (x+width-2) - RADIUS_LARGE/2 - iw - iw2 - 2; - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED2, icon_x - iw2, ypos, fheight); - iw = iw + iw2 + 4 + RADIUS_LARGE/2; + int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw - iw2; + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x, ypos, item_height); + iw = iw + iw2 + OFFSET_INNER_MID; } } - int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); + int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(num); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + item_height, numwidth + OFFSET_INNER_SMALL, num, color, item_height); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15 - iw, lname, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + item_height, width - numwidth - 2*OFFSET_INNER_MID - iw - SCROLLBAR_WIDTH, lname, color); //CVFD::getInstance()->showMenuText(0, bouq->channelList->getName(), -1, true); } } @@ -702,7 +711,7 @@ void CBouquetList::paintItem(int pos) void CBouquetList::paintHead() { std::string icon(""); - CComponentsHeader header(x, y, width, theight, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); + CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); header.paint(CC_SAVE_SCREEN_NO); } @@ -722,33 +731,32 @@ void CBouquetList::paint() _lastnum /= 10; } - frameBuffer->paintBoxRel(x, y+theight, width, height - theight - footerHeight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); - int numbuttons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); -#if 0 - if (favonly) /* this actually shows favorites and providers button, but both are active anyway */ - numbuttons = 2; + int numButtons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); -#endif if (favonly) - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round - else - ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); - - if(!Bouquets.empty()) { - for(unsigned int count=0;countpaintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + } + else + { + CComponentsFooter footer; + footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); + } + + if (!Bouquets.empty()) + { + for (unsigned int count = 0; count < listmaxshow; count++) + { paintItem(count); } } - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); - int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero - int sbc= ((bsize - 1)/ listmaxshow_tmp)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow_tmp); + int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero + int total_pages = ((bsize - 1) / _listmaxshow) + 1; + int current_page = selected / _listmaxshow; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 04043e34e..94c7a617e 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -87,9 +87,9 @@ class CBouquetList : public CListHelpers unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; - int fheight; // Fonthoehe Bouquetlist-Inhalt - int theight; // Fonthoehe Bouquetlist-Titel - int footerHeight; + int item_height; + int header_height; + int footer_height; int width; int height; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 88c2a4e67..067baa9a3 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -129,7 +129,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl dline = NULL; cc_minitv = NULL; logo_off = 0; - pig_on_win = false; + minitv_is_active = false; CChannelLogo = NULL; headerNew = true; bouquet = NULL; @@ -488,7 +488,7 @@ void CChannelList::calcSize() fheight = 1; /* avoid div-by-zero crash on invalid font */ footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; - pig_on_win = ( (g_settings.channellist_additional == 2) /* with miniTV */ && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); + minitv_is_active = ( (g_settings.channellist_additional == 2) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width full_width = frameBuffer->getScreenWidthRel(); //NI @@ -503,7 +503,7 @@ void CChannelList::calcSize() // calculate height (the infobox below mainbox is handled outside height) if (g_settings.channellist_show_infobox) - info_height = 2*fheight + fdescrheight + 10; + info_height = 2*fheight + fdescrheight + 2*OFFSET_INNER_SMALL; else info_height = 0; height = frameBuffer->getScreenHeightRel(); //NI @@ -530,7 +530,7 @@ void CChannelList::calcSize() // calculate width/height of right info_zone and pip-box infozone_width = full_width - width; pig_width = infozone_width; - if ( pig_on_win /* with miniTV */ ) + if (minitv_is_active) pig_height = (pig_width * 9) / 16; else pig_height = 0; @@ -1580,8 +1580,8 @@ void CChannelList::paintDetails(int index) std::string text1= p_event->description; std::string text2= p_event->text; - int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) + int xstart = OFFSET_INNER_MID; + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 3*OFFSET_INNER_MID - seit_len) ) { // zu breit, Umbruch versuchen... int pos; @@ -1589,7 +1589,7 @@ void CChannelList::paintDetails(int index) pos = text1.find_last_of("[ -.]+"); if ( pos!=-1 ) text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 3*OFFSET_INNER_MID - seit_len) ) ); std::string text3 = ""; /* not perfect, but better than crashing... */ if (p_event->description.length() > text1.length()) @@ -1599,7 +1599,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID, ypos_a + 2*fheight, full_width - 3*OFFSET_INNER_MID - noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } if (!(text2.empty())) { @@ -1608,7 +1608,7 @@ void CChannelList::paintDetails(int index) text2 = text2.substr( 0, text2.find('\n') ); #if 0 //FIXME: to discuss, eat too much cpu time if string long enough int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2) > (full_width - 30 - noch_len) ) ) { + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2) > (full_width - 3*OFFSET_INNER_MID - noch_len) ) ) { pos = text2.find_last_of(" "); if ( pos!=-1 ) { @@ -1616,18 +1616,18 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, ypos_a + fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + xstart, ypos_a + fdescrheight+ fheight, full_width- xstart- 3*OFFSET_INNER_MID- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, ypos_a + fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, ypos_a + fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + fheight, full_width - 3*OFFSET_INNER_MID - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- seit_len, ypos_a + fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- noch_len, ypos_a + fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } else if (IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + fheight, full_width - 3*OFFSET_INNER_MID, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); } if (g_settings.channellist_foot == 0 && IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight + fdescrheight, full_width - 30, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight + fdescrheight, full_width - 3*OFFSET_INNER_MID, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); } else if(g_settings.channellist_foot == 0) { transponder t; CServiceManager::getInstance()->GetTransponder((*chanlist)[index]->getTransponderId(), t); @@ -1638,7 +1638,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName((*chanlist)[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight +fdescrheight, full_width - 3*OFFSET_INNER_MID, desc.c_str(), COL_MENUCONTENTDARK_TEXT); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event @@ -1652,8 +1652,8 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, ypos_a + 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight+ fdescrheight, full_width - 3*OFFSET_INNER_MID - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- from_len, ypos_a + 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } } } @@ -2242,7 +2242,7 @@ void CChannelList::paintBody() liststart = (selected/listmaxshow)*listmaxshow; updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); - if (pig_on_win) // with miniTV + if (minitv_is_active) paintPig(x+width, y+theight, pig_width, pig_height); // paint background for main box @@ -2344,7 +2344,7 @@ std::string CChannelList::MaxChanNr() return to_string(n); } -void CChannelList::paintPig (int _x, int _y, int w, int h) +void CChannelList::paintPig(int _x, int _y, int w, int h) { //init minitv object with basic properties if (cc_minitv == NULL){ diff --git a/src/gui/channellist.h b/src/gui/channellist.h index f5addbe68..75ac35a63 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -131,7 +131,7 @@ private: bool vlist; // "virtual" list, not bouquet bool displayNext; bool displayList; - bool pig_on_win; + bool minitv_is_active; bool headerNew; diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index dd414b5fb..962315748 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -68,7 +68,7 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, page_count = 1; cur_page = 0; sb = NULL; - w_sb = 15; + w_sb = SCROLLBAR_WIDTH; page_scroll_mode = PG_SCROLL_M_UP_DOWN_KEY; @@ -375,6 +375,7 @@ void CComponentsForm::paintCCItems() if (cc_parent){ this_x = auto_x = cc_xr; this_y = auto_y = cc_yr; + w_parent_frame = cc_parent->getFrameThickness(); } //init and handle scrollbar @@ -482,7 +483,7 @@ void CComponentsForm::paintCCItems() //Is it too wide or too high, it will be shortened and displayed in the log. //This should be avoid! //checkwidth and adapt if required - int right_frm = (cc_parent ? cc_xr : x) + this_w - 2*fr_thickness; + int right_frm = (cc_parent ? cc_xr : x) + this_w/* - 2*fr_thickness*/; int right_item = cc_item->getRealXPos() + w_item; int w_diff = right_item - right_frm; int new_w = w_item - w_diff; diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index a13193e09..297406e9f 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -59,8 +59,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, { cc_item_type = CC_ITEMTYPE_FRM_CLOCK; - x = x_pos; - y = y_pos; + x = cc_xr = x_old = x_pos; + y = cc_yr = y_old = y_pos; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; @@ -74,6 +74,9 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, setClockFormat(prformat_str, secformat_str); cl_col_text = COL_MENUCONTENT_TEXT; + //enable refresh of all segments on each interval as default + cl_force_repaint = true; + //init default font cl_font = font; cl_font_style = font_style; @@ -81,15 +84,12 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, initClockFont(0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); //init general clock dimensions - height = cl_font->getHeight(); - width = cl_font->getRenderWidth(cl_format_str); + height = height_old= cl_font->getHeight(); + width = width_old = cl_font->getRenderWidth(cl_format_str); //set default text background behavior cc_txt_save_screen = false; - //enable refresh of all segments on each interval as default - cl_force_repaint = true; - //set default running clock properties cl_interval = interval_seconds; cl_timer = NULL; @@ -429,9 +429,9 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); - CCDraw::setHeight(f_height); + CComponentsItem::setHeight(f_height); }else - CCDraw::setHeight(h); + CComponentsItem::setHeight(h); initCCLockItems(); } @@ -443,9 +443,9 @@ void CComponentsFrmClock::setWidth(const int& w) int f_width = cl_font->getRenderWidth(cl_format_str); if (w != f_width){ dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font width is different than current width [%d], using [%d] ...\033[0m\n", __func__, __LINE__, w, f_width); - CCDraw::setWidth(f_width); + CComponentsItem::setWidth(f_width); }else - CCDraw::setWidth(w); + CComponentsItem::setWidth(w); initCCLockItems(); } diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 335b578b7..a5fca52fa 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -111,6 +111,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con if (chain) chain->clear(); + if (label_count == 0) + return; + /* set general available full basic space for button chain, * in this case this is footer width */ @@ -372,7 +375,6 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setButtonFont(font); this->setContextButton(context_buttons); this->setButtonLabels(content, label_count, 0, label_width); - this->paint(do_save_bg); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index e780b86b2..25eb4806a 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -413,7 +413,6 @@ void CComponentsHeader::initClock() //set clock form properties if (cch_cl_obj){ - cch_cl_obj->setYPos(cch_items_y); cch_cl_obj->setHeight(height); //disallow paint of clock, if disabled and exit method @@ -475,7 +474,7 @@ void CComponentsHeader::initCaption() int clock_w = cch_cl_enable ? cch_cl_obj->getWidth() : 0; //set x position of clock - cch_cl_obj->setXPos(width - buttons_w - clock_w - cch_offset); + cch_cl_obj->setXPos(width - buttons_w - clock_w); //set required width of caption object cc_text_w -= (clock_w + cch_offset); diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 018ad066f..1ef19cbd4 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -34,7 +34,7 @@ #include #include -#define SB_MIN_HEIGHT 12 +#define SB_MIN_HEIGHT OFFSET_INNER_MID #define REF_PERCENT_TXT "100% " using namespace std; @@ -55,8 +55,8 @@ void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, c corner_rad = 0; corner_type = 0; - append_x_offset = 2; - append_y_offset = 2; + append_x_offset = OFFSET_INNER_MIN; + append_y_offset = OFFSET_INNER_MIN; sb_scale_height = -1; dy_font = CNeutrinoFonts::getInstance(); @@ -330,7 +330,7 @@ void CSignalBox::initSignalItems() sbar->setScaleHeight(scale_h); sbar->enableTboxSaveScreen(cc_txt_save_screen); - snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); + snrbar->setDimensionsAll(vertical ? sbar_x : sbar->getXPos() + sbar->getWidth() + append_x_offset, vertical ? sbar->getYPos() + sbar->getHeight() + append_y_offset : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); snrbar->setTextColor(sbx_caption_color); snrbar->setActiveColor(sbx_active_color); diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 73a6e23a5..bbce38a9e 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -205,7 +205,7 @@ void CComponentsWindow::initHeader() //set header properties //TODO: assigned properties with internal header objekt have no effect! if (ccw_head){ ccw_head->setWidth(width-2*fr_thickness); - ccw_head->setPos(0, 0); + ccw_head->setPos(fr_thickness, fr_thickness); ccw_head->setIcon(ccw_icon_name); ccw_head->setCaption(ccw_caption, ccw_align_mode, ccw_col_head_text); ccw_head->setContextButton(ccw_buttons); @@ -223,8 +223,8 @@ void CComponentsWindow::initFooter() if (ccw_footer){ if (ccw_h_footer) ccw_footer->setHeight(ccw_h_footer); - ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); - ccw_footer->setWidth(width-2*fr_thickness); + ccw_footer->setPos(cc_xr + fr_thickness, cc_yr + height - ccw_footer->getHeight()- fr_thickness); + ccw_footer->setWidth(width/*-2*fr_thickness*/); ccw_footer->enableShadow(false/*shadow*/); ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index b783f82d8..54c335c9a 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -261,6 +261,20 @@ bool CComponentsItem::isAdded() return false; } +void CComponentsItem::setXPos(const int& xpos) +{ + CCDraw::setXPos(xpos); + if (cc_parent) + cc_xr = cc_parent->getXPos() + x; +} + +void CComponentsItem::setYPos(const int& ypos) +{ + CCDraw::setYPos(ypos); + if (cc_parent) + cc_yr = cc_parent->getYPos() + y; +} + void CComponentsItem::setXPosP(const uint8_t& xpos_percent) { int x_tmp = cc_parent ? xpos_percent*cc_parent->getWidth() : xpos_percent*frameBuffer->getScreenWidth(); diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 4f5f42da5..37677a813 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -134,6 +134,11 @@ class CComponentsItem : public CComponents ///returns current number of page location of current item, see: cc_page_number virtual u_int8_t getPageNumber(){return cc_page_number;}; + ///set screen x-position, parameter as int + virtual void setXPos(const int& xpos); + ///set screen y-position, parameter as int + virtual void setYPos(const int& ypos); + ///set screen x-position, parameter as uint8_t, percent x value related to current width of parent form or screen virtual void setXPosP(const uint8_t& xpos_percent); ///set screen y-position, parameter as uint8_t, percent y value related to current height of parent form or screen diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 1870092af..4bcbc14a1 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -74,8 +74,8 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, //CComponents x = x_old = x_pos; y = y_old = y_pos; - width = dx = dxc = w; - height = dy = dyc = h; + width = width_old = dx = dxc = w; + height = height_old = dy = dyc = h; pic_name = pic_name_old = image_name; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; @@ -148,6 +148,24 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) initCCItem(); } +void CComponentsPicture::setXPos(const int& xpos) +{ + CComponentsItem::setXPos(xpos); + if (xpos == x) + return; + need_init = true; + initCCItem(); +} + +void CComponentsPicture::setYPos(const int& ypos) +{ + CComponentsItem::setYPos(ypos); + if (ypos == y) + return; + need_init = true; + initCCItem(); +} + void CComponentsPicture::initCCItem() { if (pic_name.empty() || !need_init){ @@ -385,6 +403,7 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& channelName, bool allow_scale) { + cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO; channel_name = ""; channel_id = 0; alt_pic_name = ""; @@ -415,6 +434,8 @@ void CComponentsChannelLogo::setAltLogo(const char* picture_name) void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { need_init = true; + string image = pic_name; + if (channelId || !channelName.empty()){ if ((channel_id == channelId) && (channel_name == channelName)) need_init = false; @@ -425,16 +446,16 @@ void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::st int dummy; - has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &dummy, &dummy); + has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, image, &dummy, &dummy); if (!has_logo)//no logo was found, use altrenate icon or logo - pic_name = alt_pic_name; + image = alt_pic_name; //if logo or alternate image still not available, set has logo to false - has_logo = !pic_name.empty(); + has_logo = !image.empty(); //refresh object - initCCItem(); + setPicture(image); //set has_logo to false if no dimensions were detected if (width && height) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 0781b446e..7bf8953d0 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -162,6 +162,11 @@ class CComponentsPicture : public CComponentsItem ///set height of object and image related to current screen size, see also CComponentsItem::setHeightP(), parameter as uint8_t virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; need_init = hasChanges(); initCCItem();} + ///set screen x-position, parameter as int + virtual void setXPos(const int& xpos); + ///set screen y-position, parameter as int + virtual void setYPos(const int& ypos); + ///return paint mode of internal image, true=image was painted, please do not to confuse with isPainted()! isPainted() is related to item itself. virtual inline bool isPicPainted(){return is_image_painted;}; diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index a7b7e13ca..ab6523840 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -64,7 +64,7 @@ void CComponentsTimer::runSharedTimerAction() tm_mutex.lock(); OnTimer(); if (!tm_enable_nano) - mySleep(tm_interval); + sleep(tm_interval); else usleep((useconds_t)tm_interval); tm_mutex.unlock(); diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 2f7643331..c023742a7 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -41,6 +41,7 @@ typedef enum CC_ITEMTYPE_GENERIC, CC_ITEMTYPE_ITEM, CC_ITEMTYPE_PICTURE, + CC_ITEMTYPE_CHANNEL_LOGO, CC_ITEMTYPE_TEXT, CC_ITEMTYPE_TEXT_INFOBOX, CC_ITEMTYPE_SHAPE_SQUARE, diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 5f5fc5bff..169b9bffc 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -803,6 +803,8 @@ void EpgPlus::init() this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); + if (this->usableScreenX < DETAILSLINE_WIDTH) + this->usableScreenX = DETAILSLINE_WIDTH; this->usableScreenY = getScreenStartY(this->usableScreenHeight); this->headerX = this->usableScreenX; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 670577ef6..f766d06d0 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -300,7 +300,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna // init right info_zone if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) - cc_infozone = new CComponentsText(x+width+10, y+theight, infozone_width-20, listmaxshow*fheight); + cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); int res = menu_return::RETURN_REPAINT; //printf("CEventList::exec: channel_id %llx\n", channel_id); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 323c671c2..083415c40 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2973,7 +2973,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) CFileList flist; if (readDir(dirname, &flist) == true) { - for (size_t i = 0; i < flist.size(); i++) + size_t count = flist.size(); + for (size_t i = 0; i < count; i++) { if (S_ISDIR(flist[i].Mode)) { if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) { @@ -2984,7 +2985,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLocalProgress(i, flist.size(), dirname ); + if (result) + OnLocalProgress(i, count, dirname ); } //result = true; } @@ -3223,6 +3225,9 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); + struct timeval t1, t2; + gettimeofday(&t1, NULL); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress); loadBox.enableShadow(); loadBox.paint(); @@ -3238,6 +3243,11 @@ void CMovieBrowser::loadMovies(bool doRefresh) } m_file_info_stale = false; + gettimeofday(&t2, NULL); + uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL; + if (duration) + fprintf(stderr, "\033[33m[CMovieBrowser] %s: %" PRIu64 " ms to scan movies \033[0m\n",__func__, duration); + loadBox.hide(); if (doRefresh) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 92465e307..a8712fdc8 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -209,7 +209,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2}, {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EPG_DATE , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, - {LOCALE_FONTSIZE_EPGPLUS_ITEM , 18, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_EPGPLUS_ITEM , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EVENTLIST_TITLE , 30, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, diff --git a/src/system/settings.h b/src/system/settings.h index f85a5a1d8..6595c4206 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -996,7 +996,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define OFFSET_INNER_MIN CFrameBuffer::getInstance()->scale2Res(2) #define OFFSET_INNER_NONE 0 -#define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN +#define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16)