summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY11
-rw-r--r--Makefile2
-rw-r--r--config.c2
-rw-r--r--config.h2
-rw-r--r--detailview.c1080
-rw-r--r--detailview.h160
-rw-r--r--displaychannel.c1
-rw-r--r--displaymenu.c51
-rw-r--r--displaymenu.h2
-rw-r--r--displaymenuview.c14
-rw-r--r--displaymenuview.h5
-rw-r--r--menudetailview.c1474
-rw-r--r--menudetailview.h142
-rw-r--r--po/ca_ES.po73
-rw-r--r--po/de_DE.po87
-rw-r--r--po/it_IT.po66
-rw-r--r--po/sk_SK.po73
-rw-r--r--setup.c2
-rw-r--r--skinnopacity.c2
-rw-r--r--themes/nOpacity-blue.theme1
-rw-r--r--themes/nOpacity-darkblue.theme1
-rw-r--r--themes/nOpacity-darkgrey.theme1
-rw-r--r--themes/nOpacity-darkred.theme1
-rw-r--r--themes/nOpacity-darkredNG.theme1
-rw-r--r--themes/nOpacity-default.theme1
-rw-r--r--themes/nOpacity-green.theme1
-rw-r--r--themes/nOpacity-iceblue.theme1
-rw-r--r--themes/nOpacity-light.theme1
28 files changed, 1720 insertions, 1538 deletions
diff --git a/HISTORY b/HISTORY
index 5554222..5c5266b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -411,3 +411,14 @@ Version 1.0.3
Version 1.1.0
- Added scraper2vdr support
+
+Version 1.1.1
+
+- Fixed a crash if no images exists for a movie
+- Only display poster in detailed EPG View if really available
+- Only display poster in detailed recordings view
+- fixed crash in detailed epg view
+
+Version 1.1.2
+
+- Restructured detailed EPG and recordings view
diff --git a/Makefile b/Makefile
index 86c1531..dcee31e 100644
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,7 @@ endif
### The object files (add further files here):
-OBJS = $(PLUGIN).o config.o displaychannel.o displaymenu.o displaymenuview.o displaymessage.o displayreplay.o displaytracks.o displayvolume.o displaychannelview.o fontmanager.o \
+OBJS = $(PLUGIN).o config.o detailview.o displaychannel.o displaymenu.o displaymenuview.o displaymessage.o displayreplay.o displaytracks.o displayvolume.o displaychannelview.o fontmanager.o \
geometrymanager.o imagecache.o imagemagickwrapper.o imagescaler.o helpers.o imageloader.o menudetailview.o menuitem.o nopacity.o setup.o textwindow.o timers.o
### The main target:
diff --git a/config.c b/config.c
index 222e82d..a2c13ab 100644
--- a/config.c
+++ b/config.c
@@ -113,6 +113,8 @@ void cNopacityConfig::LoadDefaults(void) {
conf.insert(std::pair<std::string, int>("menuChannelLogoBackground", 1));
conf.insert(std::pair<std::string, int>("borderDetailedEPG", 30));
conf.insert(std::pair<std::string, int>("borderDetailedRecordings", 30));
+ conf.insert(std::pair<std::string, int>("headerDetailedEPG", 20));
+ conf.insert(std::pair<std::string, int>("headerDetailedRecordings", 20));
conf.insert(std::pair<std::string, int>("menuSchedulesWindowMode", 1));
conf.insert(std::pair<std::string, int>("menuRecordingsWindowMode", 1));
conf.insert(std::pair<std::string, int>("menuTimersWindowMode", 1));
diff --git a/config.h b/config.h
index fab00b0..c119feb 100644
--- a/config.h
+++ b/config.h
@@ -110,6 +110,7 @@ class cNopacityConfig {
#define CLR_CHANNELLOGOBACK 0x99C6C6C6
#define CLR_FONTMENUITEMHIGH 0xFF363636
#define CLR_TEXTWINDOW 0xB0000000
+#define CLR_DETAILVIEWBACK 0x50000000
//CHANNELS
THEME_CLR(Theme, clrChannelBackground, CLR_MENUBACK);
@@ -186,6 +187,7 @@ THEME_CLR(Theme, clrProgressBarBackHigh, CLR_PROGRESSBARBACKHIGH);
THEME_CLR(Theme, clrProgressBarBlendHigh, CLR_PROGRESSBARBLENDHIGH);
THEME_CLR(Theme, clrMenuTextWindow, CLR_TEXTWINDOW);
THEME_CLR(Theme, clrMenuChannelLogoBack, CLR_CHANNELLOGOBACK);
+THEME_CLR(Theme, clrMenuDetailViewBack, CLR_DETAILVIEWBACK);
//BUTTONS
THEME_CLR(Theme, clrButtonRed, CLR_TRANSPARENT);
diff --git a/detailview.c b/detailview.c
new file mode 100644
index 0000000..76c9513
--- /dev/null
+++ b/detailview.c
@@ -0,0 +1,1080 @@
+#include "detailview.h"
+
+/********************************************************************************************
+* cNopacityView
+********************************************************************************************/
+
+cNopacityView::cNopacityView(cOsd *osd, cImageCache *imgCache) {
+ this->osd = osd;
+ this->imgCache = imgCache;
+ activeView = 0;
+ scrollable = false;
+ tabbed = false;
+ font = NULL;
+ fontSmall = NULL;
+ fontHeader = NULL;
+ fontHeaderLarge = NULL;
+ pixmapHeader = NULL;
+ pixmapHeaderLogo = NULL;
+ pixmapContent = NULL;
+ pixmapTabs = NULL;
+ title = "";
+ subTitle = "";
+ dateTime = "";
+ infoText = "";
+ channel = NULL;
+ eventID = 0;
+ recFileName = "";
+ x = 0;
+ y = 0;
+ width = 0;
+ height = 0;
+ border = 0;
+ headerHeight = 0;
+ contentHeight = 0;
+ tabHeight = 0;
+ headerDrawn = false;
+}
+
+cNopacityView::~cNopacityView(void) {
+ if (font)
+ delete font;
+ if (fontSmall)
+ delete fontSmall;
+ if (fontHeader)
+ delete fontHeader;
+ if (fontHeaderLarge)
+ delete fontHeaderLarge;
+ if (pixmapHeader)
+ osd->DestroyPixmap(pixmapHeader);
+ if (pixmapHeaderLogo)
+ osd->DestroyPixmap(pixmapHeaderLogo);
+ if (pixmapContent)
+ osd->DestroyPixmap(pixmapContent);
+ if (pixmapTabs)
+ osd->DestroyPixmap(pixmapTabs);
+}
+
+void cNopacityView::SetGeometry(int x, int y, int width, int height, int border, int headerHeight) {
+ this->x = x;
+ this->y = y;
+ this->width = width;
+ this->height = height;
+ this->border = border;
+ this->headerHeight = headerHeight;
+ if (tabbed)
+ tabHeight = 2 * border;
+ contentHeight = height - headerHeight - tabHeight;
+}
+
+void cNopacityView::SetFonts(void) {
+ font = cFont::CreateFont(config.fontName, contentHeight / 25 + 3 + config.GetValue("fontDetailView"));
+ fontSmall = cFont::CreateFont(config.fontName, contentHeight / 30 + config.GetValue("fontDetailViewSmall"));
+ fontHeaderLarge = cFont::CreateFont(config.fontName, headerHeight / 4 + 5 + config.GetValue("fontDetailViewHeaderLarge"));
+ fontHeader = cFont::CreateFont(config.fontName, headerHeight / 6 + config.GetValue("fontDetailViewHeader"));
+}
+
+void cNopacityView::DrawHeader(void) {
+ if (!pixmapHeader) {
+ pixmapHeader = osd->CreatePixmap(4, cRect(x, y, width, headerHeight));
+ }
+ if (!pixmapHeaderLogo) {
+ pixmapHeaderLogo = osd->CreatePixmap(5, cRect(x, y, width, headerHeight));
+ }
+ pixmapHeader->Fill(Theme.Color(clrMenuDetailViewBack));
+ pixmapHeaderLogo->Fill(clrTransparent);
+ //Channel Logo
+ int logoWidth = config.GetValue("logoWidthOriginal");
+ int xText = 0;
+ if (channel) {
+ cImage *logo = imgCache->GetLogo(ctLogo, channel);
+ if (logo) {
+ pixmapHeaderLogo->DrawImage(cPoint(border, max((headerHeight - config.GetValue("logoHeightOriginal") - border)/2, 0)), *logo);
+ xText = logoWidth + 2*border;
+ }
+ }
+ //Date and Time, Title, Subtitle
+ int yDateTime = border;
+ int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2;
+ int ySubtitle = headerHeight - fontHeader->Height() - border;
+ pixmapHeader->DrawText(cPoint(xText, yDateTime), dateTime.c_str(), Theme.Color(clrMenuFontDetailViewHeader), Theme.Color(clrMenuDetailViewBack), fontHeader);
+ pixmapHeader->DrawText(cPoint(xText, yTitle), title.c_str(), Theme.Color(clrMenuFontDetailViewHeaderTitle), Theme.Color(clrMenuDetailViewBack), fontHeaderLarge);
+ pixmapHeader->DrawText(cPoint(xText, ySubtitle), subTitle.c_str(), Theme.Color(clrMenuFontDetailViewHeader), Theme.Color(clrMenuDetailViewBack), fontHeader);
+}
+
+void cNopacityView::DrawTabs(void) {
+ if (!pixmapTabs) {
+ pixmapTabs = osd->CreatePixmap(4, cRect(0, y + height - tabHeight, width, tabHeight));
+ }
+ tColor bgColor = Theme.Color(clrMenuDetailViewBack);
+ pixmapTabs->Fill(clrTransparent);
+ pixmapTabs->DrawRectangle(cRect(0, 0, width, 2), bgColor);
+ int numTabs = tabs.size();
+ int xCurrent = 0;
+ for (int tab = 0; tab < numTabs; tab++) {
+ std::string tabText = tabs[tab];
+ int textWidth = font->Width(tabText.c_str());
+ int tabWidth = textWidth + border;
+ pixmapTabs->DrawRectangle(cRect(xCurrent, (tab == activeView) ? 0 : 2, tabWidth - 2, tabHeight), bgColor);
+ pixmapTabs->DrawEllipse(cRect(xCurrent, tabHeight - border/2, border/2, border/2), clrTransparent, -3);
+ pixmapTabs->DrawEllipse(cRect(xCurrent + tabWidth - border / 2 - 2, tabHeight - border/2, border/2, border/2), clrTransparent, -4);
+ if (tab == activeView) {
+ pixmapTabs->DrawRectangle(cRect(xCurrent + 2, 0, tabWidth - 6, tabHeight - border/2 - 1), clrTransparent);
+ pixmapTabs->DrawRectangle(cRect(xCurrent + border / 2, tabHeight - border/2 - 1, tabWidth - border, border/2 - 1), clrTransparent);
+ pixmapTabs->DrawEllipse(cRect(xCurrent + 2, tabHeight - border/2 - 2, border/2, border/2), clrTransparent, 3);
+ pixmapTabs->DrawEllipse(cRect(xCurrent + tabWidth - border / 2 - 4, tabHeight - border/2 - 2, border/2, border/2), clrTransparent, 4);
+ }
+ pixmapTabs->DrawText(cPoint(xCurrent + (tabWidth - textWidth) / 2, 2 + (tabHeight - font->Height())/2), tabText.c_str(), Theme.Color(clrMenuFontDetailViewText), (tab == activeView) ? clrTransparent : bgColor, font);
+ xCurrent += tabWidth;
+ }
+}
+
+void cNopacityView::ClearContent(void) {
+ if (pixmapContent && Running()) {
+ osd->DestroyPixmap(pixmapContent);
+ pixmapContent = NULL;
+ }
+}
+
+void cNopacityView::CreateContent(int fullHeight) {
+ scrollable = false;
+ int drawPortHeight = contentHeight;
+ if (fullHeight > contentHeight) {
+ drawPortHeight = fullHeight;
+ scrollable = true;
+ }
+ pixmapContent = osd->CreatePixmap(4, cRect(x, y + headerHeight, width, contentHeight), cRect(0, 0, width, drawPortHeight));
+ pixmapContent->Fill(clrTransparent);
+}
+
+void cNopacityView::DrawContent(std::string *text) {
+ cTextWrapper wText;
+ wText.Set(text->c_str(), font, width - 2 * border);
+ int lineHeight = font->Height();
+ int textLines = wText.Lines();
+ int textHeight = lineHeight * textLines + border;
+ int yText = border;
+ CreateContent(textHeight);
+ for (int i=0; i < textLines; i++) {
+ pixmapContent->DrawText(cPoint(border, yText), wText.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font);
+ yText += lineHeight;
+ }
+}
+
+void cNopacityView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *img2) {
+ cTextWrapper wTextTall;
+ cTextWrapper wTextFull;
+ int imgWidth = img->width;
+ int imgHeight = img->height;
+ if (img2) {
+ imgWidth = max(img->width, img2->width);
+ imgHeight += img2->height + border;
+ }
+ CreateFloatingTextWrapper(&wTextTall, &wTextFull, infoText, imgWidth, imgHeight);
+ int lineHeight = font->Height();
+ int textLinesTall = wTextTall.Lines();
+ int textLinesFull = wTextFull.Lines();
+ int textHeight = lineHeight * (textLinesTall + textLinesFull) + border;
+ int yText = border;
+ CreateContent(max(textHeight, imgHeight + 2*border));
+ for (int i=0; i < textLinesTall; i++) {
+ pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font);
+ yText += lineHeight;
+ }
+ for (int i=0; i < textLinesFull; i++) {
+ pixmapContent->DrawText(cPoint(border, yText), wTextFull.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font);
+ yText += lineHeight;
+ }
+ osd->Flush();
+ cImageLoader imgLoader;
+ if (imgLoader.LoadPoster(img->path.c_str(), img->width, img->height)) {
+ if (Running() && pixmapContent)
+ pixmapContent->DrawImage(cPoint(width - img->width - border, border), imgLoader.GetImage());
+ }
+ if (!img2)
+ return;
+ osd->Flush();
+ if (imgLoader.LoadPoster(img2->path.c_str(), img2->width, img2->height)) {
+ if (Running() && pixmapContent)
+ pixmapContent->DrawImage(cPoint(width - img2->width - border, img->height + 2*border), imgLoader.GetImage());
+ }
+}
+
+void cNopacityView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg) {
+ int lineHeight = font->Height();
+ int linesNarrow = (heightImg + 2*border)/ lineHeight;
+ int linesDrawn = 0;
+ int y = 0;
+ int widthNarrow = width - 3 * border - widthImg;
+ bool drawNarrow = true;
+
+ splitstring s(text->c_str());
+ std::vector<std::string> flds = s.split('\n', 1);
+
+ if (flds.size() < 1)
+ return;
+
+ std::stringstream sstrTextTall;
+ std::stringstream sstrTextFull;
+
+ for (int i=0; i<flds.size(); i++) {
+ if (!flds[i].size()) {
+ //empty line
+ linesDrawn++;
+ y += lineHeight;
+ if (drawNarrow)
+ sstrTextTall << "\n";
+ else
+ sstrTextFull << "\n";
+ } else {
+ cTextWrapper wrapper;
+ if (drawNarrow) {
+ wrapper.Set((flds[i].c_str()), font, widthNarrow);
+ int newLines = wrapper.Lines();
+ //check if wrapper fits completely into narrow area
+ if (linesDrawn + newLines < linesNarrow) {
+ for (int line = 0; line < wrapper.Lines(); line++) {
+ sstrTextTall << wrapper.GetLine(line) << " ";
+ }
+ sstrTextTall << "\n";
+ linesDrawn += newLines;
+ } else {
+ //this wrapper has to be splitted
+ for (int line = 0; line < wrapper.Lines(); line++) {
+ if (line + linesDrawn < linesNarrow) {
+ sstrTextTall << wrapper.GetLine(line) << " ";
+ } else {
+ sstrTextFull << wrapper.GetLine(line) << " ";
+ }
+ }
+ drawNarrow = false;
+ }
+ } else {
+ for (int line = 0; line < wrapper.Lines(); line++) {
+ sstrTextFull << wrapper.GetLine(line) << " ";
+ }
+ sstrTextFull << "\n";
+ }
+ }
+ }
+ twNarrow->Set(sstrTextTall.str().c_str(), font, widthNarrow);
+ twFull->Set(sstrTextFull.str().c_str(), font, width - 2 * border);
+}
+
+void cNopacityView::DrawActors(std::vector<cActor> *actors) {
+ int numActors = actors->size();
+ if (numActors < 1) {
+ CreateContent(100);
+ pixmapContent->DrawText(cPoint(border, border), tr("No Cast available"), Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontHeaderLarge);
+ return;
+ }
+ int thumbWidth = actors->at(0).actorThumb.width;
+ int thumbHeight = actors->at(0).actorThumb.height;
+
+ int picsPerLine = width / (thumbWidth + 2 * border);
+ if (picsPerLine < 1)
+ return;
+
+ int picLines = numActors / picsPerLine;
+ if (numActors%picsPerLine != 0)
+ picLines++;
+
+ int totalHeight = picLines * (thumbHeight + 2*fontSmall->Height() + border + border/2) + 2*border + fontHeaderLarge->Height();
+
+ CreateContent(totalHeight);
+ cString header = cString::sprintf("%s:", tr("Cast"));
+ pixmapContent->DrawText(cPoint(border, border), *header, Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontHeaderLarge);
+
+ int x = 0;
+ int y = 2 * border + fontHeaderLarge->Height();
+ if (!Running())
+ return;
+ cImageLoader imgLoader;
+ int actor = 0;
+ for (int row = 0; row < picLines; row++) {
+ for (int col = 0; col < picsPerLine; col++) {
+ if (!Running())
+ return;
+ if (actor == numActors)
+ break;
+ std::string path = actors->at(actor).actorThumb.path;
+ std::string name = actors->at(actor).name;
+ std::stringstream sstrRole;
+ sstrRole << "\"" << actors->at(actor).role << "\"";
+ std::string role = sstrRole.str();
+ if (imgLoader.LoadPoster(path.c_str(), thumbWidth, thumbHeight)) {
+ if (Running() && pixmapContent)
+ pixmapContent->DrawImage(cPoint(x + border, y), imgLoader.GetImage());
+ }
+
+ if (fontSmall->Width(name.c_str()) > thumbWidth + 2*border)
+ name = CutText(name, thumbWidth + 2*border, fontSmall);
+ if (fontSmall->Width(role.c_str()) > thumbWidth + 2*border)
+ role = CutText(role, thumbWidth + 2*border, fontSmall);
+ int xName = x + ((thumbWidth+2*border) - fontSmall->Width(name.c_str()))/2;
+ int xRole = x + ((thumbWidth+2*border) - fontSmall->Width(role.c_str()))/2;
+ if (Running() && pixmapContent) {
+ pixmapContent->DrawText(cPoint(xName, y + thumbHeight + border/2), name.c_str(), Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontSmall);
+ pixmapContent->DrawText(cPoint(xRole, y + thumbHeight + border/2 + fontSmall->Height()), role.c_str(), Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontSmall);
+ x += thumbWidth + 2*border;
+ }
+ actor++;
+ }
+ osd->Flush();
+ x = 0;
+ y += thumbHeight + 2 * fontSmall->Height() + border + border/2;
+ }
+}
+
+void cNopacityView::ClearScrollbar(void) {
+ pixmapScrollbar->Fill(clrTransparent);
+ pixmapScrollbarBack->Fill(clrTransparent);
+}
+
+void cNopacityView::DrawScrollbar(void) {
+ ClearScrollbar();
+ if (!scrollable || !pixmapContent)
+ return;
+ int totalBarHeight = pixmapScrollbar->ViewPort().Height() - 6;
+
+ int aktHeight = (-1)*pixmapContent->DrawPort().Point().Y();
+ int totalHeight = pixmapContent->DrawPort().Height();
+ int screenHeight = pixmapContent->ViewPort().Height();
+
+ int barHeight = (double)(screenHeight * totalBarHeight) / (double)totalHeight ;
+ int barTop = (double)(aktHeight * totalBarHeight) / (double)totalHeight ;
+
+ if (config.GetValue("displayType") == dtGraphical) {
+ cImage *image = imgCache->GetSkinElement(seScrollbar);
+ if (image)
+ pixmapScrollbarBack->DrawImage(cPoint(0, 0), *image);
+ } else {
+ pixmapScrollbarBack->Fill(Theme.Color(clrMenuScrollBar));
+ pixmapScrollbarBack->DrawRectangle(cRect(2,2,geoManager->menuWidthScrollbar-4,totalHeight+2), Theme.Color(clrMenuScrollBarBack));
+ }
+
+ pixmapScrollbar->DrawRectangle(cRect(3,3 + barTop,geoManager->menuWidthScrollbar-6,barHeight), Theme.Color(clrMenuScrollBar));
+}
+
+bool cNopacityView::KeyUp(void) {
+ if (!scrollable)
+ return false;
+ int aktHeight = pixmapContent->DrawPort().Point().Y();
+ int lineHeight = font->Height();
+ if (aktHeight < 0) {
+ pixmapContent->SetDrawPortPoint(cPoint(0, aktHeight + lineHeight));
+ return true;
+ }
+ return false;
+}
+
+bool cNopacityView::KeyDown(void) {
+ if (!scrollable)
+ return false;
+ int aktHeight = pixmapContent->DrawPort().Point().Y();
+ int totalHeight = pixmapContent->DrawPort().Height();
+ int screenHeight = pixmapContent->ViewPort().Height();
+ int lineHeight = font->Height();
+ if (totalHeight - ((-1)*aktHeight) > screenHeight) {
+ pixmapContent->SetDrawPortPoint(cPoint(0, aktHeight - lineHeight));
+ return true;
+ }
+ return false;
+}
+
+/********************************************************************************************
+* cNopacityEPGView : cNopacityView
+********************************************************************************************/
+
+cNopacityEPGView::cNopacityEPGView(cOsd *osd, cImageCache *imgCache) : cNopacityView(osd, imgCache) {
+ tabbed = true;
+ pixmapHeaderEPGImage = NULL;
+ numEPGPics = -1;
+ numTabs = 0;
+}
+
+cNopacityEPGView::~cNopacityEPGView(void) {
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
+ if (pixmapHeaderEPGImage)
+ osd->DestroyPixmap(pixmapHeaderEPGImage);
+}
+
+void cNopacityEPGView::SetTabs(void) {
+ tabs.push_back(tr("EPG Info"));
+ if (eventID > 0)
+ tabs.push_back(tr("Reruns"));
+ else
+ tabs.push_back(tr("Recording Information"));
+ if (numEPGPics > 0)
+ tabs.push_back(tr("Image Galery"));
+ numTabs = tabs.size();
+}
+
+void cNopacityEPGView::DrawHeaderEPGImage(void) {
+ cImageLoader imgLoader;
+ if (eventID > 0) {
+ if (!imgLoader.LoadEPGImage(eventID))
+ return;
+ } else if (recFileName.size() > 0) {
+ if (!imgLoader.LoadRecordingImage(recFileName.c_str()))
+ return;
+ } else
+ return;
+
+ if (!pixmapHeaderEPGImage) {
+ pixmapHeaderEPGImage = osd->CreatePixmap(3, cRect(x, y, width, headerHeight));
+ }
+
+ int imgWidthOrig = config.GetValue("epgImageWidth");
+ int imgHeightOrig = config.GetValue("epgImageHeight");
+
+ int imgWidth = imgWidthOrig;
+ int imgHeight = imgHeightOrig;
+
+ if (imgHeight > (headerHeight-10)) {
+ imgHeight = headerHeight - 10;
+ imgWidth = imgWidthOrig * ((double)imgHeight / (double)imgHeightOrig);
+ }
+
+ pixmapHeaderEPGImage->Fill(clrTransparent);
+ pixmapHeaderEPGImage->DrawImage(cPoint(width - imgWidth - border, (headerHeight - imgHeight)/2), imgLoader.GetImage());
+}
+
+void cNopacityEPGView::CheckEPGImages(void) {
+ if (eventID > 0) {
+ for (int i=1; i <= config.GetValue("numAdditionalEPGPictures"); i++) {
+ cString epgimage;
+ if (config.epgImagePathSet) {
+ epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePath, eventID, i);
+ } else {
+ epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePathDefault, eventID, i);
+ }
+ FILE *fp = fopen(*epgimage, "r");
+ if (fp) {
+ std::stringstream ss;
+ ss << i;
+ epgPics.push_back(ss.str());
+ fclose(fp);
+ } else {
+ break;
+ }
+ }
+ } else if (recFileName.size() > 0) {
+ DIR *dirHandle;
+ struct dirent *dirEntry;
+ dirHandle = opendir(recFileName.c_str());
+ int picsFound = 0;
+ if (dirHandle != NULL) {
+ while ( 0 != (dirEntry = readdir(dirHandle))) {
+ if (endswith(dirEntry->d_name, "jpg")) {
+ std::string fileName = dirEntry->d_name;
+ if (fileName.length() > 4) {
+ fileName = fileName.substr(0, fileName.length() - 4);
+ epgPics.push_back(fileName);
+ picsFound++;
+ }
+ }
+ if (picsFound >= config.GetValue("numAdditionalRecEPGPictures")) {
+ break;
+ }
+ }
+ closedir(dirHandle);
+ }
+ } else {
+ return;
+ }
+ numEPGPics = epgPics.size();
+}
+
+void cNopacityEPGView::DrawImages(void) {
+ int imgWidth = config.GetValue("epgImageWidthLarge");
+ int imgHeight = config.GetValue("epgImageHeightLarge");
+
+ int totalHeight = numEPGPics * (imgHeight + border);
+
+ CreateContent(totalHeight);
+
+ cImageLoader imgLoader;
+ int yPic = border;
+ for (int pic = 0; pic < numEPGPics; pic++) {
+ bool drawPic = false;
+ if (eventID > 0) {
+ cString epgimage = cString::sprintf("%d_%d", eventID, atoi(epgPics[pic].c_str()));
+ if (imgLoader.LoadAdditionalEPGImage(epgimage)) {
+ drawPic = true;
+ }
+
+ } else if (recFileName.size() > 0) {
+ std::string path = recFileName + "/";
+ if (imgLoader.LoadAdditionalRecordingImage(path.c_str(), epgPics[pic].c_str())) {
+ drawPic = true;
+ }
+ }
+ if (drawPic) {
+ pixmapContent->DrawImage(cPoint((width - imgWidth) / 2, yPic), imgLoader.GetImage());
+ yPic += imgHeight + border;
+ osd->Flush();
+ }
+ }
+}
+
+void cNopacityEPGView::KeyLeft(void) {
+ if (Running())
+ return;
+ activeView--;
+ if (activeView < 0)
+ activeView = numTabs - 1;
+}
+
+void cNopacityEPGView::KeyRight(void) {
+ if (Running())
+ return;
+ activeView = (activeView + 1) % numTabs;
+}
+
+void cNopacityEPGView::Action(void) {
+ ClearContent();
+ if (!headerDrawn) {
+ DrawHeader();
+ osd->Flush();
+ DrawHeaderEPGImage();
+ osd->Flush();
+ headerDrawn = true;
+ }
+ if (tabs.size() == 0) {
+ CheckEPGImages();
+ SetTabs();
+ }
+ DrawTabs();
+ switch (activeView) {
+ case evtInfo:
+ DrawContent(&infoText);
+ break;
+ case evtAddInfo:
+ DrawContent(&addInfoText);
+ break;
+ case evtImages:
+ DrawImages();
+ break;
+ }
+ DrawScrollbar();
+ osd->Flush();
+}
+
+/********************************************************************************************
+* cNopacitySeriesView : cNopacityView
+********************************************************************************************/
+
+cNopacitySeriesView::cNopacitySeriesView(cOsd *osd, cImageCache *imgCache, int seriesId, int episodeId) : cNopacityView(osd, imgCache) {
+ this->seriesId = seriesId;
+ this->episodeId = episodeId;
+ tvdbInfo = "";
+ pixmapHeaderBanner = NULL;
+ tabbed = true;
+ SetTabs();
+}
+
+cNopacitySeriesView::~cNopacitySeriesView(void) {
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
+ if (pixmapHeaderBanner)
+ osd->DestroyPixmap(pixmapHeaderBanner);
+}
+
+void cNopacitySeriesView::LoadMedia(void) {
+ static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
+ if (!pScraper2Vdr || seriesId < 1)
+ return;
+ series.seriesId = seriesId;
+ series.episodeId = episodeId;
+ pScraper2Vdr->Service("GetSeries", &series);
+}
+
+void cNopacitySeriesView::SetTabs(void) {
+ tabs.push_back(tr("EPG Info"));
+ tabs.push_back(tr("Reruns"));
+ tabs.push_back(tr("Cast"));
+ tabs.push_back(tr("TheTVDB Info"));
+ tabs.push_back(tr("Image Galery"));
+}
+
+void cNopacitySeriesView::CreateTVDBInfo(void) {
+ if (tvdbInfo.size() > 0)
+ return;
+ std::stringstream info;
+ info << tr("TheTVDB Information") << ":\n\n";
+
+ if (series.episode.name.size() > 0) {
+ info << tr("Episode") << ": " << series.episode.name << " (" << tr("Season") << " " << series.episode.season << ", " << tr("Episode") << " " << series.episode.number << ")\n\n";
+ }
+ if (series.episode.overview.size() > 0) {
+ info << tr("Episode Overview") << ": " << series.episode.overview << "\n\n";
+ }
+ if (series.episode.firstAired.size() > 0) {
+ info << tr("First aired") << ": " << series.episode.firstAired << "\n\n";
+ }
+ if (series.episode.guestStars.size() > 0) {
+ info << tr("Guest Stars") << ": " << series.episode.guestStars << "\n\n";
+ }
+ if (series.episode.rating > 0) {
+ info << tr("TheMovieDB Rating") << ": " << series.episode.rating << "\n\n";
+ }
+ if (series.overview.size() > 0) {
+ info << tr("Series Overview") << ": " << series.overview << "\n\n";
+ }
+ if (series.firstAired.size() > 0) {
+ info << tr("First aired") << ": " << series.firstAired << "\n\n";
+ }
+ if (series.genre.size() > 0) {
+ info << tr("Genre") << ": " << series.genre << "\n\n";
+ }
+ if (series.network.size() > 0) {
+ info << tr("Network") << ": " << series.network << "\n\n";
+ }
+ if (series.rating > 0) {
+ info << tr("TheMovieDB Rating") << ": " << series.rating << "\n\n";
+ }
+ if (series.status.size() > 0) {
+ info << tr("Status") << ": " << series.status << "\n\n";
+ }
+ tvdbInfo = info.str();
+}
+
+void cNopacitySeriesView::DrawHeaderBanner(void) {
+ if (series.banners.size() == 0)
+ return;
+ if (series.banners[0].height == 0)
+ return;
+
+ int bannerWidthOrig = series.banners[0].width;
+ int bannerHeightOrig = series.banners[0].height;
+ std::string bannerPath = series.banners[0].path;
+
+ if (bannerWidthOrig == 0)
+ return;
+
+ int bannerWidth = bannerWidthOrig;
+ int bannerHeight = bannerHeightOrig;
+
+ if (headerHeight < bannerHeightOrig) {
+ bannerHeight = headerHeight;
+ bannerWidth = bannerWidthOrig * ((double)bannerHeight / (double)bannerHeightOrig);
+ }
+
+ int bannerX = width - bannerWidth - border;
+ int bannerY = (headerHeight - bannerHeight) / 2;
+
+ if (!pixmapHeaderBanner) {
+ pixmapHeaderBanner = osd->CreatePixmap(3, cRect(x, y, width, headerHeight));
+ }
+ pixmapHeaderBanner->Fill(clrTransparent);
+
+ cImageLoader imgLoader;
+ if (imgLoader.LoadPoster(bannerPath.c_str(), bannerWidth, bannerHeight) && Running()) {
+ pixmapHeaderBanner->DrawImage(cPoint(bannerX, bannerY), imgLoader.GetImage());
+ }
+}
+
+void cNopacitySeriesView::DrawImages(void) {
+ int numPosters = series.posters.size();
+ int numFanarts = series.fanarts.size();
+ int numBanners = series.banners.size();
+
+ int totalHeight = border;
+ //Fanart Height
+ int fanartWidth = width - 2 * border;
+ int fanartHeight = 0;
+ if (numFanarts > 0 && series.fanarts[0].width > 0) {
+ fanartHeight = series.fanarts[0].height * ((double)fanartWidth / (double)series.fanarts[0].width);
+ totalHeight += series.fanarts.size() * (fanartHeight + border);
+ }
+ //Poster Height
+ int posterWidth = (width - 4 * border) / 2;
+ int posterHeight = 0;
+ if (numPosters > 0 && series.posters[0].width > 0) {
+ posterHeight = series.posters[0].height * ((double)posterWidth / (double)series.posters[0].width);
+ }
+ if (numPosters > 0)
+ totalHeight += posterHeight + border;
+ if (numPosters == 3)
+ totalHeight += posterHeight + border;
+ //Banners Height
+ if (numBanners > 0)
+ totalHeight += (series.banners[0].height + border) * numBanners;
+
+ CreateContent(totalHeight);
+
+ cImageLoader imgLoader;
+ int yPic = border;
+ for (int i=0; i < numFanarts; i++) {
+ if (numBanners > i) {
+ if (imgLoader.LoadPoster(series.banners[i].path.c_str(), series.banners[i].width, series.banners[i].height) && Running()) {
+ pixmapContent->DrawImage(cPoint((width - series.banners[i].width) / 2, yPic), imgLoader.GetImage());
+ yPic += series.banners[i].height + border;
+ osd->Flush();
+ }
+ }
+ if (imgLoader.LoadPoster(series.fanarts[i].path.c_str(), fanartWidth, fanartHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage());
+ yPic += fanartHeight + border;
+ osd->Flush();
+ }
+ }
+ if (numPosters >= 1) {
+ if (imgLoader.LoadPoster(series.posters[0].path.c_str(), posterWidth, posterHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage());
+ osd->Flush();
+ yPic += posterHeight + border;
+ }
+ }
+ if (numPosters >= 2) {
+ if (imgLoader.LoadPoster(series.posters[1].path.c_str(), posterWidth, posterHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint(2 * border + posterWidth, yPic - posterHeight - border), imgLoader.GetImage());
+ osd->Flush();
+ }
+ }
+ if (numPosters == 3) {
+ if (imgLoader.LoadPoster(series.posters[2].path.c_str(), posterWidth, posterHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint((width - posterWidth) / 2, yPic), imgLoader.GetImage());
+ osd->Flush();
+ }
+ }
+}
+
+int cNopacitySeriesView::GetRandomPoster(void) {
+ int numPosters = series.posters.size();
+ if (numPosters == 0)
+ return -1;
+ srand((unsigned)time(NULL));
+ int randPoster = rand()%numPosters;
+ return randPoster;
+}
+
+void cNopacitySeriesView::KeyLeft(void) {
+ if (Running())
+ return;
+ activeView--;
+ if (activeView < 0)
+ activeView = mvtCount - 1;
+}
+
+void cNopacitySeriesView::KeyRight(void) {
+ if (Running())
+ return;
+ activeView = (activeView + 1) % mvtCount;
+}
+
+void cNopacitySeriesView::Action(void) {
+ ClearContent();
+ if (!headerDrawn) {
+ DrawHeader();
+ osd->Flush();
+ DrawHeaderBanner();
+ osd->Flush();
+ headerDrawn = true;
+ }
+ DrawTabs();
+ int randomPoster = GetRandomPoster();
+ switch (activeView) {
+ case mvtInfo:
+ if (randomPoster >= 0)
+ DrawFloatingContent(&infoText, &series.posters[randomPoster]);
+ else
+ DrawContent(&infoText);
+ break;
+ case mvtAddInfo:
+ if (randomPoster >= 0)
+ DrawFloatingContent(&addInfoText, &series.posters[randomPoster]);
+ else
+ DrawContent(&addInfoText);
+ break;
+ case mvtCast:
+ DrawActors(&series.actors);
+ break;
+ case mvtOnlineInfo:
+ CreateTVDBInfo();
+ if ((series.seasonPoster.path.size() > 0) && series.episode.episodeImage.path.size() > 0)
+ DrawFloatingContent(&tvdbInfo, &series.episode.episodeImage, &series.seasonPoster);
+ else if (series.seasonPoster.path.size() > 0)
+ DrawFloatingContent(&tvdbInfo, &series.seasonPoster);
+ else if (series.episode.episodeImage.path.size() > 0)
+ DrawFloatingContent(&tvdbInfo, &series.episode.episodeImage);
+ else if (randomPoster >= 0)
+ DrawFloatingContent(&tvdbInfo, &series.posters[randomPoster]);
+ else
+ DrawContent(&tvdbInfo);
+ break;
+ case mvtImages:
+ DrawImages();
+ break;
+ }
+ DrawScrollbar();
+ osd->Flush();
+}
+
+/********************************************************************************************
+* cNopacityMovieView : cNopacityView
+********************************************************************************************/
+
+cNopacityMovieView::cNopacityMovieView(cOsd *osd, cImageCache *imgCache, int movieId) : cNopacityView(osd, imgCache) {
+ this->movieId = movieId;
+ pixmapHeaderPoster = NULL;
+ tabbed = true;
+ SetTabs();
+}
+
+cNopacityMovieView::~cNopacityMovieView(void) {
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
+ if (pixmapHeaderPoster)
+ osd->DestroyPixmap(pixmapHeaderPoster);
+}
+
+void cNopacityMovieView::LoadMedia(void) {
+ static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
+ if (!pScraper2Vdr || movieId < 1)
+ return;
+ movie.movieId = movieId;
+ pScraper2Vdr->Service("GetMovie", &movie);
+}
+
+void cNopacityMovieView::SetTabs(void) {
+ tabs.push_back(tr("EPG Info"));
+ tabs.push_back(tr("Reruns"));
+ tabs.push_back(tr("Cast"));
+ tabs.push_back(tr("TheTVDB Info"));
+ tabs.push_back(tr("Image Galery"));
+}
+
+void cNopacityMovieView::CreateMovieDBInfo(void) {
+ if (movieDBInfo.size() > 0)
+ return;
+ std::stringstream info;
+ info << tr("TheMovieDB Information") << ":\n\n";
+ if (movie.originalTitle.size() > 0) {
+ info << tr("Original Title") << ": " << movie.originalTitle << "\n\n";
+ }
+ if (movie.tagline.size() > 0) {
+ info << tr("Tagline") << ": " << movie.tagline << "\n\n";
+ }
+ if (movie.overview.size() > 0) {
+ info << tr("Overview") << ": " << movie.overview << "\n\n";
+ }
+ std::string strAdult = (movie.adult)?(tr("yes")):(tr("no"));
+ info << tr("Adult") << ": " << strAdult << "\n\n";
+ if (movie.collectionName.size() > 0) {
+ info << tr("Collection") << ": " << movie.collectionName << "\n\n";
+ }
+ if (movie.budget > 0) {
+ info << tr("Budget") << ": " << movie.budget << "$\n\n";
+ }
+ if (movie.revenue > 0) {
+ info << tr("Revenue") << ": " << movie.revenue << "$\n\n";
+ }
+ if (movie.genres.size() > 0) {
+ info << tr("Genre") << ": " << movie.genres << "\n\n";
+ }
+ if (movie.homepage.size() > 0) {
+ info << tr("Homepage") << ": " << movie.homepage << "\n\n";
+ }
+ if (movie.releaseDate.size() > 0) {
+ info << tr("Release Date") << ": " << movie.releaseDate << "\n\n";
+ }
+ if (movie.runtime > 0) {
+ info << tr("Runtime") << ": " << movie.runtime << " " << tr("minutes") << "\n\n";
+ }
+ if (movie.popularity > 0) {
+ info << tr("TheMovieDB Popularity") << ": " << movie.popularity << "\n\n";
+ }
+ if (movie.voteAverage > 0) {
+ info << tr("TheMovieDB Vote Average") << ": " << movie.voteAverage << "\n\n";
+ }
+ movieDBInfo = info.str();
+}
+
+void cNopacityMovieView::DrawHeaderPoster(void) {
+ if (movie.poster.width == 0 || movie.poster.height == 0 || movie.poster.path.size() == 0)
+ return;
+
+ int posterHeight = headerHeight - 10;
+ int posterWidth = movie.poster.width * ((double)posterHeight / (double)movie.poster.height);;
+ int posterX = width - posterWidth - border;
+ int posterY = (headerHeight - posterHeight) / 2;
+
+ if (!pixmapHeaderPoster) {
+ pixmapHeaderPoster = osd->CreatePixmap(3, cRect(x, y, width, headerHeight));
+ }
+ pixmapHeaderPoster->Fill(clrTransparent);
+
+ cImageLoader imgLoader;
+ if (imgLoader.LoadPoster(movie.poster.path.c_str(), posterWidth, posterHeight) && Running()) {
+ pixmapHeaderPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage());
+ }
+}
+
+void cNopacityMovieView::DrawImages(void) {
+ int totalHeight = border;
+ //Fanart Height
+ int fanartWidth = width - 2 * border;
+ int fanartHeight = 0;
+ if (movie.fanart.width > 0 && movie.fanart.height > 0 && movie.fanart.path.size() > 0) {
+ fanartHeight = movie.fanart.height * ((double)fanartWidth / (double)movie.fanart.width);
+ totalHeight += fanartHeight + border;
+ }
+ //Collection Fanart Height
+ int collectionFanartWidth = width - 2 * border;
+ int collectionFanartHeight = 0;
+ if (movie.collectionFanart.width > 0 && movie.collectionFanart.height > 0 && movie.collectionFanart.path.size() > 0) {
+ collectionFanartHeight = movie.collectionFanart.height * ((double)collectionFanartWidth / (double)movie.collectionFanart.width);
+ totalHeight += collectionFanartHeight + border;
+ }
+ //Poster Height
+ if (movie.poster.width > 0 && movie.poster.height > 0 && movie.poster.path.size() > 0) {
+ totalHeight += movie.poster.height + border;
+ }
+ //Collection Popster Height
+ if (movie.collectionPoster.width > 0 && movie.collectionPoster.height > 0 && movie.collectionPoster.path.size() > 0) {
+ totalHeight += movie.collectionPoster.height + border;
+ }
+
+ CreateContent(totalHeight);
+
+ cImageLoader imgLoader;
+ int yPic = border;
+ if (movie.fanart.width > 0 && movie.fanart.height > 0 && movie.fanart.path.size() > 0) {
+ if (imgLoader.LoadPoster(movie.fanart.path.c_str(), fanartWidth, fanartHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage());
+ yPic += fanartHeight + border;
+ osd->Flush();
+ }
+ }
+ if (movie.collectionFanart.width > 0 && movie.collectionFanart.height > 0 && movie.collectionFanart.path.size() > 0) {
+ if (imgLoader.LoadPoster(movie.collectionFanart.path.c_str(), collectionFanartWidth, collectionFanartHeight) && Running()) {
+ pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage());
+ yPic += collectionFanartHeight + border;
+ osd->Flush();
+ }
+ }
+ if (movie.poster.width > 0 && movie.poster.height > 0 && movie.poster.path.size() > 0) {
+ if (imgLoader.LoadPoster(movie.poster.path.c_str(), movie.poster.width, movie.poster.height) && Running()) {
+ pixmapContent->DrawImage(cPoint((width - movie.poster.width) / 2, yPic), imgLoader.GetImage());
+ yPic += movie.poster.height + border;
+ osd->Flush();
+ }
+ }
+ if (movie.collectionPoster.width > 0 && movie.collectionPoster.height > 0 && movie.collectionPoster.path.size() > 0) {
+ if (imgLoader.LoadPoster(movie.collectionPoster.path.c_str(), movie.collectionPoster.width, movie.collectionPoster.height) && Running()) {
+ pixmapContent->DrawImage(cPoint((width - movie.collectionPoster.width) / 2, yPic), imgLoader.GetImage());
+ yPic += movie.collectionPoster.height + border;
+ osd->Flush();
+ }
+ }
+}
+
+void cNopacityMovieView::KeyLeft(void) {
+ if (Running())
+ return;
+ activeView--;
+ if (activeView < 0)
+ activeView = mvtCount - 1;
+}
+
+void cNopacityMovieView::KeyRight(void) {
+ if (Running())
+ return;
+ activeView = (activeView + 1) % mvtCount;
+}
+
+void cNopacityMovieView::Action(void) {
+ ClearContent();
+ if (!headerDrawn) {
+ DrawHeader();
+ osd->Flush();
+ DrawHeaderPoster();
+ osd->Flush();
+ headerDrawn = true;
+ }
+ DrawTabs();
+ bool posterAvailable = (movie.poster.path.size() > 0 && movie.poster.width > 0 && movie.poster.height > 0) ? true : false;
+ switch (activeView) {
+ case mvtInfo:
+ if (posterAvailable)
+ DrawFloatingContent(&infoText, &movie.poster);
+ else
+ DrawContent(&infoText);
+ break;
+ case mvtAddInfo:
+ if (posterAvailable)
+ DrawFloatingContent(&addInfoText, &movie.poster);
+ else
+ DrawContent(&addInfoText);
+ break;
+ case mvtCast:
+ DrawActors(&movie.actors);
+ break;
+ case mvtOnlineInfo:
+ CreateMovieDBInfo();
+ if (posterAvailable)
+ DrawFloatingContent(&movieDBInfo, &movie.poster);
+ else
+ DrawContent(&movieDBInfo);
+ break;
+ case mvtImages:
+ DrawImages();
+ break;
+ }
+ DrawScrollbar();
+ osd->Flush();
+}
+
+/********************************************************************************************
+* cNopacityTextView : cNopacityView
+********************************************************************************************/
+
+cNopacityTextView::cNopacityTextView(cOsd *osd, cImageCache *imgCache) : cNopacityView(osd, imgCache) {
+}
+
+cNopacityTextView::~cNopacityTextView(void) {
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
+}
+
+void cNopacityTextView::KeyLeft(void) {
+ if (!pixmapContent)
+ return;
+ int aktHeight = pixmapContent->DrawPort().Point().Y();
+ int screenHeight = pixmapContent->ViewPort().Height();
+ int newY = aktHeight + screenHeight;
+ if (newY > 0)
+ newY = 0;
+ pixmapContent->SetDrawPortPoint(cPoint(0, newY));
+ DrawScrollbar();
+ osd->Flush();
+}
+
+void cNopacityTextView::KeyRight(void) {
+ if (!pixmapContent)
+ return;
+ int aktHeight = pixmapContent->DrawPort().Point().Y();
+ int screenHeight = pixmapContent->ViewPort().Height();
+ int totalHeight = pixmapContent->DrawPort().Height();
+ int newY = aktHeight - screenHeight;
+ if ((-1)*newY > totalHeight - screenHeight)
+ newY = (-1)*(totalHeight - screenHeight);
+ pixmapContent->SetDrawPortPoint(cPoint(0, newY));
+ DrawScrollbar();
+ osd->Flush();
+}
+
+void cNopacityTextView::Action(void) {
+ if (pixmapContent)
+ return;
+ DrawContent(&infoText);
+ DrawScrollbar();
+ osd->Flush();
+}
diff --git a/detailview.h b/detailview.h
new file mode 100644
index 0000000..f3b03ec
--- /dev/null
+++ b/detailview.h
@@ -0,0 +1,160 @@
+#ifndef __NOPACITY_DETAILVIEW_H
+#define __NOPACITY_DETAILVIEW_H
+
+#include <vector>
+#include <string>
+#include <sstream>
+#include <vdr/skins.h>
+#include "services/scraper2vdr.h"
+#include "services/epgsearch.h"
+#include "config.h"
+#include "imagecache.h"
+#include "imageloader.h"
+#include "helpers.h"
+
+enum eEPGViewTabs {
+ evtInfo = 0,
+ evtAddInfo,
+ evtImages,
+ evtCount
+};
+
+enum eMediaViewTabs {
+ mvtInfo = 0,
+ mvtAddInfo,
+ mvtCast,
+ mvtOnlineInfo,
+ mvtImages,
+ mvtCount
+};
+
+class cNopacityView : public cThread {
+protected:
+ cOsd *osd;
+ cImageCache *imgCache;
+ cPixmap *pixmapHeader;
+ cPixmap *pixmapHeaderLogo;
+ cPixmap *pixmapContent;
+ cPixmap *pixmapScrollbar;
+ cPixmap *pixmapScrollbarBack;
+ cPixmap *pixmapTabs;
+ cFont *font, *fontSmall, *fontHeader, *fontHeaderLarge;
+ int activeView;
+ bool scrollable;
+ bool tabbed;
+ int x, y;
+ int width, height;
+ int border;
+ int headerHeight, contentHeight, tabHeight;
+ std::vector<std::string> tabs;
+ std::string title;
+ std::string subTitle;
+ std::string dateTime;
+ std::string infoText;
+ std::string addInfoText;
+ const cChannel *channel;
+ int eventID;
+ std::string recFileName;
+ bool headerDrawn;
+ void DrawHeader(void);
+ void ClearContent(void);
+ void CreateContent(int fullHeight);
+ void DrawContent(std::string *text);
+ void DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *img2 = NULL);
+ void CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg);
+ void DrawActors(std::vector<cActor> *actors);
+ void ClearScrollbar(void);
+ virtual void SetTabs(void) {};
+ void DrawTabs(void);
+public:
+ cNopacityView(cOsd *osd, cImageCache *imgCache);
+ virtual ~cNopacityView(void);
+ void SetTitle(const char *t) { title = t ? t : ""; };
+ void SetSubTitle(const char *s) { subTitle = s ? s : ""; };
+ void SetDateTime(const char *dt) { dateTime = dt; };
+ void SetInfoText(const char *i) { infoText = i ? i : ""; };
+ void SetAdditionalInfoText(std::string addInfo) { addInfoText = addInfo; };
+ void SetChannel(const cChannel *c) { channel = c; };
+ void SetEventID(int id) { eventID = id; };
+ void SetRecFileName(const char *name) { recFileName = name ? name : ""; };
+ virtual void LoadMedia(void) {};
+ void SetGeometry(int x, int y, int width, int height, int border, int headerHeight);
+ void SetFonts(void);
+ void SetScrollbarPixmaps(cPixmap *s, cPixmap *sb) { pixmapScrollbar = s; pixmapScrollbarBack = sb; };
+ virtual bool KeyUp(void);
+ virtual bool KeyDown(void);
+ virtual void KeyLeft(void) {};
+ virtual void KeyRight(void) {};
+ void DrawScrollbar(void);
+ virtual void Action(void) {};
+};
+
+class cNopacityEPGView : public cNopacityView {
+protected:
+ cPixmap *pixmapHeaderEPGImage;
+ std::vector<std::string> epgPics;
+ int numEPGPics;
+ int numTabs;
+ void SetTabs(void);
+ void DrawHeaderEPGImage(void);
+ void CheckEPGImages(void);
+ void DrawImages(void);
+public:
+ cNopacityEPGView(cOsd *osd, cImageCache *imgCache);
+ virtual ~cNopacityEPGView(void);
+ void KeyLeft(void);
+ void KeyRight(void);
+ void Action(void);
+};
+
+class cNopacitySeriesView : public cNopacityView {
+protected:
+ cPixmap *pixmapHeaderBanner;
+ int seriesId;
+ int episodeId;
+ cSeries series;
+ std::string tvdbInfo;
+ void SetTabs(void);
+ void CreateTVDBInfo(void);
+ void DrawHeaderBanner(void);
+ void DrawImages(void);
+ int GetRandomPoster(void);
+public:
+ cNopacitySeriesView(cOsd *osd, cImageCache *imgCache, int seriesId, int episodeId);
+ virtual ~cNopacitySeriesView(void);
+ void LoadMedia(void);
+ void KeyLeft(void);
+ void KeyRight(void);
+ void Action(void);
+};
+
+class cNopacityMovieView : public cNopacityView {
+protected:
+ cPixmap *pixmapHeaderPoster;
+ int movieId;
+ cMovie movie;
+ std::string movieDBInfo;
+ void SetTabs(void);
+ void CreateMovieDBInfo(void);
+ void DrawHeaderPoster(void);
+ void DrawImages(void);
+public:
+ cNopacityMovieView(cOsd *osd, cImageCache *imgCache, int movieId);
+ virtual ~cNopacityMovieView(void);
+ void LoadMedia(void);
+ void KeyLeft(void);
+ void KeyRight(void);
+ void Action(void);
+};
+
+class cNopacityTextView : public cNopacityView {
+protected:
+public:
+ cNopacityTextView(cOsd *osd, cImageCache *imgCache);
+ virtual ~cNopacityTextView(void);
+ void KeyLeft(void);
+ void KeyRight(void);
+ void Action(void);
+};
+
+#endif //__NOPACITY_DETAILVIEW_H \ No newline at end of file
diff --git a/displaychannel.c b/displaychannel.c
index 73ccc73..ac9e179 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -66,7 +66,6 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
} else {
ChannelName = ChannelString(NULL, 0);
}
-
channelView->ClearChannelLogo();
channelView->ClearChannelName();
channelView->ClearEPGInfo();
diff --git a/displaymenu.c b/displaymenu.c
index dad02db..9c5dfeb 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -152,13 +152,9 @@ void cNopacityDisplayMenu::DrawTimers(bool timersChanged, int numConflicts) {
}
void cNopacityDisplayMenu::Scroll(bool Up, bool Page) {
- bool scrolled;
- scrolled = detailView->Scroll(Up, Page);
- if (scrolled) {
- double height = detailView->ScrollbarSize();
- double offset = detailView->Offset();
- menuView->DrawScrollbar(height, offset);
- }
+ if (!detailView)
+ return;
+ detailView->KeyInput(Up, Page);
}
int cNopacityDisplayMenu::MaxItems(void) {
@@ -373,6 +369,7 @@ void cNopacityDisplayMenu::SetMessage(eMessageType Type, const char *Text) {
bool cNopacityDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current,
bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) {
+
if (!config.GetValue("narrowScheduleMenu"))
return false;
if ((initMenu)&&(Index > menuItemIndexLast)) {
@@ -672,18 +669,9 @@ void cNopacityDisplayMenu::SetEvent(const cEvent *Event) {
if (!Event)
return;
menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect);
- detailView = new cNopacityMenuDetailEventView(osd, imgCache, Event);
+ detailView = new cNopacityDetailView(dvEvent, osd, imgCache);
menuView->SetDetailViewSize(dvEvent, detailView);
- detailView->SetFonts();
- detailView->SetContent();
- detailView->SetContentHeight();
- detailView->CreatePixmaps();
- detailView->Render();
- if (detailView->Scrollable()) {
- double height = detailView->ScrollbarSize();
- double offset = 0.0;
- menuView->DrawScrollbar(height, offset);
- }
+ detailView->SetEvent(Event);
detailView->Start();
}
@@ -695,18 +683,9 @@ void cNopacityDisplayMenu::SetRecording(const cRecording *Recording) {
return;
}
menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect);
- detailView = new cNopacityMenuDetailRecordingView(osd, Recording);
+ detailView = new cNopacityDetailView(dvRecording, osd, imgCache);
menuView->SetDetailViewSize(dvRecording, detailView);
- detailView->SetFonts();
- detailView->SetContent();
- detailView->SetContentHeight();
- detailView->CreatePixmaps();
- detailView->Render();
- if (detailView->Scrollable()) {
- double height = detailView->ScrollbarSize();
- double offset = 0.0;
- menuView->DrawScrollbar(height, offset);
- }
+ detailView->SetRecording(Recording);
detailView->Start();
}
@@ -714,18 +693,10 @@ void cNopacityDisplayMenu::SetText(const char *Text, bool FixedFont) {
if (!Text)
return;
menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect);
- detailView = new cNopacityMenuDetailTextView(osd, Text);
+ detailView = new cNopacityDetailView(dvText, osd, imgCache);
menuView->SetDetailViewSize(dvText, detailView);
- detailView->SetFonts();
- detailView->SetContent();
- detailView->SetContentHeight();
- detailView->CreatePixmaps();
- detailView->Render();
- if (detailView->Scrollable()) {
- double height = detailView->ScrollbarSize();
- double offset = 0.0;
- menuView->DrawScrollbar(height, offset);
- }
+ detailView->SetText(Text);
+ detailView->Start();
}
void cNopacityDisplayMenu::Flush(void) {
diff --git a/displaymenu.h b/displaymenu.h
index f88543b..761bb51 100644
--- a/displaymenu.h
+++ b/displaymenu.h
@@ -9,7 +9,7 @@ class cNopacityDisplayMenu : public cSkinDisplayMenu , cThread {
private:
cImageCache *imgCache;
cNopacityDisplayMenuView *menuView;
- cNopacityMenuDetailView *detailView;
+ cNopacityDetailView *detailView;
cOsd *osd;
eMenuCategory menuCategoryLast;
int FrameTime;
diff --git a/displaymenuview.c b/displaymenuview.c
index 09a07f2..9a94f25 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -736,7 +736,7 @@ void cNopacityDisplayMenuView::ClearMessage(void) {
}
}
-void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, cNopacityMenuDetailView *detailView) {
+void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, cNopacityDetailView *detailView) {
int x = (config.GetValue("menuAdjustLeft")) ? 0 : geoManager->osdWidth - geoManager->menuContentWidthFull + 2*geoManager->menuSpace;
int width = 0;
int height = 0;
@@ -744,13 +744,17 @@ void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType,
int contentBorder = 30;
int detailHeaderHeight = 0;
+ width = geoManager->menuContentWidthFull - 2*geoManager->menuSpace;
+ height = geoManager->menuContentHeight;
+ top = geoManager->menuHeaderHeight;
+
switch (detailViewType) {
case dvEvent:
- detailHeaderHeight = max(config.GetValue("logoHeightOriginal"), config.GetValue("epgImageHeight"))+4;
+ detailHeaderHeight = config.GetValue("headerDetailedEPG") * height / 100;
contentBorder = config.GetValue("borderDetailedEPG");
break;
case dvRecording:
- detailHeaderHeight = config.GetValue("epgImageHeight") + 4;
+ detailHeaderHeight = config.GetValue("headerDetailedRecordings") * height / 100;
contentBorder = config.GetValue("borderDetailedRecordings");
break;
case dvText:
@@ -759,8 +763,6 @@ void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType,
default:
break;
}
- width = geoManager->menuContentWidthFull - 2*geoManager->menuSpace;
- height = geoManager->menuContentHeight;
- top = geoManager->menuHeaderHeight;
detailView->SetGeometry(x, width, height, top, contentBorder, detailHeaderHeight);
+ detailView->SetScrollBar(pixmapScrollbar, pixmapScrollbarBack);
} \ No newline at end of file
diff --git a/displaymenuview.h b/displaymenuview.h
index a5a50b7..974bab7 100644
--- a/displaymenuview.h
+++ b/displaymenuview.h
@@ -9,9 +9,6 @@
#include "helpers.h"
#include "imageloader.h"
-
-enum eDetailViewType {dvEvent = 0, dvRecording, dvText};
-
class cNopacityDisplayMenuView {
private:
cOsd *osd;
@@ -80,7 +77,7 @@ class cNopacityDisplayMenuView {
void ClearScrollbar(void);
void DrawMessage(eMessageType Type, const char *Text);
void ClearMessage(void);
- void SetDetailViewSize(eDetailViewType detailViewType, cNopacityMenuDetailView *detailView);
+ void SetDetailViewSize(eDetailViewType detailViewType, cNopacityDetailView *detailView);
};
diff --git a/menudetailview.c b/menudetailview.c
index f4ed706..bc07318 100644
--- a/menudetailview.c
+++ b/menudetailview.c
@@ -1,1275 +1,203 @@
#include "menudetailview.h"
-#include "services/epgsearch.h"
-#include <sstream>
-#include <iostream>
-#include <dirent.h>
-#include <vector>
-#include "config.h"
-#include "helpers.h"
-#include "imageloader.h"
-
-cNopacityMenuDetailView::cNopacityMenuDetailView(cOsd *osd, cImageCache *imgCache) {
+/********************************************************************************************
+* cNopacityDetailView
+********************************************************************************************/
+cNopacityDetailView::cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd, cImageCache *imgCache) {
+ type = detailViewType;
this->osd = osd;
this->imgCache = imgCache;
- hasScrollbar = false;
- hasManualPoster = false;
- manualPosterPath = "";
- hasAdditionalMedia = false;
- isMovie = false;
- isSeries = false;
- pixmapPoster = NULL;
-}
-
-cNopacityMenuDetailView::~cNopacityMenuDetailView(void) {
- delete font;
- if (fontSmall)
- delete fontSmall;
- if (fontHeader)
- delete fontHeader;
- if (fontHeaderLarge)
- delete fontHeaderLarge;
+ ev = NULL;
+ rec = NULL;
+ text = NULL;
+ view = NULL;
+ x = 0;
+ width = 0;
+ height = 0;
+ top = 0;
+ border = 0;
+ headerHeight = 0;
+}
+
+cNopacityDetailView::~cNopacityDetailView(void) {
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
+ if (view)
+ delete view;
}
-void cNopacityMenuDetailView::SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight) {
+void cNopacityDetailView::SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight) {
this->x = x;
this->width = width;
this->height = height;
this->top = top;
this->border = contentBorder;
this->headerHeight = headerHeight;
- contentHeight = height - headerHeight;
- widthPoster = 30 * width / 100;
-}
-
-void cNopacityMenuDetailView::DrawTextWrapper(cTextWrapper *wrapper, int top) {
- if (top > contentDrawPortHeight)
- return;
- int linesText = wrapper->Lines();
- int textHeight = font->Height();
- int currentHeight = top;
- for (int i=0; i < linesText; i++) {
- pixmapContent->DrawText(cPoint(border, currentHeight), wrapper->GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font);
- currentHeight += textHeight;
- }
-}
-
-int cNopacityMenuDetailView::HeightActorPics(void) {
- int numActors = 0;
- if (isMovie)
- numActors = movie.actors.size();
- else if (isSeries)
- numActors = series.actors.size();
- else
- numActors = mediaInfo.actors.size();
- if (numActors < 1)
- return 0;
- if (isMovie) {
- actorThumbWidth = movie.actors[0].actorThumb.width/2;
- actorThumbHeight = movie.actors[0].actorThumb.height/2;
- } else if (isSeries) {
- actorThumbWidth = series.actors[0].actorThumb.width/2;
- actorThumbHeight = series.actors[0].actorThumb.height/2;
- } else if (mediaInfo.type == typeMovie) {
- actorThumbWidth = mediaInfo.actors[0].thumb.width/2;
- actorThumbHeight = mediaInfo.actors[0].thumb.height/2;
- } else if (mediaInfo.type == typeSeries) {
- actorThumbWidth = mediaInfo.actors[0].thumb.width/2;
- actorThumbHeight = mediaInfo.actors[0].thumb.height/2;
- }
- int picsPerLine = contentWidth / (actorThumbWidth + 2*border);
- if (picsPerLine < 1)
- return 0;
- int picLines = numActors / picsPerLine;
- if (numActors%picsPerLine != 0)
- picLines++;
- int actorsHeight = picLines * (actorThumbHeight + 2*fontSmall->Height()) + font->Height() + fontHeader->Height();
- return actorsHeight;
-}
-
-int cNopacityMenuDetailView::HeightScraperInfo(void) {
- int heightScraperInfo = 0;
- std::stringstream info;
- if (isSeries) {
- info << tr("TheTVDB Information") << ":\n\n";
- if (series.overview.size() > 0) {
- info << tr("Series Overview") << ": " << series.overview << "\n";
- }
- if (series.firstAired.size() > 0) {
- info << tr("First aired") << ": " << series.firstAired << "\n";
- }
- if (series.genre.size() > 0) {
- info << tr("Genre") << ": " << series.genre << "\n";
- }
- if (series.network.size() > 0) {
- info << tr("Network") << ": " << series.network << "\n";
- }
- if (series.rating > 0) {
- info << tr("TheMovieDB Rating") << ": " << series.rating << "\n";
- }
- if (series.status.size() > 0) {
- info << tr("Status") << ": " << series.status << "\n";
- }
- if (series.episode.name.size() > 0) {
- info << "\n" << tr("Episode") << ": " << series.episode.name << " (" << tr("Season") << " " << series.episode.season << ", " << tr("Episode") << " " << series.episode.number << ")\n";
- }
- if (series.episode.overview.size() > 0) {
- info << tr("Episode Overview") << ": " << series.episode.overview << "\n";
- }
- if (series.episode.firstAired.size() > 0) {
- info << tr("First aired") << ": " << series.episode.firstAired << "\n";
- }
- if (series.episode.guestStars.size() > 0) {
- info << tr("Guest Stars") << ": " << series.episode.guestStars << "\n";
- }
- if (series.episode.rating > 0) {
- info << tr("TheMovieDB Rating") << ": " << series.episode.rating << "\n";
- }
- } else if (isMovie) {
- info << tr("TheMovieDB Information") << ":\n\n";
- if (movie.originalTitle.size() > 0) {
- info << tr("Original Title") << ": " << movie.originalTitle << "\n";
- }
- if (movie.tagline.size() > 0) {
- info << tr("Tagline") << ": " << movie.tagline << "\n";
- }
- if (movie.overview.size() > 0) {
- info << tr("Overview") << ": " << movie.overview << "\n";
- }
- std::string strAdult = (movie.adult)?(tr("yes")):(tr("no"));
- info << tr("Adult") << ": " << strAdult << "\n";
- if (movie.collectionName.size() > 0) {
- info << tr("Collection") << ": " << movie.collectionName << "\n";
- }
- if (movie.budget > 0) {
- info << tr("Budget") << ": " << movie.budget << "$\n";
- }
- if (movie.revenue > 0) {
- info << tr("Revenue") << ": " << movie.revenue << "$\n";
- }
- if (movie.genres.size() > 0) {
- info << tr("Genre") << ": " << movie.genres << "\n";
- }
- if (movie.homepage.size() > 0) {
- info << tr("Homepage") << ": " << movie.homepage << "\n";
- }
- if (movie.releaseDate.size() > 0) {
- info << tr("Release Date") << ": " << movie.releaseDate << "\n";
- }
- if (movie.runtime > 0) {
- info << tr("Runtime") << ": " << movie.runtime << " " << tr("minutes") << "\n";
- }
- if (movie.popularity > 0) {
- info << tr("TheMovieDB Popularity") << ": " << movie.popularity << "\n";
- }
- if (movie.voteAverage > 0) {
- info << tr("TheMovieDB Vote Average") << ": " << movie.voteAverage << "\n";
- }
- }
- scrapInfo.Set(info.str().c_str(), font, contentWidth - 2 * border);
- int lineHeight = font->Height();
- heightScraperInfo = (scrapInfo.Lines() + 1) * lineHeight;
- if (isSeries) {
- if (series.banners.size() == 2)
- heightScraperInfo += (series.banners[1].height + lineHeight);
- else if (series.banners.size() == 3)
- heightScraperInfo += (series.banners[1].height + series.banners[2].height + 2*lineHeight);
- }
- return heightScraperInfo;
}
-int cNopacityMenuDetailView::HeightFanart(void) {
- int retVal = 0;
- int fanartWidthOrig = 0;
- int fanartHeightOrig = 0;
-
- if (isMovie) {
- fanartWidthOrig = movie.fanart.width;
- fanartHeightOrig = movie.fanart.height;
- } else if (isSeries && series.fanarts.size() > 0) {
- fanartWidthOrig = series.fanarts[0].width;
- fanartHeightOrig = series.fanarts[0].height;
- } else if (mediaInfo.fanart.size() >= 1) {
- fanartWidthOrig = mediaInfo.fanart[0].width;
- fanartHeightOrig = mediaInfo.fanart[0].height;
- }
-
- if (fanartWidthOrig == 0)
- return retVal;
-
- int fanartWidth = fanartWidthOrig;
- int fanartHeight = fanartHeightOrig;
- retVal = fanartHeight;
- if (fanartWidthOrig > 0 && fanartWidthOrig > (contentWidth - 2*border)) {
- fanartWidth = contentWidth - 2*border;
- fanartHeight = fanartHeightOrig * ((double)fanartWidth / (double)fanartWidthOrig);
- retVal = fanartHeight;
- }
- if (isSeries) {
- retVal = (retVal + font->Height()) * series.fanarts.size();
- } else if (isMovie) {
- if (movie.collectionFanart.path.size() > 0) {
- retVal = (retVal + font->Height()) * 2;
- }
- }
- return retVal;
-}
-
-void cNopacityMenuDetailView::DrawPoster(void) {
- int posterWidthOrig;
- int posterHeightOrig;
- if (hasManualPoster) {
- posterWidthOrig = config.GetValue("posterWidth");
- posterHeightOrig = config.GetValue("posterHeight");
- } else if (isMovie) {
- if ((movie.poster.width == 0) || (movie.poster.height == 0) || (movie.poster.path.size() < 1))
- return;
- posterWidthOrig = movie.poster.width;
- posterHeightOrig = movie.poster.height;
- } else if (isSeries) {
- if (series.posters.size() < 1)
- return;
- posterWidthOrig = series.posters[0].width;
- posterHeightOrig = series.posters[0].height;
- } else {
- if (mediaInfo.posters.size() < 1)
- return;
- posterWidthOrig = mediaInfo.posters[0].width;
- posterHeightOrig = mediaInfo.posters[0].height;
- }
-
- if (posterWidthOrig == 0)
- return;
-
- int posterWidth = posterWidthOrig;
- int posterHeight = posterHeightOrig;
-
- if ((posterWidthOrig > widthPoster) && (posterHeightOrig < contentHeight)) {
- posterWidth = widthPoster - 2*border;
- posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig);
- } else if ((posterWidthOrig < widthPoster) && (posterHeightOrig > contentHeight)) {
- posterHeight = contentHeight - 2*border;
- posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
- } else if ((posterWidthOrig > widthPoster) && (posterHeightOrig > contentHeight)) {
- int overlapWidth = posterWidthOrig - widthPoster;
- int overlapHeight = posterHeightOrig - contentHeight;
- if (overlapWidth >= overlapHeight) {
- posterWidth = widthPoster - 2*border;
- posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig);
- } else {
- posterHeight = contentHeight - 2*border;
- posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
- }
- }
- if (!Running())
- return;
- int posterX = (widthPoster - posterWidth) / 2;
- int posterY = (contentHeight - posterHeight) / 2;
- cImageLoader imgLoader;
- bool drawPoster = false;
- if (hasManualPoster && imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) {
- drawPoster = true;
- } else if (isSeries && imgLoader.LoadPoster(series.posters[0].path.c_str(), posterWidth, posterHeight)) {
- drawPoster = true;
- } else if (isMovie && imgLoader.LoadPoster(movie.poster.path.c_str(), posterWidth, posterHeight)) {
- drawPoster = true;
- } else if (imgLoader.LoadPoster(mediaInfo.posters[0].path.c_str(), posterWidth, posterHeight)) {
- drawPoster = true;
- }
- if (drawPoster) {
- if (Running() && pixmapPoster)
- pixmapPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage());
- }
-}
-
-void cNopacityMenuDetailView::DrawBanner(int height) {
- int bannerWidthOrig = 0;
- int bannerHeightOrig = 0;
- std::string bannerPath = "";
- int seasonPosterWidth = 0;
- int seasonPosterHeight = 0;
- std::string seasonPoster = "";
- if (isSeries && series.banners.size() > 0) {
- bannerWidthOrig = series.banners[0].width;
- bannerHeightOrig = series.banners[0].height;
- bannerPath = series.banners[0].path;
- seasonPoster = series.seasonPoster.path;
- seasonPosterWidth = series.seasonPoster.width / 2;
- seasonPosterHeight = series.seasonPoster.height / 2;
- } else if (hasAdditionalMedia) {
- bannerWidthOrig = mediaInfo.banner.width;
- bannerHeightOrig = mediaInfo.banner.height;
- bannerPath = mediaInfo.banner.path;
- }
-
- if (bannerWidthOrig == 0)
- return;
-
- int bannerWidth = bannerWidthOrig;
- int bannerHeight = bannerHeightOrig;
- int bannerX = (contentWidth - bannerWidth) / 2;
-
- if (isSeries && seasonPoster.size() > 0) {
- int spaceBanner = contentWidth - 3 * border - seasonPosterWidth;
- if (spaceBanner < bannerWidthOrig) {
- bannerWidth = spaceBanner;
- bannerHeight = bannerHeightOrig * ((double)bannerWidth / (double)bannerWidthOrig);
- bannerX = ((contentWidth - seasonPosterWidth) - bannerWidth)/2;
- }
- } else if (bannerWidthOrig > contentWidth - 2*border) {
- bannerWidth = contentWidth - 2*border;
- bannerHeight = bannerHeightOrig * ((double)bannerWidth / (double)bannerWidthOrig);
- bannerX = (contentWidth - bannerWidth) / 2;
- }
- if (!Running())
- return;
- cImageLoader imgLoader;
- if (imgLoader.LoadPoster(bannerPath.c_str(), bannerWidth, bannerHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(bannerX, height), imgLoader.GetImage());
- }
- if (imgLoader.LoadPoster(seasonPoster.c_str(), seasonPosterWidth, seasonPosterHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(contentWidth - seasonPosterWidth - border, height), imgLoader.GetImage());
- }
-}
-
-void cNopacityMenuDetailView::DrawAdditionalBanners(int top, int bottom) {
- if (series.banners.size() < 2)
- return;
- int bannerWidthOrig = series.banners[1].width;
- int bannerHeightOrig = series.banners[1].height;
- int bannerWidth = bannerWidthOrig;
- int bannerHeight = bannerHeightOrig;
-
- if (bannerWidthOrig == 0)
- return;
-
- if (bannerWidthOrig > contentWidth - 2*border) {
- bannerWidth = contentWidth - 2*border;
- bannerHeight = bannerHeightOrig * ((double)bannerWidth / (double)bannerWidthOrig);
- }
- int bannerX = (contentWidth - bannerWidth) / 2;
- cImageLoader imgLoader;
- if (imgLoader.LoadPoster(series.banners[1].path.c_str(), bannerWidth, bannerHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(bannerX, top), imgLoader.GetImage());
- }
-
- if (series.banners.size() < 3)
- return;
- if (imgLoader.LoadPoster(series.banners[2].path.c_str(), bannerWidth, bannerHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(bannerX, bottom - bannerHeight - font->Height()), imgLoader.GetImage());
- }
-}
-
-void cNopacityMenuDetailView::DrawActors(int height) {
- int numActors = 0;
- if (isMovie)
- numActors = movie.actors.size();
- else if (isSeries)
- numActors = series.actors.size();
- else
- numActors = mediaInfo.actors.size();
- if (numActors < 1)
- return;
-
- cString header = cString::sprintf("%s:", tr("Actors"));
- pixmapContent->DrawText(cPoint(border, height), *header, Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontHeader);
-
- int picsPerLine = contentWidth / (actorThumbWidth + 2*border);
- int picLines = numActors / picsPerLine;
- if (numActors%picsPerLine != 0)
- picLines++;
- int x = 0;
- int y = height + fontHeader->Height();
- if (!Running())
- return;
- cImageLoader imgLoader;
- int actor = 0;
- for (int row = 0; row < picLines; row++) {
- for (int col = 0; col < picsPerLine; col++) {
- if (!Running())
- return;
- if (actor == numActors)
+void cNopacityDetailView::InitiateViewType(void) {
+ static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
+ ScraperGetEventType call;
+ switch (type) {
+ case dvEvent: {
+ if (!ev)
break;
- std::string path = "";
- std::string name = "";
- std::stringstream sstrRole;
- if (isMovie) {
- path = movie.actors[actor].actorThumb.path;
- name = movie.actors[actor].name;
- sstrRole << "\"" << movie.actors[actor].role << "\"";
- } else if (isSeries) {
- path = series.actors[actor].actorThumb.path;
- name = series.actors[actor].name;
- sstrRole << "\"" << series.actors[actor].role << "\"";
+ call.event = ev;
+ if (!pScraper2Vdr) {
+ view = new cNopacityEPGView(osd, imgCache);
+ } else if (pScraper2Vdr->Service("GetEventType", &call)) {
+ if (call.type == tMovie) {
+ view = new cNopacityMovieView(osd, imgCache, call.movieId);
+ } else if (call.type == tSeries) {
+ view = new cNopacitySeriesView(osd, imgCache, call.seriesId, call.episodeId);
+ }
} else {
- path = mediaInfo.actors[actor].thumb.path;
- name = mediaInfo.actors[actor].name;
- sstrRole << "\"" << mediaInfo.actors[actor].role << "\"";
- }
- std::string role = sstrRole.str();
- if (imgLoader.LoadPoster(path.c_str(), actorThumbWidth, actorThumbHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(x + border, y), imgLoader.GetImage());
+ view = new cNopacityEPGView(osd, imgCache);
}
-
- if (fontSmall->Width(name.c_str()) > actorThumbWidth + 2*border)
- name = CutText(name, actorThumbWidth + 2*border, fontSmall);
- if (fontSmall->Width(role.c_str()) > actorThumbWidth + 2*border)
- role = CutText(role, actorThumbWidth + 2*border, fontSmall);
- int xName = x + ((actorThumbWidth+2*border) - fontSmall->Width(name.c_str()))/2;
- int xRole = x + ((actorThumbWidth+2*border) - fontSmall->Width(role.c_str()))/2;
- if (Running() && pixmapContent) {
- pixmapContent->DrawText(cPoint(xName, y + actorThumbHeight), name.c_str(), Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontSmall);
- pixmapContent->DrawText(cPoint(xRole, y + actorThumbHeight + fontSmall->Height()), role.c_str(), Theme.Color(clrMenuFontDetailViewText), clrTransparent, fontSmall);
- x += actorThumbWidth + 2*border;
- }
- actor++;
- }
- x = 0;
- y += actorThumbHeight + 2 * fontSmall->Height();
- }
-}
-
-void cNopacityMenuDetailView::DrawFanart(int height) {
- if (isSeries && series.fanarts.size() < 1)
- return;
- else if (hasAdditionalMedia && mediaInfo.fanart.size() < 1)
- return;
-
- int fanartWidthOrig = 0;
- int fanartHeightOrig = 0;
- std::string fanartPath = "";
- if (isMovie) {
- fanartWidthOrig = movie.fanart.width;
- fanartHeightOrig = movie.fanart.height;
- fanartPath = movie.fanart.path;
- } else if (isSeries) {
- fanartWidthOrig = series.fanarts[0].width;
- fanartHeightOrig = series.fanarts[0].height;
- fanartPath = series.fanarts[0].path;
- } else {
- fanartWidthOrig = mediaInfo.fanart[0].width;
- fanartHeightOrig = mediaInfo.fanart[0].height;
- fanartPath = mediaInfo.fanart[0].path;
- }
-
- if (fanartWidthOrig == 0)
- return;
-
- int fanartWidth = fanartWidthOrig;
- int fanartHeight = fanartHeightOrig;
-
- if (fanartWidthOrig > contentWidth - 2*border) {
- fanartWidth = contentWidth - 2*border;
- fanartHeight = fanartHeightOrig * ((double)fanartWidth / (double)fanartWidthOrig);
- }
- if (!Running())
- return;
- cImageLoader imgLoader;
- if (isMovie) {
- int fanartX = (contentWidth - fanartWidth) / 2;
- if (imgLoader.LoadPoster(fanartPath.c_str(), fanartWidth, fanartHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(fanartX, height), imgLoader.GetImage());
- }
- if (movie.collectionFanart.path.size() > 0) {
- if (imgLoader.LoadPoster(movie.collectionFanart.path.c_str(), fanartWidth, fanartHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(fanartX, height + fanartHeight + font->Size()), imgLoader.GetImage());
- }
- }
- } else if (isSeries) {
- int fanartX = (contentWidth - fanartWidth) / 2;
- for (std::vector<cTvMedia>::iterator f = series.fanarts.begin(); f != series.fanarts.end(); f++) {
- cTvMedia m = *f;
- if (imgLoader.LoadPoster(m.path.c_str(), fanartWidth, fanartHeight)) {
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(fanartX, height), imgLoader.GetImage());
- height += fanartHeight + font->Height();
- }
- }
- } else {
- if (imgLoader.LoadPoster(fanartPath.c_str(), fanartWidth, fanartHeight)) {
- int fanartX = (contentWidth - fanartWidth) / 2;
- if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(fanartX, height), imgLoader.GetImage());
- }
- }
-}
-
-double cNopacityMenuDetailView::ScrollbarSize(void) {
- double barSize = (double)contentHeight / (double)contentDrawPortHeight;
- return barSize;
-}
-
-double cNopacityMenuDetailView::Offset(void) {
- double offset;
- if (((-1)*pixmapContent->DrawPort().Point().Y() + contentHeight + font->Height()) > contentDrawPortHeight)
- offset = (double)1 - ScrollbarSize();
- else
- offset = (double)((-1)*pixmapContent->DrawPort().Point().Y())/(double)((-1)*pixmapContent->DrawPort().Point().Y() + contentHeight);
- return offset;
-
-}
-bool cNopacityMenuDetailView::Scroll(bool Up, bool Page) {
- int aktHeight = pixmapContent->DrawPort().Point().Y();
- int totalHeight = pixmapContent->DrawPort().Height();
- int screenHeight = pixmapContent->ViewPort().Height();
- int lineHeight = font->Height();
- bool scrolled = false;
- if (Up) {
- if (Page) {
- int newY = aktHeight + screenHeight;
- if (newY > 0)
- newY = 0;
- pixmapContent->SetDrawPortPoint(cPoint(0, newY));
- scrolled = true;
- } else {
- if (aktHeight < 0) {
- pixmapContent->SetDrawPortPoint(cPoint(0, aktHeight + lineHeight));
- scrolled = true;
- }
- }
- } else {
- if (Page) {
- int newY = aktHeight - screenHeight;
- if ((-1)*newY > totalHeight - screenHeight)
- newY = (-1)*(totalHeight - screenHeight);
- pixmapContent->SetDrawPortPoint(cPoint(0, newY));
- scrolled = true;
- } else {
- if (totalHeight - ((-1)*aktHeight + lineHeight) > screenHeight) {
- pixmapContent->SetDrawPortPoint(cPoint(0, aktHeight - lineHeight));
- scrolled = true;
- }
- }
- }
- return scrolled;
-}
-
-//---------------cNopacityMenuDetailEventView---------------------
-
-cNopacityMenuDetailEventView::cNopacityMenuDetailEventView(cOsd *osd, cImageCache *imgCache, const cEvent *Event) : cNopacityMenuDetailView(osd, imgCache) {
- event = Event;
- numEPGPics = 0;
-}
-
-cNopacityMenuDetailEventView::~cNopacityMenuDetailEventView(void) {
- Cancel(-1);
- while (Active())
- cCondWait::SleepMs(10);
- osd->DestroyPixmap(pixmapHeader);
- pixmapHeader = NULL;
- osd->DestroyPixmap(pixmapContent);
- pixmapContent = NULL;
- osd->DestroyPixmap(pixmapLogo);
- pixmapLogo = NULL;
- if (pixmapPoster) {
- osd->DestroyPixmap(pixmapPoster);
- pixmapLogo = NULL;
- }
-}
-
-void cNopacityMenuDetailEventView::SetFonts(void) {
- font = cFont::CreateFont(config.fontName, contentHeight / 25 + 3 + config.GetValue("fontDetailView"));
- fontSmall = cFont::CreateFont(config.fontName, contentHeight / 30 + config.GetValue("fontDetailViewSmall"));
- fontHeaderLarge = cFont::CreateFont(config.fontName, headerHeight / 4 + config.GetValue("fontDetailViewHeaderLarge"));
- fontHeader = cFont::CreateFont(config.fontName, headerHeight / 6 + config.GetValue("fontDetailViewHeader"));
-}
-
-void cNopacityMenuDetailEventView::SetContent(void) {
- if (event) {
- static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
- if (pScraper2Vdr) {
- ScraperGetEventType call;
- call.event = event;
- int seriesId = 0;
- int episodeId = 0;
- int movieId = 0;
- if (pScraper2Vdr->Service("GetEventType", &call)) {
- esyslog("nopacity: event: %d, %s", event->EventID(), event->Title());
- esyslog("nopacity: Type detected: %d, seriesId %d, episodeId %d, movieId %d", call.type, call.seriesId, call.episodeId, call.movieId);
- seriesId = call.seriesId;
- episodeId = call.episodeId;
- movieId = call.movieId;
- }
- if (seriesId > 0) {
- series.seriesId = seriesId;
- series.episodeId = episodeId;
- if (pScraper2Vdr->Service("GetSeries", &series)) {
- isSeries = true;
- }
- } else if (movieId > 0) {
- movie.movieId = movieId;
- if (pScraper2Vdr->Service("GetMovie", &movie)) {
- isMovie = true;
- }
+ view->SetTitle(ev->Title());
+ view->SetSubTitle(ev->ShortText());
+ view->SetInfoText(ev->Description());
+ cString dateTime;
+ time_t vps = ev->Vps();
+ if (vps) {
+ dateTime = cString::sprintf("%s %s - %s (%d %s) VPS: %s", *ev->GetDateString(), *ev->GetTimeString(), *ev->GetEndTimeString(), ev->Duration()/60, tr("min"), *TimeString(vps));
+ } else {
+ dateTime = cString::sprintf("%s %s - %s (%d %s)", *ev->GetDateString(), *ev->GetTimeString(), *ev->GetEndTimeString(), ev->Duration()/60, tr("min"));
}
- } else {
- static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper");
- if (pTVScraper) {
- mediaInfo.event = event;
- mediaInfo.isRecording = false;
- if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) {
- hasAdditionalMedia = true;
+ view->SetDateTime(*dateTime);
+ view->SetChannel(Channels.GetByChannelID(ev->ChannelID(), true));
+ view->SetEventID(ev->EventID());
+ break; }
+ case dvRecording: {
+ if (!rec)
+ break;
+ call.recording = rec;
+ if (!pScraper2Vdr) {
+ view = new cNopacityEPGView(osd, imgCache);
+ } else if (pScraper2Vdr->Service("GetEventType", &call)) {
+ if (call.type == tMovie) {
+ view = new cNopacityMovieView(osd, imgCache, call.movieId);
+ } else if (call.type == tSeries) {
+ view = new cNopacitySeriesView(osd, imgCache, call.seriesId, call.episodeId);
}
+ } else {
+ view = new cNopacityEPGView(osd, imgCache);
}
- }
- contentWidth = width;
- contentX = 0;
- bool displayPoster = false;
- if (isSeries && series.posters.size() > 0) {
- displayPoster = true;
- } else if (isMovie && (movie.poster.width > 0) && (movie.poster.height > 0) && (movie.poster.path.size() > 0)) {
- displayPoster = true;
- } else if (hasAdditionalMedia) {
- if (mediaInfo.posters.size() >= 1) {
- displayPoster = true;
+ const cRecordingInfo *info = rec->Info();
+ if (info) {
+ view->SetTitle(info->Title());
+ view->SetSubTitle(info->ShortText());
+ view->SetInfoText(info->Description());
+ view->SetChannel(Channels.GetByChannelID(info->ChannelID(), true));
+ } else {
+ view->SetTitle(rec->Name());
}
- }
- if (displayPoster) {
- contentWidth -= widthPoster;
- contentX = widthPoster;
- }
- epgText.Set(event->Description(), font, contentWidth - 2 * border);
- if (config.GetValue("displayRerunsDetailEPGView")) {
- LoadReruns();
- }
- }
-}
-
-void cNopacityMenuDetailEventView::SetContentHeight(void) {
- int lineHeight = font->Height();
- //Height of banner (only for series)
- int heightBanner = 0;
- if ((hasAdditionalMedia && (mediaInfo.type == typeSeries)) || isSeries) {
- if (isSeries && series.banners.size() > 0) {
- heightBanner = series.banners[0].height + lineHeight;
- } else
- heightBanner = mediaInfo.banner.height + lineHeight;
- }
- //Height of EPG Text
- int heightEPG = (epgText.Lines()+1) * lineHeight;
- //Height of rerun information
- int heightReruns = 0;
- if (config.GetValue("displayRerunsDetailEPGView")) {
- heightReruns = reruns.Lines() * lineHeight;
- }
- //Height of actor pictures
- int heightActors = 0;
- if (hasAdditionalMedia || isMovie || isSeries) {
- heightActors = HeightActorPics();
- }
-
- //Height of additional scraper info
- int heightScraperInfo = 0;
- if (isMovie || isSeries) {
- heightScraperInfo = HeightScraperInfo();
- }
-
- //Height of fanart
- int heightFanart = 0;
- if (hasAdditionalMedia || isMovie || isSeries) {
- heightFanart = HeightFanart() + lineHeight;
- }
- //Height of EPG Pictures
- int heightEPGPics = 0;
- if ((config.GetValue("displayAdditionalEPGPictures") == 1) || ((config.GetValue("displayAdditionalEPGPictures") == 2) && !hasAdditionalMedia && !isMovie && !isSeries)) {
- heightEPGPics = HeightEPGPics();
- }
-
- yBanner = border;
- yEPGText = yBanner + heightBanner;
- yAddInf = yEPGText + heightEPG;
- yActors = yAddInf + heightReruns;
- yScrapInfo = yActors + heightActors;
- yFanart = yScrapInfo + heightScraperInfo;
- yEPGPics = yFanart + heightFanart;
-
- int totalHeight = 2 * border + heightBanner + heightEPG + heightActors + heightScraperInfo + heightFanart + heightReruns + heightEPGPics;
- //check if pixmap content has to be scrollable
- if (totalHeight > contentHeight) {
- contentDrawPortHeight = totalHeight;
- hasScrollbar = true;
- } else {
- contentDrawPortHeight = contentHeight;
- }
-}
-
-void cNopacityMenuDetailEventView::CreatePixmaps(void) {
- pixmapHeader = osd->CreatePixmap(3, cRect(x, top, width, headerHeight));
- pixmapContent = osd->CreatePixmap(3, cRect(x + contentX, top + headerHeight, contentWidth, contentHeight),
- cRect(0, 0, contentWidth, contentDrawPortHeight));
- pixmapLogo = osd->CreatePixmap(4, cRect(x + border, top + max((headerHeight-config.GetValue("logoHeightOriginal"))/2,1), config.GetValue("logoWidthOriginal"), config.GetValue("logoHeightOriginal")));
-
- pixmapHeader->Fill(clrTransparent);
- pixmapHeader->DrawRectangle(cRect(0, headerHeight - 2, width, 2), Theme.Color(clrMenuBorder));
- pixmapContent->Fill(clrTransparent);
- pixmapLogo->Fill(clrTransparent);
-
- if (hasAdditionalMedia || isSeries || isMovie) {
- pixmapPoster = osd->CreatePixmap(4, cRect(x, top + headerHeight, widthPoster, contentHeight));
- pixmapPoster->Fill(clrTransparent);
- }
-}
-
-void cNopacityMenuDetailEventView::Render(void) {
- DrawHeader();
- //draw EPG text
- DrawTextWrapper(&epgText, yEPGText);
- //draw reruns
- if (config.GetValue("displayRerunsDetailEPGView")) {
- DrawTextWrapper(&reruns, yAddInf);
- }
- //draw additional scraper info
- if (isMovie) {
- DrawTextWrapper(&scrapInfo, yScrapInfo);
- } else if (isSeries) {
- int yInfo = yScrapInfo + font->Height();
- if (series.banners.size() > 1)
- yInfo += series.banners[1].height;
- DrawTextWrapper(&scrapInfo, yInfo);
- }
-}
-
-void cNopacityMenuDetailEventView::Action(void) {
- if ((hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawPoster();
- osd->Flush();
- }
- //draw banner only for series
- if (((hasAdditionalMedia && (mediaInfo.type == typeSeries)) || isSeries) && Running()) {
- DrawBanner(yBanner);
- osd->Flush();
- }
- //draw actors
- if ((hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawActors(yActors);
- osd->Flush();
- }
- //draw additional banners
- if (isSeries && Running()) {
- DrawAdditionalBanners(yScrapInfo, yFanart);
- osd->Flush();
- }
- //draw fanart
- if ((hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawFanart(yFanart);
- osd->Flush();
- }
- //draw additional EPG Pictures
- if (((config.GetValue("displayAdditionalEPGPictures") == 1) || ((config.GetValue("displayAdditionalEPGPictures") == 2) && !hasAdditionalMedia && !isMovie && !isSeries)) && Running()) {
- DrawEPGPictures(yEPGPics);
- osd->Flush();
- }
-}
-
-int cNopacityMenuDetailEventView::HeightEPGPics(void) {
- int numPicsAvailable = 0;
- for (int i=1; i <= config.GetValue("numAdditionalEPGPictures"); i++) {
- cString epgimage;
- if (config.epgImagePathSet) {
- epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePath, event->EventID(), i);
- } else {
- epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePathDefault, event->EventID(), i);
- }
- FILE *fp = fopen(*epgimage, "r");
- if (fp) {
- numPicsAvailable = i;
- fclose(fp);
- } else {
+ int recDuration = rec->LengthInSeconds();
+ recDuration = (recDuration>0)?(recDuration / 60):0;
+ cString dateTime = cString::sprintf("%s %s (%d %s)", *DateString(rec->Start()), *TimeString(rec->Start()), recDuration, tr("min"));
+ view->SetDateTime(*dateTime);
+ view->SetRecFileName(rec->FileName());
+ break; }
+ case dvText:
+ view = new cNopacityTextView(osd, imgCache);
+ view->SetInfoText(text);
break;
- }
- }
- numEPGPics = numPicsAvailable;
- int picsPerLine = contentWidth / (config.GetValue("epgImageWidthLarge") + border);
- int picLines = numPicsAvailable / picsPerLine;
- if (numPicsAvailable%picsPerLine != 0)
- picLines++;
- return picLines * (config.GetValue("epgImageHeightLarge") + border) + 2*border;
-}
-
-void cNopacityMenuDetailEventView::DrawHeader(void) {
- int logoWidth = config.GetValue("logoWidthOriginal");
- cChannel *channel = Channels.GetByChannelID(event->ChannelID(), true);
- if (channel) {
- cImage *logo = imgCache->GetLogo(ctLogo, channel);
- if (logo) {
- pixmapLogo->DrawImage(cPoint(0, max((headerHeight - config.GetValue("logoHeightOriginal") - border)/2, 0)), *logo);
- }
- }
- int widthTextHeader = width - 4 * border - logoWidth;
- cImageLoader imgLoader;
- if (isSeries && series.episode.episodeImage.path.size() > 0) {
- int imgWidth = series.episode.episodeImage.width;
- int imgHeight = series.episode.episodeImage.height;
- if (imgHeight > headerHeight) {
- imgHeight = headerHeight - 6;
- imgWidth = imgWidth * ((double)imgHeight / (double)series.episode.episodeImage.height);
- }
- if (imgLoader.LoadPoster(series.episode.episodeImage.path.c_str(), imgWidth, imgHeight)) {
- pixmapHeader->DrawImage(cPoint(width - imgWidth - border, (headerHeight - imgHeight)/2), imgLoader.GetImage());
- widthTextHeader -= imgWidth;
- }
- } else if (imgLoader.LoadEPGImage(event->EventID())) {
- pixmapHeader->DrawImage(cPoint(width - config.GetValue("epgImageWidth") - border, (headerHeight-config.GetValue("epgImageHeight"))/2), imgLoader.GetImage());
- if (config.GetValue("roundedCorners")) {
- int radius = config.GetValue("cornerRadius");
- int x = width - config.GetValue("epgImageWidth") - border;
- int y = (headerHeight-config.GetValue("epgImageHeight"))/2;
- DrawRoundedCorners(pixmapHeader, radius, x, y, config.GetValue("epgImageWidth"), config.GetValue("epgImageHeight"));
- }
- widthTextHeader -= config.GetValue("epgImageWidth");
- }
- int lineHeight = fontHeaderLarge->Height();
-
- cString dateTime;
- time_t vps = event->Vps();
- if (vps) {
- dateTime = cString::sprintf("%s %s - %s (%d %s) VPS: %s", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min"), *TimeString(vps));
- } else {
- dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min"));
- }
- pixmapHeader->DrawText(cPoint(logoWidth + 2*border, (lineHeight - fontHeader->Height())/2), *dateTime, Theme.Color(clrMenuFontDetailViewHeader), clrTransparent, fontHeader);
-
- cTextWrapper title;
- title.Set(event->Title(), fontHeaderLarge, widthTextHeader);
- int currentLineHeight = lineHeight;
- for (int i=0; i < title.Lines(); i++) {
- pixmapHeader->DrawText(cPoint(logoWidth + 2*border, currentLineHeight), title.GetLine(i), Theme.Color(clrMenuFontDetailViewHeaderTitle), clrTransparent, fontHeaderLarge);
- currentLineHeight += lineHeight;
- }
-
- cTextWrapper shortText;
- shortText.Set(event->ShortText(), fontHeader, widthTextHeader);
- currentLineHeight += (lineHeight - fontHeader->Height())/2;
- for (int i=0; i < shortText.Lines(); i++) {
- if ((currentLineHeight + fontHeader->Height()) < headerHeight) {
- pixmapHeader->DrawText(cPoint(logoWidth + 2*border, currentLineHeight), shortText.GetLine(i), Theme.Color(clrMenuFontDetailViewHeader), clrTransparent, fontHeader);
- currentLineHeight += fontHeader->Height();
- } else
+ default:
break;
}
-
}
-
-void cNopacityMenuDetailEventView::LoadReruns(void) {
+void cNopacityDetailView::KeyInput(bool Up, bool Page) {
+ if (Running())
+ return;
+ if (!view)
+ return;
+ if (Up && Page) {
+ view->KeyLeft();
+ view->Start();
+ } else if (!Up && Page) {
+ view->KeyRight();
+ view->Start();
+ } else if (Up && !Page) {
+ bool scrolled = view->KeyUp();
+ if (scrolled) {
+ view->DrawScrollbar();
+ osd->Flush();
+ }
+ }else if (!Up && !Page) {
+ bool scrolled = view->KeyDown();
+ if (scrolled) {
+ view->DrawScrollbar();
+ osd->Flush();
+ }
+ }
+}
+
+std::string cNopacityDetailView::LoadReruns(void) {
+ if (!ev)
+ return "";
+
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.GetValue("useSubtitleRerun") > 0) {
- if (config.GetValue("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)
+ return "";
- if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) {
- cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList;
- if (list && (list->Count() > 1)) {
- sstrReruns << tr("RERUNS OF THIS SHOW") << ':' << std::endl;
- int i = 0;
- for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < config.GetValue("numReruns"); r = list->Next(r)) {
- if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime()))
- continue;
- i++;
- sstrReruns << "- "
- << *DayDateTime(r->event->StartTime());
- cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
- if (channel) {
- sstrReruns << ", " << channel->Number() << ".";
- sstrReruns << " " << channel->ShortName(true);
- }
- sstrReruns << ": " << r->event->Title();
- if (!isempty(r->event->ShortText()))
- sstrReruns << "~" << r->event->ShortText();
- sstrReruns << std::endl;
- }
- delete list;
- }
- }
- reruns.Set(sstrReruns.str().c_str(), font, contentWidth - 4 * border);
- } else
- reruns.Set("", font, contentWidth);
-}
-
-void cNopacityMenuDetailEventView::DrawEPGPictures(int height) {
- int picsPerLine = contentWidth / (config.GetValue("epgImageWidthLarge") + border);
- int currentX = border;
- int currentY = height + border;
- int currentPicsPerLine = 1;
- cImageLoader imgLoader;
- for (int i=1; i <= numEPGPics; i++) {
- cString epgimage = cString::sprintf("%d_%d", event->EventID(), i);
- if (imgLoader.LoadAdditionalEPGImage(epgimage)) {
- pixmapContent->DrawImage(cPoint(currentX, currentY), imgLoader.GetImage());
- if (config.GetValue("roundedCorners")) {
- int radius = config.GetValue("cornerRadius");
- DrawRoundedCorners(pixmapContent, radius, currentX, currentY, config.GetValue("epgImageWidthLarge"), config.GetValue("epgImageHeightLarge"));
- }
- if (currentPicsPerLine < picsPerLine) {
- currentX += config.GetValue("epgImageWidthLarge") + border;
- currentPicsPerLine++;
- } else {
- currentX = border;
- currentY += config.GetValue("epgImageHeightLarge") + border;
- currentPicsPerLine = 1;
- }
- } else {
- break;
- }
- }
-}
-
-//------------------cNopacityMenuDetailRecordingView------------------
+ if (isempty(ev->Title()))
+ return "";
+
+ std::stringstream sstrReruns;
+ sstrReruns << tr("Reruns of ") << "\"" << ev->Title() << "\":" << std::endl << std::endl;
-cNopacityMenuDetailRecordingView::cNopacityMenuDetailRecordingView(cOsd *osd, const cRecording *Recording) : cNopacityMenuDetailView(osd, NULL) {
- recording = Recording;
- info = Recording->Info();
-}
+ Epgsearch_searchresults_v1_0 data;
+ std::string strQuery = ev->Title();
-cNopacityMenuDetailRecordingView::~cNopacityMenuDetailRecordingView(void) {
- Cancel(-1);
- while (Active())
- cCondWait::SleepMs(10);
- osd->DestroyPixmap(pixmapHeader);
- pixmapHeader = NULL;
- osd->DestroyPixmap(pixmapContent);
- pixmapContent = NULL;
- if (pixmapPoster) {
- osd->DestroyPixmap(pixmapPoster);
- pixmapLogo = NULL;
- }
-}
-
-void cNopacityMenuDetailRecordingView::SetFonts(void) {
- font = cFont::CreateFont(config.fontName, contentHeight / 25 + config.GetValue("fontDetailView"));
- fontSmall = cFont::CreateFont(config.fontName, contentHeight / 30 + config.GetValue("fontDetailViewSmall"));
- fontHeaderLarge = cFont::CreateFont(config.fontName, headerHeight / 4 + config.GetValue("fontDetailViewHeaderLarge"));
- fontHeader = cFont::CreateFont(config.fontName, headerHeight / 6 + config.GetValue("fontDetailViewHeader"));
-}
-
-void cNopacityMenuDetailRecordingView::SetContent(void) {
- contentWidth = width;
- contentX = 0;
- if (recording) {
- //check first if manually set poster exists
- cString posterFound;
- cImageLoader imgLoader;
- hasManualPoster = imgLoader.SearchRecordingPoster(recording->FileName(), posterFound);
- if (hasManualPoster) {
- manualPosterPath = posterFound;
- contentWidth -= widthPoster;
- contentX = widthPoster;
- } else {
- static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
- if (pScraper2Vdr) {
- ScraperGetEventType call;
- call.recording = recording;
- int seriesId = 0;
- int episodeId = 0;
- int movieId = 0;
- if (pScraper2Vdr->Service("GetEventType", &call)) {
- esyslog("nopacity: Type detected: %d, seriesId %d, episodeId %d, movieId %d", call.type, call.seriesId, call.episodeId, call.movieId);
- seriesId = call.seriesId;
- episodeId = call.episodeId;
- movieId = call.movieId;
- }
- if (seriesId > 0) {
- series.seriesId = seriesId;
- series.episodeId = episodeId;
- if (pScraper2Vdr->Service("GetSeries", &series)) {
- isSeries = true;
- }
- } else if (movieId > 0) {
- movie.movieId = movieId;
- if (pScraper2Vdr->Service("GetMovie", &movie)) {
- isMovie = true;
- }
- }
- } else {
- const cEvent *event = info->GetEvent();
- if (event && !hasManualPoster) {
- static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper");
- if (pTVScraper) {
- mediaInfo.event = event;
- mediaInfo.isRecording = true;
- if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) {
- hasAdditionalMedia = true;
- }
- }
- }
- }
- bool displayPoster = false;
- if (isSeries && series.posters.size() > 0) {
- displayPoster = true;
- } else if (isMovie && (movie.poster.width > 0) && (movie.poster.height > 0) && (movie.poster.path.size() > 0)) {
- displayPoster = true;
- } else if (hasAdditionalMedia) {
- if (mediaInfo.posters.size() >= 1) {
- displayPoster = true;
- }
- }
- if (displayPoster) {
- contentWidth -= widthPoster;
- contentX = widthPoster;
- }
+ if (config.GetValue("useSubtitleRerun") > 0) {
+ if (config.GetValue("useSubtitleRerun") == 2 && !isempty(ev->ShortText())) {
+ strQuery += "~";
+ strQuery += ev->ShortText();
}
- recInfo.Set(recording->Info()->Description(), font, contentWidth - 2 * border);
- LoadRecordingInformation();
- }
-}
-
-void cNopacityMenuDetailRecordingView::SetContentHeight(void) {
- int lineHeight = font->Height();
- //Height of banner (only for series)
- int heightBanner = 0;
- if (!hasManualPoster && ((hasAdditionalMedia && (mediaInfo.type == typeSeries)) || isSeries)) {
- if (isSeries && series.banners.size() > 0) {
- heightBanner = series.banners[0].height + lineHeight;
- } else
- heightBanner = mediaInfo.banner.height + lineHeight;
- }
- //Height of Recording EPG Info
- int heightEPG = (recInfo.Lines()+1) * lineHeight;
- //Height of actor pictures
- int heightActors = 0;
- if (!hasManualPoster && (hasAdditionalMedia || isMovie || isSeries)) {
- heightActors = HeightActorPics();
- }
- //Height of additional scraper info
- int heightScraperInfo = 0;
- if (isMovie || isSeries) {
- heightScraperInfo = HeightScraperInfo();
- }
- //Height of fanart
- int heightFanart = 0;
- if (!hasManualPoster && (hasAdditionalMedia || isMovie || isSeries)) {
- heightFanart = HeightFanart() + lineHeight;
- }
- //Height of EPG Pictures
- int heightEPGPics = 0;
- if ((config.GetValue("displayAdditionalRecEPGPictures") == 1) || ((config.GetValue("displayAdditionalRecEPGPictures") == 2) && !hasAdditionalMedia)) {
- if (LoadEPGPics())
- heightEPGPics = HeightEPGPics();
- }
- //additional recording Info
- int heightAdditionalInfo = (additionalInfo.Lines() + 1) * lineHeight;
-
- yBanner = border;
- yEPGText = yBanner + heightBanner;
- yActors = yEPGText + heightEPG;
- yScrapInfo = yActors + heightActors;
- yFanart = yScrapInfo + heightScraperInfo;
- yEPGPics = yFanart + heightFanart;
- yAddInf = yEPGPics + heightEPGPics;
-
- int totalHeight = 2*border + heightBanner + heightEPG + heightActors + heightScraperInfo + heightFanart + heightAdditionalInfo + heightEPGPics;
- //check if pixmap content has to be scrollable
- if (totalHeight > contentHeight) {
- contentDrawPortHeight = totalHeight;
- hasScrollbar = true;
+ data.useSubTitle = true;
} else {
- contentDrawPortHeight = contentHeight;
- }
-
-}
-
-void cNopacityMenuDetailRecordingView::CreatePixmaps(void) {
- pixmapHeader = osd->CreatePixmap(3, cRect(x, top, width, headerHeight));
- pixmapContent = osd->CreatePixmap(3, cRect(x + contentX, top + headerHeight, contentWidth, contentHeight),
- cRect(0, 0, contentWidth, contentDrawPortHeight));
-
- pixmapHeader->Fill(clrTransparent);
- pixmapHeader->DrawRectangle(cRect(0, headerHeight - 2, width, 2), Theme.Color(clrMenuBorder));
- pixmapContent->Fill(clrTransparent);
- if (hasManualPoster || hasAdditionalMedia || isMovie || isSeries) {
- pixmapPoster = osd->CreatePixmap(4, cRect(x, top + headerHeight, widthPoster, contentHeight));
- pixmapPoster->Fill(clrTransparent);
- }
-}
-
-void cNopacityMenuDetailRecordingView::Render(void) {
- DrawHeader();
- //draw Recording EPG text
- DrawTextWrapper(&recInfo, yEPGText);
- //draw additional Info
- if (config.GetValue("displayRerunsDetailEPGView")) {
- DrawTextWrapper(&additionalInfo, yAddInf);
- }
- //draw additional scraper info
- if (isMovie) {
- DrawTextWrapper(&scrapInfo, yScrapInfo);
- } else if (isSeries) {
- int yInfo = yScrapInfo + font->Height();
- if (series.banners.size() > 1)
- yInfo += series.banners[1].height;
- DrawTextWrapper(&scrapInfo, yInfo);
- }
-}
-
-void cNopacityMenuDetailRecordingView::Action(void) {
- if ((hasManualPoster || hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawPoster();
- osd->Flush();
- }
- //draw banner only for series
- if (!hasManualPoster && (hasAdditionalMedia && (mediaInfo.type == typeSeries) || isSeries) && Running()) {
- DrawBanner(yBanner);
- osd->Flush();
- }
- //draw actors
- if (!hasManualPoster && (hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawActors(yActors);
- osd->Flush();
- }
- //draw fanart
- if (!hasManualPoster && (hasAdditionalMedia || isSeries || isMovie) && Running()) {
- DrawFanart(yFanart);
- osd->Flush();
- }
- //draw additional EPG Pictures
- if (((config.GetValue("displayAdditionalRecEPGPictures") == 1) || ((config.GetValue("displayAdditionalRecEPGPictures") == 2) && !(hasAdditionalMedia && !isMovie && !isSeries))) && Running()) {
- DrawEPGPictures(yEPGPics);
- osd->Flush();
- }
-}
-
-bool cNopacityMenuDetailRecordingView::LoadEPGPics(void) {
- DIR *dirHandle;
- struct dirent *dirEntry;
- dirHandle = opendir(recording->FileName());
- int picsFound = 0;
- if (dirHandle != NULL) {
- while ( 0 != (dirEntry = readdir(dirHandle))) {
- if (endswith(dirEntry->d_name, "jpg")) {
- std::string fileName = dirEntry->d_name;
- if (!fileName.compare("cover_vdr.jpg"))
+ data.useSubTitle = false;
+ }
+ data.query = (char *)strQuery.c_str();
+ data.mode = 0;
+ data.channelNr = 0;
+ data.useTitle = true;
+ data.useDescription = false;
+
+ bool foundRerun = false;
+ if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) {
+ cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList;
+ if (list && (list->Count() > 1)) {
+ foundRerun = true;
+ int i = 0;
+ for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < config.GetValue("numReruns"); r = list->Next(r)) {
+ if ((ev->ChannelID() == r->event->ChannelID()) && (ev->StartTime() == r->event->StartTime()))
continue;
- if (fileName.length() > 4) {
- fileName = fileName.substr(0, fileName.length() - 4);
- epgpics.push_back(fileName);
- picsFound++;
+ i++;
+ sstrReruns << *DayDateTime(r->event->StartTime());
+ cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
+ if (channel) {
+ sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":";
+ sstrReruns << " " << channel->ShortName(true);
}
+ sstrReruns << "\n" << r->event->Title();
+ if (!isempty(r->event->ShortText()))
+ sstrReruns << "~" << r->event->ShortText();
+ sstrReruns << std::endl << std::endl;
}
- if (picsFound >= config.GetValue("numAdditionalRecEPGPictures"))
- break;
+ delete list;
}
- closedir(dirHandle);
}
- if (picsFound > 0)
- return true;
- return false;
-}
-
-int cNopacityMenuDetailRecordingView::HeightEPGPics(void) {
- int numPicsAvailable = epgpics.size();
- int picsPerLine = contentWidth / (config.GetValue("epgImageWidthLarge") + border);
- int picLines = numPicsAvailable / picsPerLine;
- if (numPicsAvailable%picsPerLine != 0)
- picLines++;
- return picLines * (config.GetValue("epgImageHeightLarge") + border) + 2*border;
-}
-void cNopacityMenuDetailRecordingView::DrawEPGPictures(int height) {
- int picsPerLine = contentWidth / (config.GetValue("epgImageWidthLarge") + border);
- int currentX = border;
- int currentY = height + border;
- int currentPicsPerLine = 1;
- cImageLoader imgLoader;
- for (unsigned i=0; i < epgpics.size(); i++) {
- cString path = cString::sprintf("%s/", recording->FileName());
- cString epgimage = epgpics.at(i).c_str();
- if (imgLoader.LoadAdditionalRecordingImage(path, epgimage)) {
- pixmapContent->DrawImage(cPoint(currentX, currentY), imgLoader.GetImage());
- if (config.GetValue("roundedCorners")) {
- int radius = config.GetValue("cornerRadius");
- DrawRoundedCorners(pixmapContent, radius, currentX, currentY, config.GetValue("epgImageWidthLarge"), config.GetValue("epgImageHeightLarge"));
- }
- if (currentPicsPerLine < picsPerLine) {
- currentX += config.GetValue("epgImageWidthLarge") + border;
- currentPicsPerLine++;
- } else {
- currentX = border;
- currentY += config.GetValue("epgImageHeightLarge") + border;
- currentPicsPerLine = 1;
- }
- } else {
- break;
- }
- }
-}
-
-void cNopacityMenuDetailRecordingView::DrawHeader(void) {
- cImageLoader imgLoader;
- int widthTextHeader = width - 2 * border;
- if (isSeries && series.episode.episodeImage.path.size() > 0) {
- int imgWidth = series.episode.episodeImage.width;
- int imgHeight = series.episode.episodeImage.height;
- if (imgHeight > headerHeight) {
- imgHeight = headerHeight - 6;
- imgWidth = imgWidth * ((double)imgHeight / (double)series.episode.episodeImage.height);
- }
- if (imgLoader.LoadPoster(series.episode.episodeImage.path.c_str(), imgWidth, imgHeight)) {
- pixmapHeader->DrawImage(cPoint(width - imgWidth - border, (headerHeight - imgHeight)/2), imgLoader.GetImage());
- widthTextHeader -= imgWidth;
- }
- } else if ((config.GetValue("displayAdditionalRecEPGPictures") == 1) && imgLoader.LoadRecordingImage(recording->FileName())) {
- pixmapHeader->DrawImage(cPoint(width - config.GetValue("epgImageWidth") - border, (headerHeight-config.GetValue("epgImageHeight"))/2), imgLoader.GetImage());
- if (config.GetValue("roundedCorners")) {
- int radius = config.GetValue("cornerRadius");
- int x = width - config.GetValue("epgImageWidth") - border;
- int y = (headerHeight-config.GetValue("epgImageHeight"))/2;
- DrawRoundedCorners(pixmapHeader, radius, x, y, config.GetValue("epgImageWidth"), config.GetValue("epgImageHeight"));
- }
- widthTextHeader -= config.GetValue("epgImageWidth");
- }
- int lineHeight = fontHeaderLarge->Height();
- int recDuration = recording->LengthInSeconds();
- recDuration = (recDuration>0)?(recDuration / 60):0;
- cString dateTime = cString::sprintf("%s %s (%d %s)", *DateString(recording->Start()), *TimeString(recording->Start()), recDuration, tr("min"));
- pixmapHeader->DrawText(cPoint(border, (lineHeight - fontHeader->Height())/2), *dateTime, Theme.Color(clrMenuFontDetailViewHeader), clrTransparent, fontHeader);
-
- const char *Title = info->Title();
- if (isempty(Title))
- Title = recording->Name();
- cTextWrapper title;
- title.Set(Title, fontHeaderLarge, widthTextHeader);
- int currentLineHeight = lineHeight;
- for (int i=0; i < title.Lines(); i++) {
- pixmapHeader->DrawText(cPoint(border, currentLineHeight), title.GetLine(i), Theme.Color(clrMenuFontDetailViewHeaderTitle), clrTransparent, fontHeaderLarge);
- currentLineHeight += lineHeight;
- }
-
- if (!isempty(info->ShortText())) {
- cTextWrapper shortText;
- shortText.Set(info->ShortText(), fontHeader, widthTextHeader);
- for (int i=0; i < shortText.Lines(); i++) {
- if ((currentLineHeight + fontHeader->Height()) < headerHeight) {
- pixmapHeader->DrawText(cPoint(border, currentLineHeight), shortText.GetLine(i), Theme.Color(clrMenuFontDetailViewHeader), clrTransparent, fontHeader);
- currentLineHeight += fontHeader->Height();
- } else
- break;
- }
+ if (!foundRerun) {
+ sstrReruns << std::endl << tr("No reruns found");
}
+ return sstrReruns.str();
}
-void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
- const cRecordingInfo *Info = recording->Info();
+std::string cNopacityDetailView::LoadRecordingInformation(void) {
+ const cRecordingInfo *Info = rec->Info();
unsigned long long nRecSize = -1;
unsigned long long nFileSize[1000];
nFileSize[0] = 0;
@@ -1278,10 +206,10 @@ void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
cString filename;
int rc = 0;
do {
- if (recording->IsPesRecording())
- filename = cString::sprintf("%s/%03d.vdr", recording->FileName(), ++i);
+ if (rec->IsPesRecording())
+ filename = cString::sprintf("%s/%03d.vdr", rec->FileName(), ++i);
else
- filename = cString::sprintf("%s/%05d.ts", recording->FileName(), ++i);
+ filename = cString::sprintf("%s/%05d.ts", rec->FileName(), ++i);
rc = stat(filename, &filebuf);
if (rc == 0)
nFileSize[i] = nFileSize[i-1] + filebuf.st_size;
@@ -1293,8 +221,8 @@ void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
nRecSize = nFileSize[i-1];
cMarks marks;
- bool fHasMarks = marks.Load(recording->FileName(), recording->FramesPerSecond(), recording->IsPesRecording()) && marks.Count();
- cIndexFile *index = new cIndexFile(recording->FileName(), false, recording->IsPesRecording());
+ bool fHasMarks = marks.Load(rec->FileName(), rec->FramesPerSecond(), rec->IsPesRecording()) && marks.Count();
+ cIndexFile *index = new cIndexFile(rec->FileName(), false, rec->IsPesRecording());
int nCutLength = 0;
long nCutInFrame = 0;
@@ -1338,8 +266,8 @@ void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
if (channel)
sstrInfo << trVDR("Channel") << ": " << channel->Number() << " - " << channel->Name() << std::endl;
if (nRecSize < 0) {
- if ((nRecSize = ReadSizeVdr(recording->FileName())) < 0) {
- nRecSize = DirSizeMB(recording->FileName());
+ if ((nRecSize = ReadSizeVdr(rec->FileName())) < 0) {
+ nRecSize = DirSizeMB(rec->FileName());
}
}
if (nRecSize >= 0) {
@@ -1363,12 +291,12 @@ void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
if (nLastIndex) {
cString strLength;
if (fHasMarks) {
- strLength = cString::sprintf("%s: %s (%s %s)", tr("Length"), *IndexToHMSF(nLastIndex, false, recording->FramesPerSecond()), tr("cut"), *IndexToHMSF(nCutLength, false, recording->FramesPerSecond()));
+ strLength = cString::sprintf("%s: %s (%s %s)", tr("Length"), *IndexToHMSF(nLastIndex, false, rec->FramesPerSecond()), tr("cut"), *IndexToHMSF(nCutLength, false, rec->FramesPerSecond()));
} else {
- strLength = cString::sprintf("%s: %s", tr("Length"), *IndexToHMSF(nLastIndex, false, recording->FramesPerSecond()));
+ strLength = cString::sprintf("%s: %s", tr("Length"), *IndexToHMSF(nLastIndex, false, rec->FramesPerSecond()));
}
sstrInfo << (const char*)strLength << std::endl;
- cString strBitrate = cString::sprintf("%s: %s\n%s: %.2f MBit/s (Video+Audio)", tr("Format"), recording->IsPesRecording() ? "PES" : "TS", tr("Est. bitrate"), (float)nRecSize / nLastIndex * recording->FramesPerSecond() * 8 / MEGABYTE(1));
+ cString strBitrate = cString::sprintf("%s: %s\n%s: %.2f MBit/s (Video+Audio)", tr("Format"), rec->IsPesRecording() ? "PES" : "TS", tr("Est. bitrate"), (float)nRecSize / nLastIndex * rec->FramesPerSecond() * 8 / MEGABYTE(1));
sstrInfo << (const char*)strBitrate << std::endl;
}
}
@@ -1389,10 +317,10 @@ void cNopacityMenuDetailRecordingView::LoadRecordingInformation(void) {
}
}
- additionalInfo.Set(sstrInfo.str().c_str(), font, width - 4 * border);
+ return sstrInfo.str();
}
-std::string cNopacityMenuDetailRecordingView::StripXmlTag(std::string &Line, const char *Tag) {
+std::string cNopacityDetailView::StripXmlTag(std::string &Line, const char *Tag) {
// set the search strings
std::stringstream strStart, strStop;
strStart << "<" << Tag << ">";
@@ -1409,7 +337,7 @@ std::string cNopacityMenuDetailRecordingView::StripXmlTag(std::string &Line, con
}
-int cNopacityMenuDetailRecordingView::ReadSizeVdr(const char *strPath) {
+int cNopacityDetailView::ReadSizeVdr(const char *strPath) {
int dirSize = -1;
char buffer[20];
char *strFilename = NULL;
@@ -1429,47 +357,17 @@ int cNopacityMenuDetailRecordingView::ReadSizeVdr(const char *strPath) {
return dirSize;
}
-//---------------cNopacityMenuDetailTextView---------------------
-
-cNopacityMenuDetailTextView::cNopacityMenuDetailTextView(cOsd *osd, const char *text) : cNopacityMenuDetailView(osd, NULL) {
- this->text = text;
-}
-
-cNopacityMenuDetailTextView::~cNopacityMenuDetailTextView(void) {
- osd->DestroyPixmap(pixmapContent);
-}
-
-void cNopacityMenuDetailTextView::SetFonts(void) {
- font = cFont::CreateFont(config.fontName, contentHeight / 25 + config.GetValue("fontDetailView"));
- fontSmall = NULL;
- fontHeaderLarge = NULL;
- fontHeader = NULL;
-}
-
-void cNopacityMenuDetailTextView::SetContent(void) {
- content.Set(text, font, width - 4 * border);
-}
-
-void cNopacityMenuDetailTextView::SetContentHeight(void) {
- int lineHeight = font->Height();
- int linesContent = content.Lines() + 1;
-
- int heightContentText = linesContent * lineHeight;
- if (heightContentText > contentHeight) {
- contentDrawPortHeight = heightContentText;
- hasScrollbar = true;
- } else {
- contentDrawPortHeight = contentHeight;
- }
-}
-
-void cNopacityMenuDetailTextView::CreatePixmaps(void) {
- pixmapContent = osd->CreatePixmap(3, cRect(x, top + headerHeight, width, contentHeight),
- cRect(0, 0, width, contentDrawPortHeight));
-
- pixmapContent->Fill(clrTransparent);
-}
-
-void cNopacityMenuDetailTextView::Render(void) {
- DrawTextWrapper(&content, 0);
+void cNopacityDetailView::Action(void) {
+ InitiateViewType();
+ if (!view)
+ return;
+ view->SetGeometry(x, top, width, height, border, headerHeight);
+ view->SetFonts();
+ view->SetScrollbarPixmaps(scrollBar, scrollBarBack);
+ view->LoadMedia();
+ view->Start();
+ if (ev)
+ view->SetAdditionalInfoText(LoadReruns());
+ else if (rec)
+ view->SetAdditionalInfoText(LoadRecordingInformation());
}
diff --git a/menudetailview.h b/menudetailview.h
index d3dd038..197a0a1 100644
--- a/menudetailview.h
+++ b/menudetailview.h
@@ -6,128 +6,48 @@
#include <vector>
#include <string>
+#include <sstream>
#include "services/scraper2vdr.h"
#include "services/tvscraper.h"
+#include "services/epgsearch.h"
#include "imagecache.h"
+#include "config.h"
+#include "detailview.h"
-class cNopacityMenuDetailView : public cThread {
+enum eDetailViewType {
+ dvEvent = 0,
+ dvRecording,
+ dvText
+};
+
+class cNopacityDetailView : public cThread {
protected:
+ eDetailViewType type;
cOsd *osd;
cImageCache *imgCache;
- bool hasScrollbar;
- int x, width, height, top;
+ const cEvent *ev;
+ const cRecording *rec;
+ const char *text;
+ cNopacityView *view;
+ cPixmap *scrollBar;
+ cPixmap *scrollBarBack;
+ int x, width, height, top, border;
int headerHeight;
- int contentWidth;
- int contentX;
- int contentHeight;
- int contentDrawPortHeight;
- int widthPoster;
- int border;
- int yBanner;
- int yEPGText;
- int yActors;
- int yScrapInfo;
- int yFanart;
- int yAddInf;
- int yEPGPics;
- int actorThumbWidth;
- int actorThumbHeight;
- cFont *font, *fontSmall, *fontHeader, *fontHeaderLarge;
- cPixmap *pixmapHeader;
- cPixmap *pixmapLogo;
- cPixmap *pixmapContent;
- cPixmap *pixmapPoster;
- bool hasManualPoster;
- cString manualPosterPath;
- cMovie movie;
- cSeries series;
- bool isMovie;
- bool isSeries;
- cTextWrapper scrapInfo;
- TVScraperGetFullInformation mediaInfo;
- bool hasAdditionalMedia;
- void DrawTextWrapper(cTextWrapper *wrapper, int top);
- int HeightActorPics(void);
- int HeightScraperInfo(void);
- int HeightFanart(void);
- void DrawPoster(void);
- void DrawBanner(int height);
- void DrawAdditionalBanners(int top, int bottom);
- void DrawActors(int height);
- void DrawFanart(int height);
- virtual void Action(void) {};
-public:
- cNopacityMenuDetailView(cOsd *osd, cImageCache *imgCache);
- virtual ~cNopacityMenuDetailView(void);
- void SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight);
- virtual void SetFonts(void) = 0;
- bool Scrollable(void) {return hasScrollbar;}
- double ScrollbarSize(void);
- double Offset(void);
- bool Scroll(bool Up, bool Page);
- virtual void SetContent(void) = 0;
- virtual void SetContentHeight(void) = 0;
- virtual void CreatePixmaps(void) = 0;
- virtual void Render(void) = 0;
-};
-
-class cNopacityMenuDetailEventView : public cNopacityMenuDetailView {
-private:
- const cEvent *event;
- cTextWrapper epgText;
- cTextWrapper reruns;
- int numEPGPics;
- void DrawHeader(void);
- void LoadReruns(void);
- int HeightEPGPics(void);
- void DrawEPGPictures(int height);
- void Action(void);
-public:
- cNopacityMenuDetailEventView(cOsd *osd, cImageCache *imgCache, const cEvent *Event);
- virtual ~cNopacityMenuDetailEventView(void);
- void SetContent(void);
- void SetContentHeight(void);
- void CreatePixmaps(void);
- void SetFonts(void);
- void Render(void);
-};
-
-class cNopacityMenuDetailRecordingView : public cNopacityMenuDetailView {
-private:
- const cRecording *recording;
- const cRecordingInfo *info;
- cTextWrapper recInfo;
- cTextWrapper additionalInfo;
- void DrawHeader(void);
- void LoadRecordingInformation(void);
+ void InitiateViewType(void);
+ std::string LoadReruns(void);
+ std::string LoadRecordingInformation(void);
std::string StripXmlTag(std::string &Line, const char *Tag);
int ReadSizeVdr(const char *strPath);
- std::vector<std::string> epgpics;
- bool LoadEPGPics(void);
- int HeightEPGPics(void);
- void DrawEPGPictures(int height);
- void Action(void);
+ virtual void Action(void);
public:
- cNopacityMenuDetailRecordingView(cOsd *osd, const cRecording *Recording);
- virtual ~cNopacityMenuDetailRecordingView(void);
- void SetContent(void);
- void SetContentHeight(void);
- void CreatePixmaps(void);
- void SetFonts(void);
- void Render(void);
+ cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd, cImageCache *imgCache);
+ virtual ~cNopacityDetailView(void);
+ void SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight);
+ void SetEvent(const cEvent *e) { ev = e; };
+ void SetRecording(const cRecording *r) { rec = r; };
+ void SetText(const char *t) { text = t; };
+ void SetScrollBar(cPixmap *s, cPixmap *sBack) { scrollBar = s; scrollBarBack = sBack; };
+ void KeyInput(bool Up, bool Page);
};
-class cNopacityMenuDetailTextView : public cNopacityMenuDetailView {
-private:
- const char *text;
- cTextWrapper content;
-public:
- cNopacityMenuDetailTextView(cOsd *osd, const char *text);
- virtual ~cNopacityMenuDetailTextView(void);
- void SetContent(void);
- void SetContentHeight(void);
- void CreatePixmaps(void);
- void SetFonts(void);
- void Render(void);
-};
#endif //__NOPACITY_MENUDETAILVIEW_H \ No newline at end of file
diff --git a/po/ca_ES.po b/po/ca_ES.po
index a6ef9e7..e286f27 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.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: 2014-03-28 17:12+0100\n"
+"POT-Creation-Date: 2014-04-25 14:39+0200\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Gabychan <gbonich@gmail.com>\n"
"Language-Team: \n"
@@ -20,34 +20,28 @@ msgstr ""
"X-Poedit-Country: Catalunya\n"
"X-Poedit-SourceCharset: utf-8\n"
-msgid "free"
-msgstr "lliure"
-
-msgid "Volume"
-msgstr "Volum"
-
-msgid "images"
-msgstr "imatges"
+msgid "No Cast available"
+msgstr ""
-msgid "TheTVDB Information"
+msgid "Cast"
msgstr ""
-msgid "Series Overview"
+msgid "EPG Info"
msgstr ""
-msgid "First aired"
+msgid "Reruns"
msgstr ""
-msgid "Genre"
+msgid "Recording Information"
msgstr ""
-msgid "Network"
+msgid "Image Galery"
msgstr ""
-msgid "TheMovieDB Rating"
+msgid "TheTVDB Info"
msgstr ""
-msgid "Status"
+msgid "TheTVDB Information"
msgstr ""
msgid "Episode"
@@ -59,9 +53,27 @@ msgstr ""
msgid "Episode Overview"
msgstr ""
+msgid "First aired"
+msgstr ""
+
msgid "Guest Stars"
msgstr ""
+msgid "TheMovieDB Rating"
+msgstr ""
+
+msgid "Series Overview"
+msgstr ""
+
+msgid "Genre"
+msgstr ""
+
+msgid "Network"
+msgstr ""
+
+msgid "Status"
+msgstr ""
+
msgid "TheMovieDB Information"
msgstr ""
@@ -110,14 +122,23 @@ msgstr ""
msgid "TheMovieDB Vote Average"
msgstr ""
-msgid "Actors"
-msgstr "Actors"
+msgid "free"
+msgstr "lliure"
+
+msgid "Volume"
+msgstr "Volum"
+
+msgid "images"
+msgstr "imatges"
msgid "min"
msgstr "min"
-msgid "RERUNS OF THIS SHOW"
-msgstr "REEMISSIONS"
+msgid "Reruns of "
+msgstr ""
+
+msgid "No reruns found"
+msgstr ""
msgid "Size"
msgstr "Mida"
@@ -404,6 +425,9 @@ msgstr "Alçada Finestra Info EPG (% alçada OSD)"
msgid "Border around detailed EPG view"
msgstr "Vora al voltant de vista detallada EPG"
+msgid "Header Height detailed EPG view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display Reruns in detailed EPG View"
msgstr "Mostra Reemissions a vista detallada EPG"
@@ -467,6 +491,9 @@ msgstr "Mode de gravació"
msgid "Border around detailed recording view"
msgstr "Vora al voltant de vista registre detallat"
+msgid "Header Height detailed recording view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display additional EPG Pictures in detailed recording View"
msgstr "Mostra imatges EPG addicionals a vista detallada gravacions"
@@ -632,5 +659,11 @@ msgstr "conflicte"
msgid "conflicts"
msgstr "conflictes"
+#~ msgid "RERUNS OF THIS SHOW"
+#~ msgstr "REEMISSIONS"
+
+#~ msgid "Actors"
+#~ msgstr "Actors"
+
#~ msgid "Display Channel Source information"
#~ msgstr "Mostra informació del canal"
diff --git a/po/de_DE.po b/po/de_DE.po
index d0b972f..a778d11 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: 2014-03-28 17:12+0100\n"
+"POT-Creation-Date: 2014-04-25 14:39+0200\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -17,35 +17,29 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "free"
-msgstr "frei"
-
-msgid "Volume"
-msgstr "Lautstärke"
-
-msgid "images"
-msgstr "Bilder"
+msgid "No Cast available"
+msgstr "Keine Besetzung vorhanden"
-msgid "TheTVDB Information"
-msgstr "TheTVDB Information"
+msgid "Cast"
+msgstr "Besetzung"
-msgid "Series Overview"
-msgstr "Serienüberblick"
+msgid "EPG Info"
+msgstr "EPG Info"
-msgid "First aired"
-msgstr "Erstausstrahlung"
+msgid "Reruns"
+msgstr "Wiederholungen"
-msgid "Genre"
-msgstr "Genre"
+msgid "Recording Information"
+msgstr "Aufnahme Infos"
-msgid "Network"
-msgstr "Sendeanstalt"
+msgid "Image Galery"
+msgstr "Bildergalerie"
-msgid "TheMovieDB Rating"
-msgstr "TheMovieDB Wertung"
+msgid "TheTVDB Info"
+msgstr "TheTVDB Info"
-msgid "Status"
-msgstr "Status"
+msgid "TheTVDB Information"
+msgstr "TheTVDB Information"
msgid "Episode"
msgstr "Episode"
@@ -56,9 +50,27 @@ msgstr "Staffel"
msgid "Episode Overview"
msgstr "Episodenüberblick"
+msgid "First aired"
+msgstr "Erstausstrahlung"
+
msgid "Guest Stars"
msgstr "Gast Stars"
+msgid "TheMovieDB Rating"
+msgstr "TheMovieDB Wertung"
+
+msgid "Series Overview"
+msgstr "Serienüberblick"
+
+msgid "Genre"
+msgstr "Genre"
+
+msgid "Network"
+msgstr "Sendeanstalt"
+
+msgid "Status"
+msgstr "Status"
+
msgid "TheMovieDB Information"
msgstr "TheMovieDB Information"
@@ -107,14 +119,23 @@ msgstr "TheMovieDB Popularität"
msgid "TheMovieDB Vote Average"
msgstr "TheMovieDB durchschnittliche Bewertung"
-msgid "Actors"
-msgstr "Schauspieler"
+msgid "free"
+msgstr "frei"
+
+msgid "Volume"
+msgstr "Lautstärke"
+
+msgid "images"
+msgstr "Bilder"
msgid "min"
msgstr "min"
-msgid "RERUNS OF THIS SHOW"
-msgstr "Wiederholungen dieser Sendung"
+msgid "Reruns of "
+msgstr "Wiederholungen der Sendung "
+
+msgid "No reruns found"
+msgstr "Keine Wiederholungen gefunden"
msgid "Size"
msgstr "Größe"
@@ -401,6 +422,9 @@ msgstr "Höhe des EPG Info Fensters (% der OSD Höhe)"
msgid "Border around detailed EPG view"
msgstr "Rahmen um detailierte EPG Ansicht"
+msgid "Header Height detailed EPG view (Perc. of OSD Height)"
+msgstr "Header Höhe im det. EPG Ansicht (% OSD Höhe)"
+
msgid "Display Reruns in detailed EPG View"
msgstr "Wiederholungen in der detailierten EPG Ansicht anzeigen"
@@ -464,6 +488,9 @@ msgstr "Aufnahme Fenster Modus"
msgid "Border around detailed recording view"
msgstr "Rahmen um detailierte Aufnahmeansicht"
+msgid "Header Height detailed recording view (Perc. of OSD Height)"
+msgstr "Header Höhe in der det. Aufnahmeansicht (% der OSD Höhe)"
+
msgid "Display additional EPG Pictures in detailed recording View"
msgstr "Weitere EPG Bilder in der detaillierten Aufnahmeansicht anzeigen"
@@ -628,3 +655,9 @@ msgstr "Konflikt"
msgid "conflicts"
msgstr "Konflikte"
+
+#~ msgid "RERUNS OF THIS SHOW"
+#~ msgstr "Wiederholungen dieser Sendung"
+
+#~ msgid "Actors"
+#~ msgstr "Schauspieler"
diff --git a/po/it_IT.po b/po/it_IT.po
index 1c94fea..5156c0a 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: 2014-03-28 17:12+0100\n"
+"POT-Creation-Date: 2014-04-25 14:39+0200\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -20,34 +20,28 @@ msgstr ""
"X-Poedit-Country: ITALY\n"
"X-Poedit-SourceCharset: utf-8\n"
-msgid "free"
-msgstr "disponibili"
-
-msgid "Volume"
-msgstr "Volume"
-
-msgid "images"
+msgid "No Cast available"
msgstr ""
-msgid "TheTVDB Information"
+msgid "Cast"
msgstr ""
-msgid "Series Overview"
+msgid "EPG Info"
msgstr ""
-msgid "First aired"
+msgid "Reruns"
msgstr ""
-msgid "Genre"
+msgid "Recording Information"
msgstr ""
-msgid "Network"
+msgid "Image Galery"
msgstr ""
-msgid "TheMovieDB Rating"
+msgid "TheTVDB Info"
msgstr ""
-msgid "Status"
+msgid "TheTVDB Information"
msgstr ""
msgid "Episode"
@@ -59,9 +53,27 @@ msgstr ""
msgid "Episode Overview"
msgstr ""
+msgid "First aired"
+msgstr ""
+
msgid "Guest Stars"
msgstr ""
+msgid "TheMovieDB Rating"
+msgstr ""
+
+msgid "Series Overview"
+msgstr ""
+
+msgid "Genre"
+msgstr ""
+
+msgid "Network"
+msgstr ""
+
+msgid "Status"
+msgstr ""
+
msgid "TheMovieDB Information"
msgstr ""
@@ -110,14 +122,23 @@ msgstr ""
msgid "TheMovieDB Vote Average"
msgstr ""
-msgid "Actors"
+msgid "free"
+msgstr "disponibili"
+
+msgid "Volume"
+msgstr "Volume"
+
+msgid "images"
msgstr ""
msgid "min"
msgstr "min"
-msgid "RERUNS OF THIS SHOW"
-msgstr "REPLICHE DI QUESTO SPETTACOLO"
+msgid "Reruns of "
+msgstr ""
+
+msgid "No reruns found"
+msgstr ""
msgid "Size"
msgstr "Dimensione"
@@ -404,6 +425,9 @@ msgstr "Altezza di Finestra info EPG (% altezza OSD)"
msgid "Border around detailed EPG view"
msgstr ""
+msgid "Header Height detailed EPG view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display Reruns in detailed EPG View"
msgstr "Mostra repliche in vista dettagli EPG"
@@ -467,6 +491,9 @@ msgstr ""
msgid "Border around detailed recording view"
msgstr ""
+msgid "Header Height detailed recording view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display additional EPG Pictures in detailed recording View"
msgstr "Mostra immagini EPG aggiuntivo nella vista dettagli registrazione"
@@ -631,3 +658,6 @@ msgstr "conflitto"
msgid "conflicts"
msgstr "conflitti"
+
+#~ msgid "RERUNS OF THIS SHOW"
+#~ msgstr "REPLICHE DI QUESTO SPETTACOLO"
diff --git a/po/sk_SK.po b/po/sk_SK.po
index d40a9c1..a8c902c 100644
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinnopacity\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2014-03-28 17:12+0100\n"
+"POT-Creation-Date: 2014-04-25 14:39+0200\n"
"PO-Revision-Date: 2013-11-11 20:52+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -17,34 +17,28 @@ msgstr ""
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "free"
-msgstr "voµné"
-
-msgid "Volume"
-msgstr "Hlasitos»"
-
-msgid "images"
-msgstr "obrázkov"
+msgid "No Cast available"
+msgstr ""
-msgid "TheTVDB Information"
+msgid "Cast"
msgstr ""
-msgid "Series Overview"
+msgid "EPG Info"
msgstr ""
-msgid "First aired"
+msgid "Reruns"
msgstr ""
-msgid "Genre"
+msgid "Recording Information"
msgstr ""
-msgid "Network"
+msgid "Image Galery"
msgstr ""
-msgid "TheMovieDB Rating"
+msgid "TheTVDB Info"
msgstr ""
-msgid "Status"
+msgid "TheTVDB Information"
msgstr ""
msgid "Episode"
@@ -56,9 +50,27 @@ msgstr ""
msgid "Episode Overview"
msgstr ""
+msgid "First aired"
+msgstr ""
+
msgid "Guest Stars"
msgstr ""
+msgid "TheMovieDB Rating"
+msgstr ""
+
+msgid "Series Overview"
+msgstr ""
+
+msgid "Genre"
+msgstr ""
+
+msgid "Network"
+msgstr ""
+
+msgid "Status"
+msgstr ""
+
msgid "TheMovieDB Information"
msgstr ""
@@ -107,14 +119,23 @@ msgstr ""
msgid "TheMovieDB Vote Average"
msgstr ""
-msgid "Actors"
-msgstr "Herci"
+msgid "free"
+msgstr "voµné"
+
+msgid "Volume"
+msgstr "Hlasitos»"
+
+msgid "images"
+msgstr "obrázkov"
msgid "min"
msgstr "min"
-msgid "RERUNS OF THIS SHOW"
-msgstr "Repríza"
+msgid "Reruns of "
+msgstr ""
+
+msgid "No reruns found"
+msgstr ""
msgid "Size"
msgstr "Veµkos»"
@@ -401,6 +422,9 @@ msgstr "Vý¹ka informaèného EPG okna (Percent z OSD vý¹ky)"
msgid "Border around detailed EPG view"
msgstr "Okraj okolo podrobného zobrazenia EPG"
+msgid "Header Height detailed EPG view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display Reruns in detailed EPG View"
msgstr "Zobrazi» reprízy v podrobnostiach EPG"
@@ -464,6 +488,9 @@ msgstr "Spôsob zobrazenia okna nahrávok"
msgid "Border around detailed recording view"
msgstr "Okraj okolo podrobného zobrazenia nahrávky"
+msgid "Header Height detailed recording view (Perc. of OSD Height)"
+msgstr ""
+
msgid "Display additional EPG Pictures in detailed recording View"
msgstr "Zobrazi» ïal¹ie EPG obrázky v podrobnom zobrazení nahrávky"
@@ -629,5 +656,11 @@ msgstr "konflikt"
msgid "conflicts"
msgstr "konflikty"
+#~ msgid "RERUNS OF THIS SHOW"
+#~ msgstr "Repríza"
+
+#~ msgid "Actors"
+#~ msgstr "Herci"
+
#~ msgid "Display Channel Source information"
#~ msgstr "Zobrazi» zdroj kanálu"
diff --git a/setup.c b/setup.c
index ddabdfd..0735bb6 100644
--- a/setup.c
+++ b/setup.c
@@ -252,6 +252,7 @@ void cNopacitySetupMenuDisplaySchedules::Set(void) {
Add(new cMenuEditStraItem(tr("EPG Window Text Scrolling Speed"), tmpConf->GetValueRef("menuInfoScrollSpeed"), 4, scrollSpeed));
Add(new cMenuEditIntItem(tr("Height of EPG Info Window (Percent of OSD Height)"), tmpConf->GetValueRef("menuHeightInfoWindow"), 10, 100));
Add(new cMenuEditIntItem(tr("Border around detailed EPG view"), tmpConf->GetValueRef("borderDetailedEPG"), 1, 300));
+ Add(new cMenuEditIntItem(tr("Header Height detailed EPG view (Perc. of OSD Height)"), tmpConf->GetValueRef("headerDetailedEPG"), 10, 50));
Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), tmpConf->GetValueRef("displayRerunsDetailEPGView")));
if (tmpConf->GetValue("displayRerunsDetailEPGView")) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Number of reruns to display")), tmpConf->GetValueRef("numReruns"), 1, 10));
@@ -345,6 +346,7 @@ void cNopacitySetupMenuDisplayRecordings::Set(void) {
Add(new cMenuEditIntItem(tr("Number of entires per page"), tmpConf->GetValueRef("numRecordingsMenuItems"), 3, 20));
Add(new cMenuEditStraItem(tr("Mode of recording Window"), tmpConf->GetValueRef("menuRecordingsWindowMode"), 2, windowMode));
Add(new cMenuEditIntItem(tr("Border around detailed recording view"), tmpConf->GetValueRef("borderDetailedRecordings"), 1, 300));
+ Add(new cMenuEditIntItem(tr("Header Height detailed recording view (Perc. of OSD Height)"), tmpConf->GetValueRef("headerDetailedRecordings"), 10, 50));
Add(new cMenuEditStraItem(tr("Display additional EPG Pictures in detailed recording View"), tmpConf->GetValueRef("displayAdditionalRecEPGPictures"), 3, displayEPGPictures));
if (tmpConf->GetValue("displayAdditionalRecEPGPictures"))
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Number of EPG pictures to display")), tmpConf->GetValueRef("numAdditionalRecEPGPictures"), 1, 9));
diff --git a/skinnopacity.c b/skinnopacity.c
index aa0af15..41c3f55 100644
--- a/skinnopacity.c
+++ b/skinnopacity.c
@@ -19,7 +19,7 @@
#endif
-static const char *VERSION = "1.1.1";
+static const char *VERSION = "1.1.2";
static const char *DESCRIPTION = "'nOpacity' Skin";
static const char *MAINMENUENTRY = "nOpacity";
diff --git a/themes/nOpacity-blue.theme b/themes/nOpacity-blue.theme
index 42e630f..de075e2 100644
--- a/themes/nOpacity-blue.theme
+++ b/themes/nOpacity-blue.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD858585
clrProgressBarBlendHigh = DD80B3FF
clrMenuTextWindow = DD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-darkblue.theme b/themes/nOpacity-darkblue.theme
index 34dd385..c0de500 100644
--- a/themes/nOpacity-darkblue.theme
+++ b/themes/nOpacity-darkblue.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD858585
clrProgressBarBlendHigh = DD031B3C
clrMenuTextWindow = DD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-darkgrey.theme b/themes/nOpacity-darkgrey.theme
index ee5d1bb..e2c2d70 100644
--- a/themes/nOpacity-darkgrey.theme
+++ b/themes/nOpacity-darkgrey.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD858585
clrProgressBarBlendHigh = DD80B3FF
clrMenuTextWindow = BD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-darkred.theme b/themes/nOpacity-darkred.theme
index 94ef612..63abf23 100644
--- a/themes/nOpacity-darkred.theme
+++ b/themes/nOpacity-darkred.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD222222
clrProgressBarBlendHigh = DD550000
clrMenuTextWindow = DD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FF000000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-darkredNG.theme b/themes/nOpacity-darkredNG.theme
index e90d7b4..3175207 100644
--- a/themes/nOpacity-darkredNG.theme
+++ b/themes/nOpacity-darkredNG.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD222222
clrProgressBarBlendHigh = DD550000
clrMenuTextWindow = DD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = AA000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FF000000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-default.theme b/themes/nOpacity-default.theme
index 8fed3ee..e206db7 100644
--- a/themes/nOpacity-default.theme
+++ b/themes/nOpacity-default.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD000000
clrProgressBarBlendHigh = DD80B3FF
clrMenuTextWindow = B0000000
clrMenuChannelLogoBack = 99C6C6C6
+clrMenuDetailViewBack = 50000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-green.theme b/themes/nOpacity-green.theme
index 499f80c..4871963 100644
--- a/themes/nOpacity-green.theme
+++ b/themes/nOpacity-green.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD858585
clrProgressBarBlendHigh = DD006600
clrMenuTextWindow = DD000000
clrMenuChannelLogoBack = DD858585
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-iceblue.theme b/themes/nOpacity-iceblue.theme
index 76a06c9..0191308 100644
--- a/themes/nOpacity-iceblue.theme
+++ b/themes/nOpacity-iceblue.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = FF000000
clrProgressBarBlendHigh = DD5A8998
clrMenuTextWindow = DDFFFFFF
clrMenuChannelLogoBack = 99C6C6C6
+clrMenuDetailViewBack = 99ABABB8
clrButtonRed = FFCC0000
clrButtonRedBorder = FF000000
clrButtonRedFont = FFFFFFFF
diff --git a/themes/nOpacity-light.theme b/themes/nOpacity-light.theme
index 3b8775e..dbc566c 100644
--- a/themes/nOpacity-light.theme
+++ b/themes/nOpacity-light.theme
@@ -65,6 +65,7 @@ clrProgressBarBackHigh = DD858585
clrProgressBarBlendHigh = DDff3300
clrMenuTextWindow = AA000000
clrMenuChannelLogoBack = 99C6C6C6
+clrMenuDetailViewBack = 55000000
clrButtonRed = 99BB0000
clrButtonRedBorder = 99BB0000
clrButtonRedFont = FFFFFFFF