summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-01-06 16:10:11 +0100
committerlouis <louis.braun@gmx.de>2013-01-06 16:10:11 +0100
commit6afcc7d33240bbee646e4d6933902df90e3da63a (patch)
tree502de4e7555d3d81d4c7b6b530eb2d6b4a9c262a
parent387ab9fdff8c76cf9447277e5edca812dc453a9a (diff)
downloadskin-nopacity-6afcc7d33240bbee646e4d6933902df90e3da63a.tar.gz
skin-nopacity-6afcc7d33240bbee646e4d6933902df90e3da63a.tar.bz2
Radio icon for radio channels in DisplayChannel
-rw-r--r--displaychannel.c60
-rw-r--r--displaychannel.h2
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;