summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--config.c2
-rw-r--r--config.h1
-rw-r--r--menuitem.c89
-rw-r--r--menuitem.h5
-rw-r--r--po/de_DE.po11
-rw-r--r--po/it_IT.po11
-rw-r--r--po/sk_SK.po11
-rw-r--r--setup.c4
-rw-r--r--setup.h1
10 files changed, 114 insertions, 23 deletions
diff --git a/HISTORY b/HISTORY
index bc6e331..c4e49c3 100644
--- a/HISTORY
+++ b/HISTORY
@@ -214,3 +214,5 @@ Version 0.1.2
- Added theme "iceblue" based on the introduced plain display style
- Fixed display of recording duration in recordings menu when a cut is
running in the background
+- Additional information in channels menu configurable: choice between
+ transponder information and current schedule
diff --git a/config.c b/config.c
index 88d962e..bc4db13 100644
--- a/config.c
+++ b/config.c
@@ -81,6 +81,7 @@ cNopacityConfig::cNopacityConfig() {
numAdditionalEPGPictures = 9;
displayAdditionalRecEPGPictures = 1;
numAdditionalRecEPGPictures = 9;
+ menuChannelDisplayMode = 0;
numEPGEntriesChannelsMenu = 15;
menuFadeTime = 0;
menuEPGWindowFadeTime = 300;
@@ -364,6 +365,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "numAdditionalEPGPictures") == 0) numAdditionalEPGPictures = atoi(Value);
else if (strcmp(Name, "displayAdditionalRecEPGPictures") == 0) displayAdditionalRecEPGPictures = atoi(Value);
else if (strcmp(Name, "numAdditionalRecEPGPictures") == 0) numAdditionalRecEPGPictures = atoi(Value);
+ else if (strcmp(Name, "menuChannelDisplayMode") == 0) menuChannelDisplayMode = atoi(Value);
else if (strcmp(Name, "numEPGEntriesChannelsMenu") == 0) numEPGEntriesChannelsMenu = atoi(Value);
else if (strcmp(Name, "menuWidthMain") == 0) menuWidthMain = atoi(Value);
else if (strcmp(Name, "menuWidthSchedules") == 0) menuWidthSchedules = atoi(Value);
diff --git a/config.h b/config.h
index 7e7b6ea..7d85944 100644
--- a/config.h
+++ b/config.h
@@ -110,6 +110,7 @@ class cNopacityConfig {
int numAdditionalEPGPictures;
int displayAdditionalRecEPGPictures;
int numAdditionalRecEPGPictures;
+ int menuChannelDisplayMode;
int numEPGEntriesChannelsMenu;
int menuFadeTime;
int menuEPGWindowFadeTime;
diff --git a/menuitem.c b/menuitem.c
index ab85994..5795433 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -562,6 +562,7 @@ void cNopacityScheduleMenuItem::DrawRemaining(int x, int y, int width) {
cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin) : cNopacityMenuItem (osd, "", sel) {
this->Channel = Channel;
this->vidWin = vidWin;
+ epgRead = false;
}
cNopacityChannelMenuItem::~cNopacityChannelMenuItem(void) {
@@ -577,12 +578,16 @@ void cNopacityChannelMenuItem::CreatePixmapTextScroller(int totalWidth) {
void cNopacityChannelMenuItem::CreateText() {
strEntry = cString::sprintf("%d %s", Channel->Number(), Channel->Name());
- const cSource *source = Sources.Get(Channel->Source());
- if (source)
- strChannelSource = cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description());
- else
- strChannelSource = "";
- strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency()/1000);
+ if (config.menuChannelDisplayMode == 0) {
+ const cSource *source = Sources.Get(Channel->Source());
+ if (source)
+ strChannelSource = cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description());
+ else
+ strChannelSource = "";
+ strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency()/1000);
+ } else {
+ readCurrentEPG();
+ }
}
int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
@@ -595,7 +600,17 @@ int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
totalTextWidth = max(font->Width(strEntry.c_str()), totalTextWidth);
strEntryFull = strEntry.c_str();
strEntry = CutText(strEntry, width - spaceLeft, font);
- }
+ } else
+ strEntryFull = strEntry;
+
+ if (fontSmall->Width(strEpgInfo.c_str()) > (width - spaceLeft)) {
+ scrollable = true;
+ totalTextWidth = max(fontSmall->Width(strEpgInfo.c_str()), totalTextWidth);
+ strEpgInfoFull = strEpgInfo.c_str();
+ strEpgInfo = CutText(strEpgInfo, width - spaceLeft, fontSmall);
+ } else
+ strEpgInfoFull = strEpgInfo;
+
return totalTextWidth;
}
@@ -603,12 +618,20 @@ void cNopacityChannelMenuItem::SetTextFull(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
+ if (config.menuChannelDisplayMode == 1) {
+ pixmapTextScroller->DrawText(cPoint(5, height/2 + (height/4 - fontSmall->Height())/2), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ pixmapTextScroller->DrawText(cPoint(5, 3*height/4 + (height/4 - fontSmall->Height())/2), strEpgInfoFull.c_str(), clrFont, clrTransparent, fontSmall);
+ }
}
void cNopacityChannelMenuItem::SetTextShort(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+ if (config.menuChannelDisplayMode == 1) {
+ pixmapTextScroller->DrawText(cPoint(5, height/2 + (height/4 - fontSmall->Height())/2), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ pixmapTextScroller->DrawText(cPoint(5, 3*height/4 + (height/4 - fontSmall->Height())/2), strEpgInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ }
}
void cNopacityChannelMenuItem::DrawBackground(void) {
@@ -623,19 +646,42 @@ void cNopacityChannelMenuItem::DrawBackground(void) {
if (config.roundedCorners)
DrawRoundedCorners(Theme.Color(clrMenuBorder));
- int encryptedSize = height/4-2;
- int sourceX = config.menuItemLogoWidth + 15;
- tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
- tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem));
- pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, clrFont, clrFontBack, fontSmall);
- if (Channel->Ca()) {
- cImageLoader imgLoader;
- if (imgLoader.LoadIcon("skinIcons/encrypted", encryptedSize)) {
- pixmapIcon->DrawImage(cPoint(sourceX, height/2+1), imgLoader.GetImage());
- sourceX += encryptedSize + 10;
+ if (config.menuChannelDisplayMode == 0) {
+ int encryptedSize = height/4-2;
+ int sourceX = config.menuItemLogoWidth + 15;
+ tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
+ tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem));
+ pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, clrFont, clrFontBack, fontSmall);
+ if (Channel->Ca()) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadIcon("skinIcons/encrypted", encryptedSize)) {
+ pixmapIcon->DrawImage(cPoint(sourceX, height/2+1), imgLoader.GetImage());
+ sourceX += encryptedSize + 10;
+ }
+ }
+ pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, clrFont, clrFontBack, fontSmall);
+ }
+}
+
+void cNopacityChannelMenuItem::readCurrentEPG(void) {
+ cSchedulesLock schedulesLock;
+ const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
+ const cSchedule *Schedule = NULL;
+ Schedule = schedules->GetSchedule(Channel);
+ if (!Schedule) {
+ strEpgInfo = tr("No EPG Information found");
+ strTimeInfo = "";
+ } else {
+ const cEvent *PresentEvent = Schedule->GetPresentEvent();
+ int i=0;
+ if (!PresentEvent) {
+ strEpgInfo = tr("No EPG Information found");
+ strTimeInfo = "";
+ } else {
+ strEpgInfo = PresentEvent->Title();
+ strTimeInfo = *cString::sprintf("%s - %s:", *PresentEvent->GetTimeString(), *PresentEvent->GetEndTimeString());
}
}
- pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, clrFont, clrFontBack, fontSmall);
}
std::string cNopacityChannelMenuItem::readEPG(void) {
@@ -672,9 +718,12 @@ std::string cNopacityChannelMenuItem::readEPG(void) {
}
void cNopacityChannelMenuItem::Render() {
-
+
if (selectable) { //Channels
DrawBackground();
+ if (!epgRead) {
+
+ }
int logoWidth = config.menuItemLogoWidth;
int logoHeight = config.menuItemLogoHeight;
if (!drawn) {
@@ -698,7 +747,7 @@ void cNopacityChannelMenuItem::Render() {
delete infoTextWindow;
infoTextWindow = NULL;
}
- if (current && Channel) {
+ if (current && Channel && (config.menuChannelDisplayMode == 0)) {
infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, vidWin);
infoTextWindow->SetGeometry(textWindow);
infoTextWindow->SetText(readEPG().c_str());
diff --git a/menuitem.h b/menuitem.h
index bf3b0eb..c2c2c9d 100644
--- a/menuitem.h
+++ b/menuitem.h
@@ -112,10 +112,15 @@ private:
std::string strEntryFull;
cString strChannelSource;
cString strChannelInfo;
+ std::string strEpgInfo;
+ std::string strEpgInfoFull;
+ std::string strTimeInfo;
cRect *vidWin;
+ bool epgRead;
void SetTextFull(void);
void SetTextShort(void);
void DrawBackground(void);
+ void readCurrentEPG(void);
std::string readEPG(void);
public:
cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin);
diff --git a/po/de_DE.po b/po/de_DE.po
index 01b3fec..ce5cdfc 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-05-07 16:23+0200\n"
+"POT-Creation-Date: 2013-05-09 14:41+0200\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -329,6 +329,15 @@ msgstr "Schriftgröße anpassen - Menüelement klein"
msgid "Adjust Font Size - EPG Info Window"
msgstr "Schriftgröße anpassen - EPG Infofenster"
+msgid "Transponder Information"
+msgstr "Transponder Information"
+
+msgid "Current Schedule"
+msgstr "Aktuelles Programm"
+
+msgid "Menu Items display mode"
+msgstr "Anzeigemodus Menüelemente"
+
msgid "Number of EPG Entries in Schedules Info Window"
msgstr "Anzahl der EPG Einträge im Programm Info Fenster"
diff --git a/po/it_IT.po b/po/it_IT.po
index d733a45..57a1a12 100644
--- a/po/it_IT.po
+++ b/po/it_IT.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-05-07 16:23+0200\n"
+"POT-Creation-Date: 2013-05-09 14:41+0200\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -332,6 +332,15 @@ msgstr "Adatta dim. caratteri - Voce menu piccolo"
msgid "Adjust Font Size - EPG Info Window"
msgstr "Adatta dim. caratteri - Finestra info EPG"
+msgid "Transponder Information"
+msgstr ""
+
+msgid "Current Schedule"
+msgstr ""
+
+msgid "Menu Items display mode"
+msgstr ""
+
msgid "Number of EPG Entries in Schedules Info Window"
msgstr ""
diff --git a/po/sk_SK.po b/po/sk_SK.po
index 4be4d1f..79b0f14 100644
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinnopacity 0.0.6\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-05-07 16:23+0200\n"
+"POT-Creation-Date: 2013-05-09 14:41+0200\n"
"PO-Revision-Date: 2013-03-12 15:59+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -332,6 +332,15 @@ msgstr "Nastavenie veµkos»i písma - Malé polo¾ky ponuky"
msgid "Adjust Font Size - EPG Info Window"
msgstr "Nastavenie veµkos»i písma - EPG informaèné okno"
+msgid "Transponder Information"
+msgstr ""
+
+msgid "Current Schedule"
+msgstr ""
+
+msgid "Menu Items display mode"
+msgstr ""
+
msgid "Number of EPG Entries in Schedules Info Window"
msgstr ""
diff --git a/setup.c b/setup.c
index 0048f34..ba4d47a 100644
--- a/setup.c
+++ b/setup.c
@@ -136,6 +136,7 @@ void cNopacitySetup::Store(void) {
SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures);
SetupStore("displayAdditionalRecEPGPictures", config.displayAdditionalRecEPGPictures);
SetupStore("numAdditionalRecEPGPictures", config.numAdditionalRecEPGPictures);
+ SetupStore("menuChannelDisplayMode", config.menuChannelDisplayMode);
SetupStore("numEPGEntriesChannelsMenu", config.numEPGEntriesChannelsMenu);
SetupStore("menuFadeTime", config.menuFadeTime);
SetupStore("menuScrollDelay", config.menuScrollDelay);
@@ -387,6 +388,8 @@ void cNopacitySetupMenuDisplaySchedules::Set(void) {
//-----MenuDisplay Channels Menu -------------------------------------------------------------------------------------------------------------
cNopacitySetupMenuDisplayChannels::cNopacitySetupMenuDisplayChannels(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu: Channels Menu"), data) {
+ displayModes[0] = tr("Transponder Information");
+ displayModes[1] = tr("Current Schedule");
Set();
}
@@ -397,6 +400,7 @@ void cNopacitySetupMenuDisplayChannels::Set(void) {
Add(new cMenuEditBoolItem(tr("Use narrow menu"), &tmpNopacityConfig->narrowChannelMenu));
if (tmpNopacityConfig->narrowChannelMenu)
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Width (Percent of OSD Width)")), &tmpNopacityConfig->menuWidthChannels, 10, 97));
+ Add(new cMenuEditStraItem(tr("Menu Items display mode"), &tmpNopacityConfig->menuChannelDisplayMode, 2, displayModes));
Add(new cMenuEditIntItem(tr("Number of EPG Entries in Schedules Info Window"), &tmpNopacityConfig->numEPGEntriesChannelsMenu, 1, 100));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item"), &tmpNopacityConfig->fontMenuitemChannel, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item Small"), &tmpNopacityConfig->fontMenuitemChannelSmall, -20, 20));
diff --git a/setup.h b/setup.h
index 377ca69..657bf07 100644
--- a/setup.h
+++ b/setup.h
@@ -57,6 +57,7 @@ class cNopacitySetupMenuDisplaySchedules : public cMenuSetupSubMenu {
class cNopacitySetupMenuDisplayChannels : public cMenuSetupSubMenu {
protected:
+ const char *displayModes[2];
void Set(void);
public:
cNopacitySetupMenuDisplayChannels(cNopacityConfig *data);