From 13c8a1642a327cb562bb1d8fdb00c54eff48d365 Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 26 Dec 2010 11:38:45 +0000 Subject: [PATCH] neutrino: add setting for a simple resolution display this enables the "simple" display that only shows "SD" and "HD" (This originated on the dbox2world forum, I'm not sure who the original author was). git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@968 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/icons/Makefile.am | 1 + data/icons/res_hd.png | Bin 0 -> 207 bytes data/icons/res_sd.png | Bin 0 -> 215 bytes data/locale/deutsch.locale | 2 + data/locale/english.locale | 2 + src/gui/infoviewer.cpp | 135 +++++++++++++++++++++++-------------- src/gui/osd_setup.cpp | 9 +++ src/gui/widget/icons.h | 3 + src/neutrino.cpp | 2 + src/system/locals.h | 2 + src/system/locals_intern.h | 2 + src/system/settings.h | 1 + 12 files changed, 110 insertions(+), 49 deletions(-) create mode 100644 data/icons/res_hd.png create mode 100644 data/icons/res_sd.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 5512fe37f..6466de908 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -21,6 +21,7 @@ install_DATA = \ radar5.raw radar6.raw radar7.raw radar8.raw radar9.raw movieplayer.raw rec.png recording.png \ res_1920.png res_1280.png res_1440.png res_1080.png res_720.png res_704.png res_576.png \ res_528.png res_544.png res_480.png res_382.png res_352.png res_288.png res_000.png \ + res_hd.png res_sd.png \ settings.png shell.png softupdate.png streaming.png \ subt.png subt_gray.png timer.png video.png \ volume.png volumebody.png volumeslider2.png volumeslider2alpha.png \ diff --git a/data/icons/res_hd.png b/data/icons/res_hd.png new file mode 100644 index 0000000000000000000000000000000000000000..6be2c48c7d82d1723e330cff4612362a5e3c9f82 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^GC(ZA$P6Uy8GF|NDaPU;cPEB*=VV?2IcxzwA+AZz z^@nF^@vmT;1d=WZ@(X5gcy=QV#7XjYcVXyYmGuB}I14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfEp8D3Nky5db!l= 2) + icon_xres_width = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED2_GREY, &icon_crypt_width, &dummy_h); if (icon_crypt_width == 0) icon_crypt_width = 24; @@ -988,58 +991,86 @@ void CInfoViewer::showIcon_Resolution() const const char *icon_name = NULL; if (videoDecoder->getBlank()) { icon_name = NEUTRINO_ICON_RESOLUTION_000; - } - else { - videoDecoder->getPictureInfo(xres, yres, framerate); - switch (yres) { - case 1920: - icon_name = NEUTRINO_ICON_RESOLUTION_1920; - break; - case 1088: - icon_name = NEUTRINO_ICON_RESOLUTION_1080; - 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 576: - icon_name = NEUTRINO_ICON_RESOLUTION_576; - 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; - case 288: - icon_name = NEUTRINO_ICON_RESOLUTION_288; - break; - default: - icon_name = NEUTRINO_ICON_RESOLUTION_000; - break; + } else { + if (g_settings.infobar_show_res == 0) {//show resolution icon on infobar + videoDecoder->getPictureInfo(xres, yres, framerate); + switch (yres) { + case 1920: + icon_name = NEUTRINO_ICON_RESOLUTION_1920; + break; + case 1088: + icon_name = NEUTRINO_ICON_RESOLUTION_1080; + 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 576: + icon_name = NEUTRINO_ICON_RESOLUTION_576; + 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; + case 288: + icon_name = NEUTRINO_ICON_RESOLUTION_288; + break; + default: + icon_name = NEUTRINO_ICON_RESOLUTION_000; + break; + } + } + if (g_settings.infobar_show_res == 1) {//show simple resolution icon on infobar + videoDecoder->getPictureInfo(xres, yres, framerate); + switch (yres) { + case 1920: + case 1440: + case 1280: + case 1088: + case 720: + icon_name = NEUTRINO_ICON_RESOLUTION_HD; + break; + case 704: + case 576: + case 544: + case 528: + case 480: + case 382: + case 352: + case 288: + icon_name = NEUTRINO_ICON_RESOLUTION_SD; + 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); + if (g_settings.infobar_show_res < 2) { + 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; @@ -1978,8 +2009,14 @@ void CInfoViewer::paint_ca_icons(int caid, char * icon, int &icon_space_offset) void CInfoViewer::showOne_CAIcon(bool fta) { +if (g_settings.infobar_show_res < 2){ 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); + } +else if (g_settings.infobar_show_res == 2){ + frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (icon_crypt_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, + InfoHeightY_Info); + } } void CInfoViewer::showIcon_CA_Status (int notfirst) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index fdbd301a0..fa7f7238d 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -220,6 +220,14 @@ const CMenuOptionChooser::keyval MENU_DISP_POS_OPTIONS[MENU_DISP_POS_OPTIONS_CO { 4 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT } }; +#define INFOBAR_SHOW_RES_MODE_OPTION_COUNT 3 +const CMenuOptionChooser::keyval INFOBAR_SHOW_RES_MODE_OPTIONS[INFOBAR_SHOW_RES_MODE_OPTION_COUNT] = +{ + { 0, LOCALE_OPTIONS_ON }, + { 1, LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES_SIMPLE }, + { 2, LOCALE_OPTIONS_OFF } +}; + //show osd setup void COsdSetup::showOsdSetup() @@ -522,6 +530,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_VIRTUAL_ZAP_MODE, &g_settings.virtual_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, &g_settings.infobar_show_var_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES, &g_settings.infobar_show_res, INFOBAR_SHOW_RES_MODE_OPTIONS, INFOBAR_SHOW_RES_MODE_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW, &g_settings.infobar_show, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); } diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index c35ddb591..229d368a8 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -137,6 +137,9 @@ #define NEUTRINO_ICON_RESOLUTION_352 "res_352" #define NEUTRINO_ICON_RESOLUTION_288 "res_288" #define NEUTRINO_ICON_RESOLUTION_000 "res_000" +#define NEUTRINO_ICON_RESOLUTION_HD "res_hd" +#define NEUTRINO_ICON_RESOLUTION_SD "res_sd" + #define DUMMY_ICON "dummy" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6b19174f3..eaba3359d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -484,6 +484,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.menu_pos = configfile.getInt32("menu_pos", 0 ); g_settings.infobar_show_var_hdd = configfile.getBool("infobar_show_var_hdd" , true ); g_settings.show_infomenu = configfile.getInt32("show_infomenu", 0 ); + g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); //audio g_settings.audio_AnalogMode = configfile.getInt32( "audio_AnalogMode", 0 ); g_settings.audio_DolbyDigital = configfile.getBool("audio_DolbyDigital" , false); @@ -1031,6 +1032,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("menu_pos" , g_settings.menu_pos); configfile.setInt32("infobar_show_var_hdd" , g_settings.infobar_show_var_hdd ); configfile.setInt32("show_infomenu" , g_settings.show_infomenu ); + configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); //audio configfile.setInt32( "audio_AnalogMode", g_settings.audio_AnalogMode ); diff --git a/src/system/locals.h b/src/system/locals.h index 3f45d1e3b..544bb12b1 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -574,6 +574,8 @@ typedef enum { LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, LOCALE_MISCSETTINGS_INFOBAR_SHOW, + LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES, + LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES_SIMPLE, LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, LOCALE_MISCSETTINGS_SHOW_INFOMENU, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index eeaf4fb02..e1626842f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -574,6 +574,8 @@ const char *locale_real_names[] = { "miscsettings.infobar_disp_log", "miscsettings.infobar_sat_display", "miscsettings.infobar_show", + "miscsettings.infobar_show_res", + "miscsettings.infobar_show_res_simple", "miscsettings.infobar_show_var_hdd", "miscsettings.show_infomenu", "miscsettings.shutdown_count", diff --git a/src/system/settings.h b/src/system/settings.h index b98be8733..4d995a39b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -73,6 +73,7 @@ struct SNeutrinoSettings int volume_pos; int menu_pos; int infobar_show_var_hdd; + int infobar_show_res; //audio int audio_AnalogMode; int audio_DolbyDigital;