summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY13
-rw-r--r--baserender.c4
-rw-r--r--baserender.h1
-rw-r--r--config.c3
-rw-r--r--config.h2
-rw-r--r--displaychannel.c103
-rw-r--r--displaychannel.h9
-rw-r--r--displaymenu.c2
-rw-r--r--icons/COPYRIGHT5
-rw-r--r--po/de_DE.po5
-rw-r--r--setup.c2
11 files changed, 119 insertions, 30 deletions
diff --git a/HISTORY b/HISTORY
index cc5e93dd..f6284c75 100644
--- a/HISTORY
+++ b/HISTORY
@@ -5,12 +5,15 @@ VDR Plugin 'skinflatplus' Revision History
- [fix] marker position
- [fix] borders displaced
- [fix] menu has full width if no scrollbar is needed
+- [fix] small fixes in channel display
- [update] TopBar title align right
-- [add] add free minutes in disk usage
-- [add] add topbar font size option
-- [add] add message bottom offset option
-- [add] add menu items symbols for rec, timer, etc. Lent code from skin elchi (thank you!)
-- [add] add option menu content full size background
+- [add] free minutes in disk usage
+- [add] topbar font size option
+- [add] message bottom offset option
+- [add] menu items symbols for rec, timer, etc. Lent code from skin elchi (thank you!)
+- [add] option menu content full size background
+- [add] option to display resolution & aspect
+- [add] default logo for channels without channel logo
2013-23-09: Version 0.0.1
difference to skinflat
diff --git a/baserender.c b/baserender.c
index 4db52d62..72714aa1 100644
--- a/baserender.c
+++ b/baserender.c
@@ -474,6 +474,10 @@ void cFlatBaseRender::ProgressBarDraw(int Current, int Total) {
Current, Total, progressBarColorFg, progressBarColorBarFg, progressBarColorBg, ProgressType);
}
+void cFlatBaseRender::ProgressBarDrawBgColor(void) {
+ progressBarPixmapBg->Fill(progressBarColorBg);
+}
+
void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRect rect, cRect rectBg, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type) {
int Middle = rect.Height()/2;
diff --git a/baserender.h b/baserender.h
index d50bd24c..63ca3283 100644
--- a/baserender.h
+++ b/baserender.h
@@ -128,6 +128,7 @@ class cFlatBaseRender
void ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRect rec, cRect recBg, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type);
void ProgressBarCreate(int Left, int Top, int Width, int Height, int MarginHor, int MarginVer, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type);
+ void ProgressBarDrawBgColor(void);
void ProgressBarDraw(int Current, int Total);
void ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent);
diff --git a/config.c b/config.c
index 947c5b67..e95e922a 100644
--- a/config.c
+++ b/config.c
@@ -13,6 +13,8 @@ cFlatConfig::cFlatConfig(void) {
MenuContentFullSize = true;
+ ResolutionAspectShow = false;
+
MenuItemPadding = 5;
marginOsdVer = 5;
marginOsdHor = 5;
@@ -142,6 +144,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "MessageOffset") == 0) MessageOffset = atoi(Value);
else if (strcmp(Name, "TopBarFontSize") == 0) TopBarFontSize = atod(Value);
else if (strcmp(Name, "MenuContentFullSize") == 0) MenuContentFullSize = atoi(Value);
+ else if (strcmp(Name, "ResolutionAspectShow") == 0) ResolutionAspectShow = atoi(Value);
else return false;
return true;
}
diff --git a/config.h b/config.h
index 9b4dd375..52f92705 100644
--- a/config.h
+++ b/config.h
@@ -154,4 +154,6 @@ class cFlatConfig
int MenuContentFullSize;
double TopBarFontSize;
+
+ int ResolutionAspectShow;
};
diff --git a/displaychannel.c b/displaychannel.c
index 6c09d6a9..c6eb9d7e 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -8,7 +8,11 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) {
chanLogoPixmap = NULL;
chanIconsPixmap = NULL;
- screenWidth = lastScreenWidth = 0;
+ isGroup = false;
+ isRecording = false,
+ isRadioChannel = false;
+
+ screenWidth = lastScreenWidth = -1;
CreateFullOsd();
if ( !osd )
@@ -21,6 +25,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) {
// von unten noch oben
// 2*EPG + 2*EPGsml
heightBottom = (fontHeight*2) + (fontSmlHeight*2) + marginItem; // Top, Buttom, Between
+ heightImageLogo = heightBottom;
if( Config.SignalQualityShow )
heightBottom += max(fontSmlHeight, Config.decorProgressSignalSize) + marginItem;
else if( Config.ChannelIconsShow )
@@ -31,25 +36,27 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) {
int height = heightBottom;
chanInfoBottomPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderChannelSize,
Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightBottom));
- chanInfoBottomPixmap->Fill(clrTransparent);
+ chanInfoBottomPixmap->Fill( Theme.Color(clrChannelBg) );
chanIconsPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderChannelSize,
Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightBottom));
- chanIconsPixmap->Fill(clrTransparent);
+ chanIconsPixmap->Fill( clrTransparent );
chanLogoPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderChannelSize,
Config.decorBorderChannelSize+channelHeight - height, heightBottom, heightBottom));
- chanLogoPixmap->Fill(clrTransparent);
+ chanLogoPixmap->Fill( clrTransparent );
height += Config.decorProgressChannelSize + marginItem*2;
ProgressBarCreate(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height + marginItem,
channelWidth, Config.decorProgressChannelSize, marginItem, 0,
Config.decorProgressChannelFg, Config.decorProgressChannelBarFg, Config.decorProgressChannelBg, Config.decorProgressChannelType);
+ ProgressBarDrawBgColor();
+
height += heightTop;
chanInfoTopPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderChannelSize,
Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightTop));
- chanInfoTopPixmap->Fill(clrTransparent);
+ chanInfoTopPixmap->Fill( clrTransparent );
DecorBorderDraw(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height,
channelWidth, heightTop + heightBottom + Config.decorProgressChannelSize+marginItem*2,
@@ -72,8 +79,13 @@ cFlatDisplayChannel::~cFlatDisplayChannel() {
void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
cString channelNumber("");
isRecording = false;
- chanIconsPixmap->Fill(clrTransparent);
+ chanIconsPixmap->Fill( clrTransparent );
+ lastScreenWidth = -1;
+
if (Channel) {
+ isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false;
+ isGroup = Channel->GroupSep();
+
channelName = Channel->Name();
if (!Channel->GroupSep())
channelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : "");
@@ -88,11 +100,33 @@ void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
chanInfoTopPixmap->Fill(Theme.Color(clrChannelBg));
chanInfoTopPixmap->DrawText(cPoint(50, 0), channelString, Theme.Color(clrChannelFontTitle), Theme.Color(clrChannelBg), font);
+
+ int imageHeight = heightImageLogo - marginItem*2;
+ int imageLeft = marginItem*2;
+ int imageTop = marginItem;
+ if( imgLoader.LoadLogo(*channelName, imageHeight, imageHeight) ) {
+
+ chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ } else if( !isGroup ) { // draw default logo
+ if( isRadioChannel ) {
+ if( imgLoader.LoadIcon("radio", imageHeight, imageHeight) ) {
+ chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ }
+ } else {
+ if( imgLoader.LoadIcon("tv", imageHeight, imageHeight) ) {
+ chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ }
+ }
+ }
}
void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolution) {
- if( !Resolution )
- chanIconsPixmap->Fill(clrTransparent);
+ if( !Resolution ) {
+ chanIconsPixmap->Fill( clrTransparent );
+ printf("no resolution\n");
+ } else
+ printf("resolution width: %d\n", screenWidth);
+
int width = fontSmlHeight;
int top = fontHeight*2 + fontSmlHeight*2 + marginItem;
@@ -140,6 +174,10 @@ void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolut
left -= marginItem + width;
if( Resolution ) {
+ chanIconsPixmap->DrawRectangle(cRect(0, top, left, height), clrTransparent);
+ }
+
+ if( Resolution && !isRadioChannel && screenWidth > 0 ) {
cString iconName("");
switch (screenWidth) {
case 1920:
@@ -158,8 +196,25 @@ void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolut
int imageTop = top + (height - imgLoader.Height())/2;
//chanIconsPixmap->DrawRectangle(cRect(left, 0, imgLoader.Height(), height), Theme.Color(clrChannelBg));
chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage());
+ left -= marginItem*2 ;
}
}
+ if( Config.ResolutionAspectShow && Resolution && !isRadioChannel && screenWidth > 0 ) {
+ cString asp = "";
+ if( screenAspect == 4.0/3.0 )
+ asp = "4/3";
+ else if( screenAspect == 16.0/9.0 )
+ asp = "16/9";
+ else if( screenAspect == 2.21 )
+ asp = "2.21/1";
+ cString resasp = cString::sprintf("%dx%d %s", screenWidth, screenHeight, *asp);
+ int w = fontSml->Width(*resasp);
+ left -= w;
+ chanIconsPixmap->DrawText(cPoint(left, top), *resasp,
+ Theme.Color(clrChannelFontEpg), clrTransparent, fontSml);
+
+ left -= marginItem + width;
+ }
}
void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) {
@@ -168,17 +223,26 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi
cString epg("");
chanInfoBottomPixmap->Fill(Theme.Color(clrChannelBg));
- chanLogoPixmap->Fill(clrTransparent);
- chanIconsPixmap->Fill(clrTransparent);
+ chanIconsPixmap->Fill( clrTransparent );
- int imageHeight = heightBottom - marginItem*2;
+/* chanLogoPixmap->Fill(clrTransparent);
+ int imageHeight = heightImageLogo - marginItem*2;
+ int imageLeft = marginItem;
+ int imageTop = marginItem;
if( imgLoader.LoadLogo(*channelName, imageHeight, imageHeight) ) {
- int imageLeft = marginItem;
- int imageTop = (heightBottom - imgLoader.Height() ) / 2;
-
chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ } else { // draw default logo
+ if( isRadioChannel ) {
+ if( imgLoader.LoadIcon("radio", imageHeight, imageHeight) ) {
+ chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ }
+ } else {
+ if( imgLoader.LoadIcon("tv", imageHeight, imageHeight) ) {
+ chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() );
+ }
+ }
}
-
+*/
int left = heightBottom + marginItem;
if( Present ) {
@@ -264,8 +328,9 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi
chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight*2 + fontSmlHeight), *epgShort,
Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), fontSml);
}
- if( Config.ChannelIconsShow && CurChannel )
+ if( Config.ChannelIconsShow && CurChannel ) {
ChannelIconsDraw(CurChannel, false);
+ }
}
void cFlatDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
@@ -320,12 +385,10 @@ void cFlatDisplayChannel::Flush(void) {
SignalQualityDraw();
if( Config.ChannelIconsShow ) {
- int screenHeight;
- double aspect;
- cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect);
+ cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, screenAspect);
if (screenWidth != lastScreenWidth) {
+ lastScreenWidth = screenWidth;
ChannelIconsDraw(CurChannel, true);
- screenWidth = lastScreenWidth;
}
}
TopBarUpdate();
diff --git a/displaychannel.h b/displaychannel.h
index 24374ebe..5071f96a 100644
--- a/displaychannel.h
+++ b/displaychannel.h
@@ -7,7 +7,7 @@ class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel {
const cEvent *present;
int channelWidth, channelHeight;
-
+
cString channelName;
const cChannel *CurChannel;
@@ -17,9 +17,14 @@ class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel {
cPixmap *chanIconsPixmap;
int screenWidth, lastScreenWidth;
- int heightBottom;
+ int screenHeight;
+ double screenAspect;
+ int heightBottom, heightImageLogo;
bool isRecording;
+ bool isRadioChannel;
+ bool isGroup;
+
void SignalQualityDraw(void);
void ChannelIconsDraw(const cChannel *Channel, bool Resolution);
diff --git a/displaymenu.c b/displaymenu.c
index cda91096..1e158ea9 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -124,9 +124,9 @@ void cFlatDisplayMenu::Clear(void) {
scrollbarPixmap->Fill(clrTransparent);
contentHeadPixmap->Fill(clrTransparent);
ContentClear();
+ DecorBorderClearByFrom(BorderMenuItem);
DecorBorderClearAll();
isScrolling = false;
- // DecorBorderClearByFrom( BorderMenuItem );
}
void cFlatDisplayMenu::SetTitle(const char *Title) {
diff --git a/icons/COPYRIGHT b/icons/COPYRIGHT
index 68f502d3..420e8a1d 100644
--- a/icons/COPYRIGHT
+++ b/icons/COPYRIGHT
@@ -11,4 +11,7 @@ Creative Commons Attribution
http://findicons.com/pack/949/token
iconsweet2
-http://www.iconsweets2.com/ \ No newline at end of file
+http://www.iconsweets2.com/
+
+Default Radio, TV, Data
+http://icons8.com/download-huge-windows8-set/ \ No newline at end of file
diff --git a/po/de_DE.po b/po/de_DE.po
index c8a89333..da1970e5 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinflat 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-11-16 23:29+0100\n"
+"POT-Creation-Date: 2013-11-17 16:20+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -147,6 +147,9 @@ msgstr "Zeige Kanalinfo Icons"
msgid "Show signal quality"
msgstr "Zeige Signalqualität"
+msgid "Show resolution & aspect"
+msgstr "Zeige Auflösung & Aspect"
+
msgid "Channelinfo border by theme?"
msgstr "Kanalinfo Rand vom Theme?"
diff --git a/setup.c b/setup.c
index ece4c02b..cc687d57 100644
--- a/setup.c
+++ b/setup.c
@@ -134,6 +134,7 @@ void cFlatSetup::Store(void) {
SetupStore("TopBarFontSize", dtoa(Config.TopBarFontSize));
SetupStore("MessageOffset", Config.MessageOffset);
SetupStore("MenuContentFullSize", Config.MenuContentFullSize);
+ SetupStore("ResolutionAspectShow", Config.ResolutionAspectShow);
Config.Init();
}
@@ -242,6 +243,7 @@ void cFlatSetupChannelInfo::Setup(void) {
Add(new cMenuEditBoolItem(tr("Show Channelinfo icons"), &SetupConfig->ChannelIconsShow));
Add(new cMenuEditBoolItem(tr("Show signal quality"), &SetupConfig->SignalQualityShow));
+ Add(new cMenuEditBoolItem(tr("Show resolution & aspect"), &SetupConfig->ResolutionAspectShow));
Add(new cMenuEditBoolItem(tr("Channelinfo border by theme?"), &SetupConfig->decorBorderChannelByTheme));
if( SetupConfig->decorBorderChannelByTheme ) {