diff options
-rw-r--r-- | displaychannelview.c | 35 | ||||
-rw-r--r-- | displaychannelview.h | 1 | ||||
-rw-r--r-- | displayreplay.c | 26 | ||||
-rw-r--r-- | helpers.c | 30 | ||||
-rw-r--r-- | helpers.h | 1 |
5 files changed, 37 insertions, 56 deletions
diff --git a/displaychannelview.c b/displaychannelview.c index 6f7ce3c..aa3f13a 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -531,44 +531,15 @@ void cNopacityDisplayChannelView::DrawScreenResolution(void) { } else { resolutionIcon = GetScreenResolutionIcon(); } + if (strcasecmp(resolutionIcon, "") == 0) + return; int iconX = 5 * (statusIconBorder + statusIconSize); - cImage *imgRes = imgCache->GetSkinIcon(*resolutionIcon, 3*statusIconSize, statusIconSize); + cImage *imgRes = imgCache->GetSkinIcon(*resolutionIcon, 3 * statusIconSize, statusIconSize); if (imgRes) pixmapStatusIcons->DrawImage(cPoint(iconX,statusIconBorder), *imgRes); } -cString cNopacityDisplayChannelView::GetScreenResolutionIcon(void) { - int screenWidth = 0; - int screenHeight = 0; - double aspect = 0; - cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); - cString iconName(""); - switch (screenWidth) { - case 7680: // 7680 x 4320 = 8K UHD - case 3840: // 3840 x 2160 = 4K UHD - iconName = "skinIcons/uhd4k"; - break; - case 1920: - case 1440: - iconName = "skinIcons/hd1080i"; - break; - case 1280: - if (screenHeight == 720) - iconName = "skinIcons/hd720p"; - else - iconName = "skinIcons/hd1080i"; - break; - case 720: - iconName = "skinIcons/sd576i"; - break; - default: - iconName = "skinIcons/sd576i"; - break; - } - return iconName; -} - void cNopacityDisplayChannelView::ClearStatusIcons(void) { pixmapStatusIcons->Fill(clrTransparent); pixmapStatusIconsBackground->Fill(clrTransparent); diff --git a/displaychannelview.h b/displaychannelview.h index ca21ae5..cbbfc64 100644 --- a/displaychannelview.h +++ b/displaychannelview.h @@ -34,7 +34,6 @@ private: cPixmap *pixmapPoster; cNopacityMessageBox *messageBox; tColor DrawProgressbarProgress(int left, int top, int width, int height); - cString GetScreenResolutionIcon(void); std::string GetChannelSep(const cChannel *channel, bool prev); void CreatePixmaps(void); void DrawBackground(void); diff --git a/displayreplay.c b/displayreplay.c index 913ec78..644ce2a 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -273,29 +273,9 @@ void cNopacityDisplayReplay::DrawScreenResolution(void) { int screenHeight = 0; double aspect = 0; cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); - cString iconName(""); - switch (screenWidth) { - case 7680: // 7680 x 4320 = 8K UHD - case 3840: // 3840 x 2160 = 4K UHD - iconName = "skinIcons/uhd4k"; - break; - case 1920: - case 1440: - iconName = "skinIcons/hd1080i_rec"; - break; - case 1280: - if (screenHeight == 720) - iconName = "skinIcons/hd720p_rec"; - else - iconName = "skinIcons/hd1080i_rec"; - break; - case 720: - iconName = "skinIcons/sd576i_rec"; - break; - default: - iconName = "skinIcons/sd576i_rec"; - break; - } + cString iconName = GetScreenResolutionIcon(); + if (strcasecmp(iconName, "") == 0) + return; int replaySize = geoManager->replayResolutionSize; cImage *imgRes = imgCache->GetSkinIcon(*iconName, 3 * replaySize, replaySize); if (imgRes) { @@ -168,3 +168,33 @@ cPlugin *GetScraperPlugin(void) { pScraper = cPluginManager::GetPlugin("tvscraper"); return pScraper; } + +cString GetScreenResolutionIcon(void) { + int screenWidth = 0; + int screenHeight = 0; + double aspect = 0; + cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); + cString iconName(""); + switch (screenHeight) { + case 4320: // 7680 x 4320 = 8K UHD + case 2160: // 3840 x 2160 = 4K UHD + iconName = "skinIcons/uhd4k"; + break; + case 1440: // 2560 x 1440 = QHD + case 1080: // "hd1080i"; // 'i' is default, 'p' can't be detected currently + iconName = "skinIcons/hd1080i"; + break; + case 720: // "hd720p"; // 'i' is not defined in standards + iconName = "skinIcons/hd720p"; + break; + case 576: // "sd576i"; // assumed 'i' + iconName = "skinIcons/sd576i"; + break; + case 480: // "sd480i"; // assumed 'i' + iconName = "skinIcons/sd576i"; + break; + default: + break; + } + return iconName; +} @@ -12,6 +12,7 @@ cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heightOrigi int Minimum(int a, int b, int c, int d, int e, int f); std::string CutText(std::string text, int width, const cFont *font); std::string StrToLowerCase(std::string str); +cString GetScreenResolutionIcon(void); class splitstring : public std::string { std::vector<std::string> flds; |