summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2012-11-28 20:58:39 +0100
committerlouis <louis.braun@gmx.de>2012-11-28 20:58:39 +0100
commit1121def63e1ec3bb56caa974d68c584070e64d68 (patch)
tree65471cbb0c74e3dfd4854f83370ab621b0fdd6a2
parent81741f77745d190629f3d91c290ea7c15e0c75ba (diff)
downloadskin-nopacity-1121def63e1ec3bb56caa974d68c584070e64d68.tar.gz
skin-nopacity-1121def63e1ec3bb56caa974d68c584070e64d68.tar.bz2
Added feature to display reruns in detailed EPG view
-rw-r--r--HISTORY1
-rw-r--r--config.c6
-rw-r--r--config.h3
-rw-r--r--displaymenu.c2
-rw-r--r--menudetailview.c67
-rw-r--r--menudetailview.h3
-rw-r--r--po/de_DE.po23
-rw-r--r--setup.c9
-rw-r--r--setup.h1
9 files changed, 111 insertions, 4 deletions
diff --git a/HISTORY b/HISTORY
index c67b25c..b65936c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -51,3 +51,4 @@ VDR Plugin 'nOpacity' Revision History
- Fixes a bug that individually set up color buttons were not assumed
(thanks @maverick-me)
- optical redesign of displayVolume (thanks @maverick-me)
+- Display of reruns of shows in detailed EPG view using epgseach.
diff --git a/config.c b/config.c
index d9fe332..6638e0a 100644
--- a/config.c
+++ b/config.c
@@ -53,6 +53,9 @@ cNopacityConfig::cNopacityConfig() {
fontVolume = 0;
//DisplayMenu
scalePicture = 1;
+ displayRerunsDetailEPGView = 1;
+ numReruns = 3;
+ useSubtitleRerun = 1;
menuFadeTime = 300;
menuWidthNarrow = 30;
menuWidthRightItems = 12;
@@ -170,6 +173,9 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "fontVolume") == 0) fontVolume = atoi(Value);
else if (strcmp(Name, "menuFadeTime") == 0) menuFadeTime = atoi(Value);
else if (strcmp(Name, "scalePicture") == 0) scalePicture = atoi(Value);
+ else if (strcmp(Name, "displayRerunsDetailEPGView") == 0) displayRerunsDetailEPGView = atoi(Value);
+ else if (strcmp(Name, "numReruns") == 0) numReruns = atoi(Value);
+ else if (strcmp(Name, "useSubtitleRerun") == 0) useSubtitleRerun = atoi(Value);
else if (strcmp(Name, "menuWidthNarrow") == 0) menuWidthNarrow = atoi(Value);
else if (strcmp(Name, "menuWidthRightItems") == 0) menuWidthRightItems = atoi(Value);
else if (strcmp(Name, "headerHeight") == 0) headerHeight = atoi(Value);
diff --git a/config.h b/config.h
index 65479dd..366c6e7 100644
--- a/config.h
+++ b/config.h
@@ -75,6 +75,9 @@ class cNopacityConfig {
int fontVolume;
//DisplayMenu
int scalePicture;
+ int displayRerunsDetailEPGView;
+ int numReruns;
+ int useSubtitleRerun;
int menuFadeTime;
int menuFrameTime;
int menuWidthNarrow;
diff --git a/displaymenu.c b/displaymenu.c
index 6a2d982..0d785bd 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -377,6 +377,8 @@ void cNopacityDisplayMenu::SetEvent(const cEvent *Event) {
detailView = new cNopacityMenuDetailEventView(osd, Event, channelName);
menuView->SetDetailViewSize(dvEvent, detailView);
detailView->SetFonts();
+ if (config.displayRerunsDetailEPGView)
+ detailView->LoadReruns(Event);
detailView->SetContent(Event->Description());
detailView->CreatePixmaps();
detailView->Render();
diff --git a/menudetailview.c b/menudetailview.c
index 8dc7d6c..03bd32b 100644
--- a/menudetailview.c
+++ b/menudetailview.c
@@ -1,8 +1,12 @@
#include "menudetailview.h"
+#include "services/epgsearch.h"
+#include <sstream>
cNopacityMenuDetailView::cNopacityMenuDetailView(cOsd *osd) {
this->osd = osd;
hasScrollbar = false;
+ additionalContent = NULL;
+ additionalContentSet = false;
}
cNopacityMenuDetailView::~cNopacityMenuDetailView(void) {
@@ -23,9 +27,18 @@ void cNopacityMenuDetailView::SetGeometry(int width, int height, int top, int co
}
void cNopacityMenuDetailView::SetContent(const char *textContent) {
- if (textContent)
- content.Set(textContent, font, width - 4 * border);
- else
+ if (textContent) {
+ cString sContent = textContent;
+ if (additionalContentSet) {
+ std::stringstream sstrContent;
+ sstrContent << textContent;
+ sstrContent << std::endl;
+ sstrContent << std::endl;
+ sstrContent << *additionalContent;
+ sContent = sstrContent.str().c_str();
+ }
+ content.Set(*sContent, font, width - 4 * border);
+ } else
content.Set("", font, width - 4 * border);
int textHeight = font->Height();
@@ -46,6 +59,54 @@ void cNopacityMenuDetailView::DrawContent(void) {
pixmapContent->DrawText(cPoint(2*border, (i+1)*textHeight), content.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font);
}
}
+
+void cNopacityMenuDetailView::LoadReruns(const cEvent *event) {
+ cPlugin *epgSearchPlugin = cPluginManager::GetPlugin("epgsearch");
+ if (epgSearchPlugin && !isempty(event->Title())) {
+ std::stringstream sstrReruns;
+ Epgsearch_searchresults_v1_0 data;
+ std::string strQuery = event->Title();
+ if (config.useSubtitleRerun > 0) {
+ if (config.useSubtitleRerun == 2 || !isempty(event->ShortText()))
+ strQuery += "~";
+ if (!isempty(event->ShortText()))
+ strQuery += event->ShortText();
+ data.useSubTitle = true;
+ } else {
+ data.useSubTitle = false;
+ }
+ data.query = (char *)strQuery.c_str();
+ data.mode = 0;
+ data.channelNr = 0;
+ data.useTitle = true;
+ data.useDescription = false;
+
+ if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) {
+ cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList;
+ if (list && (list->Count() > 1)) {
+ //TODO: current event is shown as rerun
+ sstrReruns << tr("RERUNS OF THIS SHOW") << ':' << std::endl;
+ int i = 0;
+ for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < config.numReruns; r = list->Next(r)) {
+ i++;
+ sstrReruns << "- "
+ << *DayDateTime(r->event->StartTime());
+ cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
+ if (channel)
+ sstrReruns << " " << channel->ShortName(true);
+ sstrReruns << ": " << r->event->Title();
+ if (!isempty(r->event->ShortText()))
+ sstrReruns << "~" << r->event->ShortText();
+ sstrReruns << std::endl;
+ }
+ delete list;
+ }
+ }
+ additionalContent = sstrReruns.str().c_str();
+ additionalContentSet = true;
+ }
+}
+
double cNopacityMenuDetailView::ScrollbarSize(void) {
double barSize = (double)contentHeight / (double)contentDrawPortHeight;
return barSize;
diff --git a/menudetailview.h b/menudetailview.h
index 51eb0e9..36ace32 100644
--- a/menudetailview.h
+++ b/menudetailview.h
@@ -11,6 +11,8 @@ protected:
int contentDrawPortHeight;
int border;
cTextWrapper content;
+ cString additionalContent;
+ bool additionalContentSet;
cFont *font, *fontHeader, *fontHeaderLarge;
cPixmap *pixmapHeader;
cPixmap *pixmapLogo;
@@ -22,6 +24,7 @@ public:
void SetGeometry(int width, int height, int top, int contentBorder, int headerHeight);
virtual void SetFonts(void) = 0;
void SetContent(const char *textContent);
+ void LoadReruns(const cEvent *event);
bool Scrollable(void) {return hasScrollbar;}
double ScrollbarSize(void);
double Offset(void);
diff --git a/po/de_DE.po b/po/de_DE.po
index f68d97e..3a16af2 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: 2012-11-24 10:42+0100\n"
+"POT-Creation-Date: 2012-11-28 20:39+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -38,12 +38,30 @@ msgstr "Nachrichten"
msgid "Volume"
msgstr "Lautstärke"
+msgid "never"
+msgstr "nie"
+
+msgid "if exists"
+msgstr "falls vorhanden"
+
+msgid "always"
+msgstr "immer"
+
msgid "Fade-In Time in ms (Zero for switching off fading)"
msgstr "Fade-In Zeit in ms (Null zum Abschalten)"
msgid "Scale Video size to fit into menu window"
msgstr "TV-Bildgröße in Menüfenster einpassen"
+msgid "Display Reruns in detailed EPG View"
+msgstr "Wiederholungen in der detailierten EPG Ansicht anzeigen"
+
+msgid "Number of reruns to display"
+msgstr "Anzahl der dargestellten Wiederholungen"
+
+msgid "Use Subtitle for reruns"
+msgstr "Untertitel für Wiederholungssuche nutzen"
+
msgid "Width of narrow Menu Bar (Percent of OSD Width)"
msgstr "Breite der schmalen Menüleiste (Proz. der OSD Breite)"
@@ -204,6 +222,9 @@ msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)"
msgid "Hight of Volume Display (Percent of OSD Height)"
msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)"
+msgid "RERUNS OF THIS SHOW"
+msgstr "Wiederholungen"
+
msgid "Disc"
msgstr "Festplatte"
diff --git a/setup.c b/setup.c
index 92726b1..79a4617 100644
--- a/setup.c
+++ b/setup.c
@@ -92,6 +92,9 @@ void cNopacitySetup::Store(void) {
SetupStore("volumeBorderBottom", config.volumeBorderBottom);
SetupStore("fontVolume", config.fontVolume);
SetupStore("scalePicture", config.scalePicture);
+ SetupStore("displayRerunsDetailEPGView", config.displayRerunsDetailEPGView);
+ SetupStore("numReruns", config.numReruns);
+ SetupStore("useSubtitleRerun", config.useSubtitleRerun);
SetupStore("menuFadeTime", config.menuFadeTime);
SetupStore("menuWidthNarrow", config.menuWidthNarrow);
SetupStore("menuWidthRightItems", config.menuWidthRightItems);
@@ -152,6 +155,9 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) {
//-----MenuDisplay-------------------------------------------------------------------------------------------------------------
cNopacitySetupMenuDisplay::cNopacitySetupMenuDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu"), data) {
+ useSubtitleRerunTexts[0] = tr("never");
+ useSubtitleRerunTexts[1] = tr("if exists");
+ useSubtitleRerunTexts[2] = tr("always");
Set();
}
@@ -160,6 +166,9 @@ void cNopacitySetupMenuDisplay::Set(void) {
Clear();
Add(new cMenuEditIntItem(tr("Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuFadeTime, 0, 1000));
Add(new cMenuEditBoolItem(tr("Scale Video size to fit into menu window"), &tmpNopacityConfig->scalePicture));
+ Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpNopacityConfig->displayRerunsDetailEPGView));
+ Add(new cMenuEditIntItem(tr("Number of reruns to display"), &tmpNopacityConfig->numReruns, 1, 10));
+ Add(new cMenuEditStraItem(tr("Use Subtitle for reruns"), &tmpNopacityConfig->useSubtitleRerun, 3, useSubtitleRerunTexts));
Add(new cMenuEditIntItem(tr("Width of narrow Menu Bar (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthNarrow, 10, 100));
Add(new cMenuEditIntItem(tr("Width of Disc Usage and Timers Display (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthRightItems, 10, 100));
Add(new cMenuEditIntItem(tr("Header Height (Percent of OSD Height)"), &tmpNopacityConfig->headerHeight, 0, 30));
diff --git a/setup.h b/setup.h
index 0b36398..655a270 100644
--- a/setup.h
+++ b/setup.h
@@ -28,6 +28,7 @@ class cMenuSetupSubMenu : public cOsdMenu {
class cNopacitySetupMenuDisplay : public cMenuSetupSubMenu {
protected:
+ const char *useSubtitleRerunTexts[3];
void Set(void);
public:
cNopacitySetupMenuDisplay(cNopacityConfig *data);