diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 347c781f7..5c6ee43dd 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -465,7 +465,8 @@ int CChannelList::show() new_mode_active = 0; pipzap = 0; - width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * 15):(frameBuffer->getScreenWidth() / 20 * 14)), 0); + int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); + width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 0); height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b4ed2d3ac..7d29d61cf 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -121,9 +121,6 @@ CEpgData::CEpgData() frameBuffer = CFrameBuffer::getInstance(); } -#define MAX_W 540 -#define MAX_H 320 - void CEpgData::start() { /* if you want usably sized epg windows, compile with "-DUSE_SPACE_EFFICIENTLY" */ diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 46ddff1af..eea591169 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -172,6 +172,13 @@ void CInfoViewer::Init() if(icon_small_width == 0) icon_small_width = 16; + frameBuffer->getIconSize(NEUTRINO_ICON_RESOLUTION_000, &icon_xres_width, &dummy_h); + if(icon_xres_width == 0) + icon_xres_width = 28; + + frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED2_GREY, &icon_crypt_width, &dummy_h); + if(icon_crypt_width == 0) + icon_crypt_width = 24; } /* @@ -272,6 +279,8 @@ void CInfoViewer::paintTime (bool show_dot, bool firstPaint) return; // int ChanNameY = BoxStartY + (ChanHeight >> 1) + 5; //oberkante schatten? + if (is_visible && showButtonBar) + showIcon_Resolution(); char timestr[10]; struct timeb tm; @@ -586,6 +595,7 @@ fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_set showIcon_16_9 (); showIcon_VTXT (); showIcon_SubT(); + showIcon_Resolution(); } if (fileplay) { @@ -904,8 +914,13 @@ void CInfoViewer::showSubchan () void CInfoViewer::showIcon_16_9 () { - if ((aspectRatio == 0) || (aspectRatio != videoDecoder->getAspectRatio())) { - aspectRatio = videoDecoder->getAspectRatio(); + if ((aspectRatio == 0) || ( g_RemoteControl->current_PIDs.PIDs.vpid == 0 ) || (aspectRatio != videoDecoder->getAspectRatio())) { + if ( g_RemoteControl->current_PIDs.PIDs.vpid > 0 ){ + aspectRatio = videoDecoder->getAspectRatio(); + } + else{ + aspectRatio = 0; + } frameBuffer->paintIcon((aspectRatio > 2) ? NEUTRINO_ICON_16_9 : NEUTRINO_ICON_16_9_GREY, BoxEndX - (2*icon_large_width + 2*icon_small_width + 4*2), BBarY, InfoHeightY_Info); @@ -918,6 +933,55 @@ void CInfoViewer::showIcon_VTXT () const BoxEndX - (2*icon_small_width + 2*2), BBarY, InfoHeightY_Info); } +void CInfoViewer::showIcon_Resolution() const +{ + int xres, yres, framerate; + const char *icon_name = NULL; + if(videoDecoder->getBlank()){ + icon_name = NEUTRINO_ICON_RESOLUTION_000; + } + else{ + videoDecoder->getPictureInfo(xres, yres, framerate); + switch(xres){ + case 1920: + icon_name = NEUTRINO_ICON_RESOLUTION_1920; + break; + case 1440: + icon_name = NEUTRINO_ICON_RESOLUTION_1440; + break; + case 1280: + icon_name = NEUTRINO_ICON_RESOLUTION_1280; + break; + case 720: + icon_name = NEUTRINO_ICON_RESOLUTION_720; + break; + case 704: + icon_name = NEUTRINO_ICON_RESOLUTION_704; + break; + case 544: + icon_name = NEUTRINO_ICON_RESOLUTION_544; + break; + case 528: + icon_name = NEUTRINO_ICON_RESOLUTION_528; + break; + case 480: + icon_name = NEUTRINO_ICON_RESOLUTION_480; + break; + case 382: + icon_name = NEUTRINO_ICON_RESOLUTION_382; + break; + case 352: + icon_name = NEUTRINO_ICON_RESOLUTION_352; + break; + default: + icon_name = NEUTRINO_ICON_RESOLUTION_000; + break; + } + } + + frameBuffer->paintBoxRel(BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, icon_large_width, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); + frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, InfoHeightY_Info); +} void CInfoViewer::showIcon_SubT() const { bool have_sub = false; @@ -966,6 +1030,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) showIcon_VTXT (); showIcon_SubT(); showIcon_CA_Status (0); + showIcon_Resolution(); } } return messages_return::handled; @@ -1186,7 +1251,7 @@ void CInfoViewer::showSNR () /* center the scales in the button bar. BBarY + InfoHeightY_Info / 2 is middle, scales are 6 pixels high, icons are 16 pixels, so keep 4 pixels free between the scales */ - varscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 2:3)*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?4:5)*2) - 102, + varscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - 102, BBarY + InfoHeightY_Info / 2 - 2 - 6, 100, 6, per, 100); per = 0; //HD info @@ -1209,7 +1274,7 @@ void CInfoViewer::showSNR () } } - hddscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 2:3)*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?4:5)*2) - 102, + hddscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - 102, BBarY + InfoHeightY_Info / 2 + 2, 100, 6, per, 100); } } @@ -1867,7 +1932,7 @@ void CInfoViewer::paint_ca_icons(int caid, char * icon, int &icon_space_offset) void CInfoViewer::showOne_CAIcon(bool fta) { - frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (3*icon_large_width + 2*icon_small_width + 5*2), BBarY, + frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (icon_xres_width + icon_crypt_width + 2*icon_large_width + 2*icon_small_width + 6*2), BBarY, InfoHeightY_Info); } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 93eaf30c7..97a2660db 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -81,7 +81,7 @@ class CInfoViewer int asize; int icol_w, icol_h; - int icon_large_width, icon_small_width; + int icon_large_width, icon_small_width, icon_xres_width, icon_crypt_width; CSectionsdClient::CurrentNextInfo info_CurrentNext; t_channel_id channel_id; @@ -120,7 +120,8 @@ class CInfoViewer void showIcon_VTXT() const; void showRecordIcon(const bool show); void showIcon_SubT() const; - + void showIcon_Resolution() const; + void showFailure(); void showMotorMoving(int duration); void showLcdPercentOver(); diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 72245262e..d92e1e99e 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -448,7 +448,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) { char buf[100]; //, buf2[100]; - int xres, yres, aspectRatio, framerate; + int xres = 0, yres = 0, aspectRatio = 0, framerate; // paint labels int spaceoffset = 0,i = 0; int array[5]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), @@ -462,9 +462,10 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) spaceoffset = array[i]; } average_bitrate_offset = spaceoffset+=4; - - videoDecoder->getPictureInfo(xres, yres, framerate); - aspectRatio = videoDecoder->getAspectRatio(); + if(!(videoDecoder->getBlank())){ + videoDecoder->getPictureInfo(xres, yres, framerate); + aspectRatio = videoDecoder->getAspectRatio(); + } //Video RESOLUTION ypos += iheight; sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)); @@ -483,6 +484,9 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); g_Font[font_info]->RenderString (xpos, ypos, width*2/3 - 10, buf, COL_MENUCONTENTDARK, 0, true); // UTF-8 switch (aspectRatio) { + case 0: + sprintf ((char *) buf, "N/A"); + break; case 1: sprintf ((char *) buf, "4:3"); break; diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 9bed3f520..7e240024b 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -119,6 +119,17 @@ #define NEUTRINO_ICON_NETWORK "network" #define NEUTRINO_ICON_LCD "lcd" #define NEUTRINO_ICON_VOLUME "volume" +#define NEUTRINO_ICON_RESOLUTION_1920 "res_1920" +#define NEUTRINO_ICON_RESOLUTION_1440 "res_1440" +#define NEUTRINO_ICON_RESOLUTION_1280 "res_1280" +#define NEUTRINO_ICON_RESOLUTION_720 "res_720" +#define NEUTRINO_ICON_RESOLUTION_704 "res_704" +#define NEUTRINO_ICON_RESOLUTION_544 "res_544" +#define NEUTRINO_ICON_RESOLUTION_528 "res_528" +#define NEUTRINO_ICON_RESOLUTION_480 "res_480" +#define NEUTRINO_ICON_RESOLUTION_382 "res_382" +#define NEUTRINO_ICON_RESOLUTION_352 "res_352" +#define NEUTRINO_ICON_RESOLUTION_000 "res_000" #define DUMMY_ICON "dummy"