summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-03-10 17:06:41 +0100
committerlouis <louis.braun@gmx.de>2013-03-10 17:06:41 +0100
commitf4e23b8daa1d959bbb9ef5a8d4253412a15ff013 (patch)
treeb190021a6361affedb5250cedfc4ab57470d1194
parent3d4c1d84b7cd2ca23e3fda446a30b55a1d4878d9 (diff)
downloadskin-nopacity-f4e23b8daa1d959bbb9ef5a8d4253412a15ff013.tar.gz
skin-nopacity-f4e23b8daa1d959bbb9ef5a8d4253412a15ff013.tar.bz2
Position of channel logos in channel display now configurable
-rw-r--r--HISTORY3
-rw-r--r--config.c2
-rw-r--r--config.h1
-rw-r--r--displaychannel.c53
-rw-r--r--displaychannel.h2
-rw-r--r--po/de_DE.po10
-rw-r--r--setup.c13
-rw-r--r--setup.h1
8 files changed, 67 insertions, 18 deletions
diff --git a/HISTORY b/HISTORY
index 137ee4b..9af5626 100644
--- a/HISTORY
+++ b/HISTORY
@@ -152,3 +152,6 @@ Version 0.0.7:
- Changed plugin icons filename for loading icons in main menu, plugin name
is now used
- Restructured Setup Menü
+- Position of channel logos in channel display now configurable. Possible
+ values are left (default), right and none. If value is set to none, the
+ comlete screen width is used for channel display.
diff --git a/config.c b/config.c
index 7d0c9dc..605ca93 100644
--- a/config.c
+++ b/config.c
@@ -13,6 +13,7 @@ cNopacityConfig::cNopacityConfig() {
channelBorderVertical = 15;
channelBorderBottom = 15;
channelFadeTime = 300; // ms
+ logoPosition = 1;
logoWidth = 260;
logoHeight = 200;
logoExtension = "png";
@@ -200,6 +201,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "channelHeight") == 0) channelHeight = atoi(Value);
else if (strcmp(Name, "channelBorderVertical") == 0) channelBorderVertical = atoi(Value);
else if (strcmp(Name, "channelBorderBottom") == 0) channelBorderBottom = atoi(Value);
+ else if (strcmp(Name, "logoPosition") == 0) logoPosition = atoi(Value);
else if (strcmp(Name, "logoWidth") == 0) logoWidth = atoi(Value);
else if (strcmp(Name, "logoHeight") == 0) logoHeight = atoi(Value);
else if (strcmp(Name, "logoBorder") == 0) logoBorder = atoi(Value);
diff --git a/config.h b/config.h
index 5c5b6eb..4c9cab0 100644
--- a/config.h
+++ b/config.h
@@ -32,6 +32,7 @@ class cNopacityConfig {
int channelBorderBottom;
int channelFadeTime;
int channelFrameTime;
+ int logoPosition;
int logoWidth;
int logoHeight;
int logoBorder;
diff --git a/displaychannel.c b/displaychannel.c
index eb050ca..c2b3226 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -67,8 +67,20 @@ void cNopacityDisplayChannel::SetGeometry(void) {
height = cOsd::OsdHeight() * config.channelHeight / 100;
int top = cOsd::OsdTop() + cOsd::OsdHeight() - height - config.channelBorderBottom;
osd = CreateOsd(cOsd::OsdLeft(), top, cOsd::OsdWidth(), height);
- infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder);
- infoX = config.logoWidth + config.channelBorderVertical + config.logoBorder;
+ switch (config.logoPosition) {
+ case lpLeft:
+ infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder);
+ infoX = config.logoWidth + config.channelBorderVertical + config.logoBorder;
+ break;
+ case lpRight:
+ infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder);
+ infoX = config.channelBorderVertical;
+ break;
+ case lpNone:
+ infoWidth = osd->Width() - 2 * config.channelBorderVertical;
+ infoX = config.channelBorderVertical;
+ break;
+ }
channelInfoWidth = infoWidth * 0.7;
dateWidth = infoWidth - channelInfoWidth;
channelInfoHeight = height * 0.2;
@@ -83,7 +95,6 @@ void cNopacityDisplayChannel::SetGeometry(void) {
streamInfoY = channelInfoHeight + progressBarHeight + epgInfoHeight;
iconSize = config.statusIconSize;
iconsWidth = 5*iconSize;
-
}
void cNopacityDisplayChannel::CreatePixmaps(void) {
@@ -104,7 +115,20 @@ void cNopacityDisplayChannel::CreatePixmaps(void) {
pixmapFooter = osd->CreatePixmap(2, cRect(infoX, streamInfoY, infoWidth, streamInfoHeight));
pixmapStreamInfo = osd->CreatePixmap(4, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize));
pixmapStreamInfoBack = osd->CreatePixmap(3, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize));
- pixmapLogo = osd->CreatePixmap(1, cRect(0, 0, config.logoWidth + 2 * config.logoBorder, height));
+
+ switch (config.logoPosition) {
+ case lpLeft:
+ pixmapLogo = osd->CreatePixmap(1, cRect(0, 0, config.logoWidth + 2 * config.logoBorder, height));
+ break;
+ case lpRight:
+ pixmapLogo = osd->CreatePixmap(1, cRect(infoX + infoWidth, 0, config.logoWidth + 2 * config.logoBorder, height));
+ break;
+ case lpNone:
+ pixmapLogo = osd->CreatePixmap(-1, cRect(0, 0, 1, 1));
+ break;
+ }
+
+
if (config.channelFadeTime) {
pixmapBackgroundTop->SetAlpha(0);
@@ -358,10 +382,11 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
if (!groupSep) {
pixmapChannelInfo->DrawText(cPoint(channelInfoHeight/2, (channelInfoHeight-fontHeader->Height())/2), channelString, Theme.Color(clrChannelHead), clrTransparent, fontHeader);
-
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(*ChannelName)) {
- pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage());
+ if (config.logoPosition != lpNone) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadLogo(*ChannelName)) {
+ pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage());
+ }
}
} else {
if (withInfo) {
@@ -371,11 +396,13 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
} else {
pixmapChannelInfo->DrawText(cPoint(channelInfoHeight/2, (channelInfoHeight-fontHeader->Height())/2), channelString, Theme.Color(clrChannelHead), clrTransparent, fontHeader);
}
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(*ChannelName)) {
- pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage());
- } else if (imgLoader.LoadIcon("Channelseparator", config.logoHeight)) {
- pixmapLogo->DrawImage(cPoint(config.logoBorder + (config.logoWidth - config.logoHeight)/2, (height-config.logoHeight)/2), imgLoader.GetImage());
+ if (config.logoPosition != lpNone) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadLogo(*ChannelName)) {
+ pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage());
+ } else if (imgLoader.LoadIcon("Channelseparator", config.logoHeight)) {
+ pixmapLogo->DrawImage(cPoint(config.logoBorder + (config.logoWidth - config.logoHeight)/2, (height-config.logoHeight)/2), imgLoader.GetImage());
+ }
}
}
}
diff --git a/displaychannel.h b/displaychannel.h
index ffe66a2..3a5f924 100644
--- a/displaychannel.h
+++ b/displaychannel.h
@@ -1,6 +1,8 @@
#ifndef __NOPACITY_DISPLAYCHANNEL_H
#define __NOPACITY_DISPLAYCHANNEL_H
+enum eLogoPosition {lpNone = 0, lpLeft, lpRight};
+
class cNopacityDisplayChannel : public cSkinDisplayChannel, cThread {
private:
int FrameTime;
diff --git a/po/de_DE.po b/po/de_DE.po
index e53e348..dcf390a 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: skinnopacity 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-03-09 15:43+0100\n"
+"POT-Creation-Date: 2013-03-10 16:40+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -296,6 +296,9 @@ msgstr "Weitere EPG Bilder in der detaillierten Aufnahmeansicht anzeigen"
msgid "Folder Icon Size"
msgstr "Order Icon Größe"
+msgid "do not display"
+msgstr "nicht anzeigen"
+
msgid "Hight of Channel Display (Percent of OSD Height)"
msgstr "Höhe der Kanalwechsel Anzeige (Proz. der OSD Höhe)"
@@ -305,6 +308,9 @@ msgstr "Breite des linken und rechten Rands"
msgid "Bottom Border Height"
msgstr "Höhe des unteren Rands"
+msgid "Channel Logo Position"
+msgstr "Kanallogo Position"
+
msgid "Channel Logo Border"
msgstr "Rand um die Kanallogos"
@@ -369,4 +375,4 @@ msgid "conflict"
msgstr "Konflikt"
msgid "conflicts"
-msgstr "Konflikte" \ No newline at end of file
+msgstr "Konflikte"
diff --git a/setup.c b/setup.c
index 03aba27..6f079bd 100644
--- a/setup.c
+++ b/setup.c
@@ -72,6 +72,7 @@ void cNopacitySetup::Store(void) {
SetupStore("channelHeight", config.channelHeight);
SetupStore("channelBorderVertical", config.channelBorderVertical);
SetupStore("channelBorderBottom", config.channelBorderBottom);
+ SetupStore("logoPosition", config.logoPosition);
SetupStore("logoWidth", config.logoWidth);
SetupStore("logoHeight", config.logoHeight);
SetupStore("logoBorder", config.logoBorder);
@@ -413,6 +414,9 @@ void cNopacitySetupMenuDisplayRecordings::Set(void) {
//----ChannelDisplay--------------------------------------------------------------------------------------------------------------
cNopacitySetupChannelDisplay::cNopacitySetupChannelDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("Channel Switching"), data) {
+ logoPos[0] = tr("do not display");
+ logoPos[1] = tr("left");
+ logoPos[2] = tr("right");
Set();
}
@@ -424,9 +428,12 @@ void cNopacitySetupChannelDisplay::Set(void) {
Add(new cMenuEditIntItem(tr("Hight of Channel Display (Percent of OSD Height)"), &tmpNopacityConfig->channelHeight, 15, 100));
Add(new cMenuEditIntItem(tr("Left & Right Border Width"), &tmpNopacityConfig->channelBorderVertical, 0, 300));
Add(new cMenuEditIntItem(tr("Bottom Border Height"), &tmpNopacityConfig->channelBorderBottom, 0, 300));
- Add(new cMenuEditIntItem(tr("Channel Logo Width"), &tmpNopacityConfig->logoWidth, 30, 500));
- Add(new cMenuEditIntItem(tr("Channel Logo Height"), &tmpNopacityConfig->logoHeight, 30, 500));
- Add(new cMenuEditIntItem(tr("Channel Logo Border"), &tmpNopacityConfig->logoBorder, 0, 200));
+ Add(new cMenuEditStraItem(tr("Channel Logo Position"), &tmpNopacityConfig->logoPosition, 3, logoPos));
+ if (tmpNopacityConfig->logoPosition) {
+ Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Channel Logo Width")), &tmpNopacityConfig->logoWidth, 30, 500));
+ Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Channel Logo Height")), &tmpNopacityConfig->logoHeight, 30, 500));
+ Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Channel Logo Border")), &tmpNopacityConfig->logoBorder, 0, 200));
+ }
Add(new cMenuEditBoolItem(tr("Display Signal Strength & Quality"), &tmpNopacityConfig->displaySignalStrength));
Add(new cMenuEditIntItem(tr("Screen Resolution Icon Size"), &tmpNopacityConfig->resolutionIconSize, 30, 200));
Add(new cMenuEditIntItem(tr("Status Icons Size"), &tmpNopacityConfig->statusIconSize, 30, 150));
diff --git a/setup.h b/setup.h
index 487e23f..aa40b48 100644
--- a/setup.h
+++ b/setup.h
@@ -75,6 +75,7 @@ class cNopacitySetupMenuDisplayRecordings : public cMenuSetupSubMenu {
class cNopacitySetupChannelDisplay : public cMenuSetupSubMenu {
protected:
+ const char *logoPos[3];
void Set(void);
public:
cNopacitySetupChannelDisplay(cNopacityConfig *data);