From f7cea75f37baca88c64bd72e7ca795146272e9db Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:07 +0200 Subject: [PATCH] CStreamInfo2: Add new info items - Videosystem - OSD Resolution --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/streaminfo2.cpp | 33 +++++++++++++++++++++++++++++---- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 259a43e6a..db95f8756 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Bildrate streaminfo.framerate_unknown unbekannt streaminfo.head Tech. Information streaminfo.not_available nicht verfügbar +streaminfo.osd_resolution OSD Auflösung streaminfo.resolution Auflösung streaminfo.signal Empfangssignal +streaminfo.videosystem Videosystem streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. diff --git a/data/locale/english.locale b/data/locale/english.locale index 9bc1b4031..d203308bf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Framerate streaminfo.framerate_unknown unknown streaminfo.head Stream-Information streaminfo.not_available not available +streaminfo.osd_resolution OSD Resolution streaminfo.resolution Resolution streaminfo.signal Receipt signal +streaminfo.videosystem Videosystem streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart GUI. streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. streaming.overflow Record buffer overflow, consider to stop some records diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d99ab6818..b799c4c3f 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -527,18 +527,20 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) if(!channel) return; - int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + int array[]= {g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))}; - for(i=0 ; i<6; i++) { + for(i=0 ; i<(int)(sizeof(array)/sizeof(array[0])); i++) { if(spaceoffset < array[i]) spaceoffset = array[i]; } - spaceoffset += g_Font[font_info]->getRenderWidth(" "); + spaceoffset += g_Font[font_info]->getRenderWidth(" "); average_bitrate_offset = spaceoffset; int box_width2 = box_width-(spaceoffset+xpos); @@ -557,7 +559,30 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%dx%d", xres, yres); g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); - //audio rate +#if HAVE_COOL_HARDWARE + //Video SYSTEM + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + cs_vs_format_t vsfn; + videoDecoder->GetVideoSystemFormatName(&vsfn); +#ifdef BOXMODEL_CS_HD1 + snprintf(buf, sizeof(buf), "HDMI: %s%s", vsfn.format, +#else + snprintf(buf, sizeof(buf), "HDMI: %s, Scart/Cinch: %s%s", vsfn.formatHD, vsfn.formatSD, +#endif + (g_settings.video_Mode == VIDEO_STD_AUTO)?" (AUTO)":""); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); +#endif + + //OSD RESOLUTION + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + snprintf(buf, sizeof(buf), "%dx%d", frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); + + //Aspect Ratio ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); diff --git a/src/system/locals.h b/src/system/locals.h index 024bb955b..05310ce1b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2346,8 +2346,10 @@ typedef enum LOCALE_STREAMINFO_FRAMERATE_UNKNOWN, LOCALE_STREAMINFO_HEAD, LOCALE_STREAMINFO_NOT_AVAILABLE, + LOCALE_STREAMINFO_OSD_RESOLUTION, LOCALE_STREAMINFO_RESOLUTION, LOCALE_STREAMINFO_SIGNAL, + LOCALE_STREAMINFO_VIDEOSYSTEM, LOCALE_STREAMING_BUSY, LOCALE_STREAMING_DIR_NOT_WRITABLE, LOCALE_STREAMING_OVERFLOW, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3fdeaa47a..143579cbb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2346,8 +2346,10 @@ const char * locale_real_names[] = "streaminfo.framerate_unknown", "streaminfo.head", "streaminfo.not_available", + "streaminfo.osd_resolution", "streaminfo.resolution", "streaminfo.signal", + "streaminfo.videosystem", "streaming.busy", "streaming.dir_not_writable", "streaming.overflow",