From 6afcc7d33240bbee646e4d6933902df90e3da63a Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 6 Jan 2013 16:10:11 +0100 Subject: Radio icon for radio channels in DisplayChannel --- displaychannel.c | 60 ++++++++++++++++++++++++++++++++++++-------------------- displaychannel.h | 2 ++ 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/displaychannel.c b/displaychannel.c index 08bbcea..01eeee9 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -19,6 +19,8 @@ cNopacityDisplayChannel::cNopacityDisplayChannel(bool WithInfo) { lastScreenWidth = 0; currentLast = 0; channelChange = false; + isRadioChannel = false; + radioIconDrawn = false; initial = true; FrameTime = config.channelFrameTime; FadeTime = config.channelFadeTime; @@ -172,6 +174,8 @@ void cNopacityDisplayChannel::DrawIcons(const cChannel *Channel) { int x = infoWidth - config.resolutionIconSize - 3*spacing; int y = 0; + isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0)))?true:false; + bool rec = cRecordControls::Active(); x -= bmRecording.Width() + spacing; y = (streamInfoHeight - bmRecording.Height()) / 2; @@ -216,29 +220,43 @@ void cNopacityDisplayChannel::DrawScreenResolution(void) { pixmapScreenResolution->SetAlpha(0); } - cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); - if (screenWidth != lastScreenWidth) { - cImageLoader imgLoader; - cString iconName(""); - switch (screenWidth) { - case 1920: - case 1440: - iconName = "hd1080i"; - break; - case 1280: - iconName = "hd720p"; - break; - case 720: - iconName = "sd576i"; - break; - default: - iconName = "sd576i"; - break; + cImageLoader imgLoader; + if (isRadioChannel) { + if (!radioIconDrawn) { + if (imgLoader.LoadIcon("radio", config.resolutionIconSize)) { + pixmapScreenResolution->DrawImage(cPoint(0,0), imgLoader.GetImage()); + } + lastScreenWidth = 0; + radioIconDrawn = true; } - if (imgLoader.LoadIcon(*iconName, config.resolutionIconSize)) { - pixmapScreenResolution->DrawImage(cPoint(0,0), imgLoader.GetImage()); + } else { + cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); + if (screenWidth != lastScreenWidth) { + cString iconName(""); + switch (screenWidth) { + case 1920: + case 1440: + iconName = "hd1080i"; + break; + case 1280: + if (screenHeight == 720) + iconName = "hd720p"; + else + iconName = "hd1080i"; + break; + case 720: + iconName = "sd576i"; + break; + default: + iconName = "sd576i"; + break; + } + if (imgLoader.LoadIcon(*iconName, config.resolutionIconSize)) { + pixmapScreenResolution->DrawImage(cPoint(0,0), imgLoader.GetImage()); + } + lastScreenWidth = screenWidth; + radioIconDrawn = false; } - lastScreenWidth = screenWidth; } } diff --git a/displaychannel.h b/displaychannel.h index 2854888..c228d70 100644 --- a/displaychannel.h +++ b/displaychannel.h @@ -9,6 +9,8 @@ private: bool initial; bool groupSep; bool channelChange; + bool isRadioChannel; + bool radioIconDrawn; cString lastDate; int lastSeen; time_t lastSignalDisplay; -- cgit v1.2.3