summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-09-16 14:23:07 +0200
committerlouis <louis.braun@gmx.de>2013-09-16 14:23:07 +0200
commit5e0f765afd384e1f0418cd9eec0c2bd85b44678d (patch)
tree5692a5fd9527f9340904b134e5ae0466446db829
parentebf0862dfa77c9427346a87e7f08fb7eb812a7ef (diff)
downloadskin-nopacity-5e0f765afd384e1f0418cd9eec0c2bd85b44678d.tar.gz
skin-nopacity-5e0f765afd384e1f0418cd9eec0c2bd85b44678d.tar.bz2
added support for manual recording posters
-rw-r--r--HISTORY10
-rw-r--r--config.c4
-rw-r--r--config.h2
-rw-r--r--icons/skinIcons/defaultPoster.pngbin0 -> 6224 bytes
-rw-r--r--imageloader.c21
-rw-r--r--imageloader.h1
-rw-r--r--menudetailview.c74
-rw-r--r--menudetailview.h2
-rw-r--r--menuitem.c85
-rw-r--r--menuitem.h2
-rw-r--r--po/ca_ES.po8
-rw-r--r--po/de_DE.po8
-rw-r--r--po/it_IT.po8
-rw-r--r--po/sk_SK.po8
-rw-r--r--setup.c4
-rw-r--r--textwindow.c52
-rw-r--r--textwindow.h3
17 files changed, 204 insertions, 88 deletions
diff --git a/HISTORY b/HISTORY
index 6795b26..7ba74ca 100644
--- a/HISTORY
+++ b/HISTORY
@@ -273,4 +273,12 @@ Version 0.1.4
fullscreen mode is configured in plugin setup, the right area next to the
list of events /recordings is completely used to display immeditately the
detailed information of the selected event / recording.
-- added some rounded corners (if activated in setup)
+- added some rounded corners (if activated in setup) for posters and banners
+- added rounded corners for message display
+- fixed issue with gradient display for newer imagemagick versions
+- added setup option to display poster or fanart in channel display
+- possibility to set manual poster for recordings. This manual poster has to
+ be named as "cover_vdr.jpg" and has to be placed directly in the recording
+ folder. For series it is also possible to place a common poster for all
+ series in a folder two or three directories above the actual recording
+ folders. If a manual poster is found, all tvscraper information is ignored.
diff --git a/config.c b/config.c
index 9064b38..6088c3c 100644
--- a/config.c
+++ b/config.c
@@ -125,6 +125,8 @@ cNopacityConfig::cNopacityConfig() {
epgImageHeight = 160;
epgImageWidthLarge = 525;
epgImageHeightLarge = 400;
+ posterWidth = 500;
+ posterHeight = 750;
menuRecFolderSize = 128;
borderDetailedEPG = 30;
borderDetailedRecordings = 30;
@@ -412,6 +414,8 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value);
else if (strcmp(Name, "epgImageWidthLarge") == 0) epgImageWidthLarge = atoi(Value);
else if (strcmp(Name, "epgImageHeightLarge") == 0) epgImageHeightLarge = atoi(Value);
+ else if (strcmp(Name, "posterWidth") == 0) posterWidth = atoi(Value);
+ else if (strcmp(Name, "posterHeight") == 0) posterHeight = atoi(Value);
else if (strcmp(Name, "menuRecFolderSize") == 0) menuRecFolderSize = atoi(Value);
else if (strcmp(Name, "borderDetailedEPG") == 0) borderDetailedEPG = atoi(Value);
else if (strcmp(Name, "borderDetailedRecordings") == 0) borderDetailedRecordings = atoi(Value);
diff --git a/config.h b/config.h
index 2536aae..9334fc1 100644
--- a/config.h
+++ b/config.h
@@ -158,6 +158,8 @@ class cNopacityConfig {
int epgImageHeight;
int epgImageWidthLarge;
int epgImageHeightLarge;
+ int posterWidth;
+ int posterHeight;
int menuRecFolderSize;
int borderDetailedEPG;
int borderDetailedRecordings;
diff --git a/icons/skinIcons/defaultPoster.png b/icons/skinIcons/defaultPoster.png
new file mode 100644
index 0000000..2e889ad
--- /dev/null
+++ b/icons/skinIcons/defaultPoster.png
Binary files differ
diff --git a/imageloader.c b/imageloader.c
index b57bcc4..b59aa9d 100644
--- a/imageloader.c
+++ b/imageloader.c
@@ -199,6 +199,25 @@ void cImageLoader::DrawBackground2(tColor back, tColor blend, int width, int hei
buffer = tmp;
}
+bool cImageLoader::SearchRecordingPoster(cString recPath, cString &found) {
+ cString manualPoster = cString::sprintf("%s/cover_vdr.jpg", *recPath);
+ if (FileSize(*manualPoster) != -1) {
+ found = manualPoster;
+ return true;
+ }
+ manualPoster = cString::sprintf("%s/../../../cover_vdr.jpg", *recPath);
+ if (FileSize(*manualPoster) != -1) {
+ found = manualPoster;
+ return true;
+ }
+ manualPoster = cString::sprintf("%s/../../cover_vdr.jpg", *recPath);
+ if (FileSize(*manualPoster) != -1) {
+ found = manualPoster;
+ return true;
+ }
+ return false;
+}
+
cImage cImageLoader::GetImage() {
int w, h;
w = buffer.columns();
@@ -264,6 +283,8 @@ bool cImageLoader::FirstImageInFolder(cString Path, cString Extension, cString *
while (file = readdir(folder)) {
if (endswith(file->d_name, *Extension)) {
std::string fileName = file->d_name;
+ if (!fileName.compare("cover_vdr.jpg"))
+ continue;
if (fileName.length() > 4)
fileName = fileName.substr(0, fileName.length() - 4);
else
diff --git a/imageloader.h b/imageloader.h
index 27b90d9..4983539 100644
--- a/imageloader.h
+++ b/imageloader.h
@@ -24,6 +24,7 @@ public:
bool LoadPoster(const char *poster, int width, int height);
void DrawBackground(tColor back, tColor blend, int width, int height, bool mirror = false);
void DrawBackground2(tColor back, tColor blend, int width, int height);
+ bool SearchRecordingPoster(cString recPath, cString &found);
private:
Image buffer;
Color Argb2Color(tColor col);
diff --git a/menudetailview.c b/menudetailview.c
index 2c5b36f..b935b3d 100644
--- a/menudetailview.c
+++ b/menudetailview.c
@@ -8,6 +8,8 @@
cNopacityMenuDetailView::cNopacityMenuDetailView(cOsd *osd) {
this->osd = osd;
hasScrollbar = false;
+ hasManualPoster = false;
+ manualPosterPath = "";
hasAdditionalMedia = false;
pixmapPoster = NULL;
}
@@ -80,13 +82,20 @@ int cNopacityMenuDetailView::HeightFanart(void) {
}
void cNopacityMenuDetailView::DrawPoster(void) {
- if (mediaInfo.posters.size() < 1)
- return;
- int posterWidthOrig = mediaInfo.posters[0].width;
- int posterHeightOrig = mediaInfo.posters[0].height;
+ int posterWidthOrig;
+ int posterHeightOrig;
+ if (hasManualPoster) {
+ posterWidthOrig = config.posterWidth;
+ posterHeightOrig = config.posterHeight;
+ } else {
+ if (mediaInfo.posters.size() < 1)
+ return;
+ posterWidthOrig = mediaInfo.posters[0].width;
+ posterHeightOrig = mediaInfo.posters[0].height;
+ }
int posterWidth = posterWidthOrig;
int posterHeight = posterHeightOrig;
-
+
if ((posterWidthOrig > widthPoster) && (posterHeightOrig < contentHeight)) {
posterWidth = widthPoster - 2*border;
posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig);
@@ -106,15 +115,18 @@ void cNopacityMenuDetailView::DrawPoster(void) {
}
if (!Running())
return;
+ int posterX = (widthPoster - posterWidth) / 2;
+ int posterY = (contentHeight - posterHeight) / 2;
cImageLoader imgLoader;
- if (imgLoader.LoadPoster(mediaInfo.posters[0].path.c_str(), posterWidth, posterHeight)) {
- int posterX = (widthPoster - posterWidth) / 2;
- int posterY = (contentHeight - posterHeight) / 2;
+ if (hasManualPoster) {
+ if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) {
+ if (Running() && pixmapPoster)
+ pixmapPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage());
+ }
+ } else if (imgLoader.LoadPoster(mediaInfo.posters[0].path.c_str(), posterWidth, posterHeight)) {
if (Running() && pixmapPoster)
pixmapPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage());
- if (config.roundedCorners && Running() && pixmapPoster)
- DrawRoundedCorners(pixmapPoster, config.cornerRadius, posterX, posterY, posterWidth, posterHeight);
- }
+ }
}
void cNopacityMenuDetailView::DrawBanner(int height) {
@@ -134,8 +146,6 @@ void cNopacityMenuDetailView::DrawBanner(int height) {
int bannerX = (contentWidth - bannerWidth) / 2;
if (Running() && pixmapContent)
pixmapContent->DrawImage(cPoint(bannerX, height), imgLoader.GetImage());
- if (config.roundedCorners && Running() && pixmapContent)
- DrawRoundedCorners(pixmapContent, config.cornerRadius, bannerX, height, bannerWidth, bannerHeight);
}
}
@@ -167,9 +177,6 @@ void cNopacityMenuDetailView::DrawActors(int height) {
if (imgLoader.LoadPoster(path.c_str(), actorThumbWidth, actorThumbHeight)) {
if (Running() && pixmapContent)
pixmapContent->DrawImage(cPoint(x + border, y), imgLoader.GetImage());
- if (config.roundedCorners && Running() && pixmapContent)
- DrawRoundedCorners(pixmapContent, config.cornerRadius, x + border, y, actorThumbWidth, actorThumbHeight);
-
}
std::string name = mediaInfo.actors[actor].name;
std::stringstream sstrRole;
@@ -212,8 +219,6 @@ void cNopacityMenuDetailView::DrawFanart(int height) {
int fanartX = (contentWidth - fanartWidth) / 2;
if (Running() && pixmapContent)
pixmapContent->DrawImage(cPoint(fanartX, height), imgLoader.GetImage());
- if (config.roundedCorners && Running() && pixmapContent)
- DrawRoundedCorners(pixmapContent, config.cornerRadius, fanartX, height, fanartWidth, fanartHeight);
}
}
@@ -607,9 +612,20 @@ void cNopacityMenuDetailRecordingView::SetFonts(void) {
}
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;
+ }
const cEvent *event = info->GetEvent();
- if (event) {
+ if (event && !hasManualPoster) {
static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper");
if (pTVScraper) {
mediaInfo.event = event;
@@ -618,8 +634,6 @@ void cNopacityMenuDetailRecordingView::SetContent(void) {
hasAdditionalMedia = true;
}
}
- contentWidth = width;
- contentX = 0;
if (hasAdditionalMedia) {
if (mediaInfo.posters.size() >= 1) {
contentWidth -= widthPoster;
@@ -636,19 +650,19 @@ void cNopacityMenuDetailRecordingView::SetContentHeight(void) {
int lineHeight = font->Height();
//Height of banner (only for series)
int heightBanner = 0;
- if (hasAdditionalMedia && (mediaInfo.type == typeSeries)) {
+ if (!hasManualPoster && hasAdditionalMedia && (mediaInfo.type == typeSeries)) {
heightBanner = mediaInfo.banner.height + lineHeight;
}
//Height of Recording EPG Info
int heightEPG = (recInfo.Lines()+1) * lineHeight;
//Height of actor pictures
int heightActors = 0;
- if (hasAdditionalMedia) {
+ if (!hasManualPoster && hasAdditionalMedia) {
heightActors = HeightActorPics();
}
//Height of fanart
int heightFanart = 0;
- if (hasAdditionalMedia) {
+ if (!hasManualPoster && hasAdditionalMedia) {
heightFanart = HeightFanart() + lineHeight;
}
//Height of EPG Pictures
@@ -686,7 +700,7 @@ void cNopacityMenuDetailRecordingView::CreatePixmaps(void) {
pixmapHeader->Fill(clrTransparent);
pixmapHeader->DrawRectangle(cRect(0, headerHeight - 2, width, 2), Theme.Color(clrMenuBorder));
pixmapContent->Fill(clrTransparent);
- if (hasAdditionalMedia) {
+ if (hasManualPoster || hasAdditionalMedia) {
pixmapPoster = osd->CreatePixmap(4, cRect(x, top + headerHeight, widthPoster, contentHeight));
pixmapPoster->Fill(clrTransparent);
}
@@ -703,22 +717,22 @@ void cNopacityMenuDetailRecordingView::Render(void) {
}
void cNopacityMenuDetailRecordingView::Action(void) {
- if (hasAdditionalMedia && Running()) {
+ if ((hasManualPoster || hasAdditionalMedia) && Running()) {
DrawPoster();
osd->Flush();
}
//draw banner only for series
- if (hasAdditionalMedia && (mediaInfo.type == typeSeries) && Running()) {
+ if (!hasManualPoster && hasAdditionalMedia && (mediaInfo.type == typeSeries) && Running()) {
DrawBanner(yBanner);
osd->Flush();
}
//draw actors
- if (hasAdditionalMedia && Running()) {
+ if (!hasManualPoster && hasAdditionalMedia && Running()) {
DrawActors(yActors);
osd->Flush();
}
//draw fanart
- if (hasAdditionalMedia && Running()) {
+ if (!hasManualPoster && hasAdditionalMedia && Running()) {
DrawFanart(yFanart);
osd->Flush();
}
@@ -738,6 +752,8 @@ bool cNopacityMenuDetailRecordingView::LoadEPGPics(void) {
while ( 0 != (dirEntry = readdir(dirHandle))) {
if (endswith(dirEntry->d_name, "jpg")) {
std::string fileName = dirEntry->d_name;
+ if (!fileName.compare("cover_vdr.jpg"))
+ continue;
if (fileName.length() > 4) {
fileName = fileName.substr(0, fileName.length() - 4);
epgpics.push_back(fileName);
diff --git a/menudetailview.h b/menudetailview.h
index e67097d..6b12e5a 100644
--- a/menudetailview.h
+++ b/menudetailview.h
@@ -26,6 +26,8 @@ protected:
cPixmap *pixmapLogo;
cPixmap *pixmapContent;
cPixmap *pixmapPoster;
+ bool hasManualPoster;
+ cString manualPosterPath;
TVScraperGetFullInformation mediaInfo;
bool hasAdditionalMedia;
void DrawTextWrapper(cTextWrapper *wrapper, int top);
diff --git a/menuitem.c b/menuitem.c
index 81d590f..81990d2 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -973,6 +973,8 @@ cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, const cRecordi
this->vidWin = vidWin;
posterWidth = 0;
posterHeight = 0;
+ hasManualPoster = false;
+ manualPosterPath = "";
hasPoster = false;
}
@@ -983,17 +985,12 @@ void cNopacityRecordingMenuItem::CreatePixmapTextScroller(int totalWidth) {
int pixmapLeft = 0;
int pixmapWidth = 0;
int drawPortWidth = totalWidth + 10;
-
if (isFolder) {
pixmapLeft = left + 10 + config.menuRecFolderSize;
pixmapWidth = width - 10 - config.menuRecFolderSize;
} else {
- pixmapLeft = left + 10;
- pixmapWidth = width - 10;
- if (hasPoster) {
- pixmapLeft += posterWidth+10;
- pixmapWidth -= (posterWidth+10);
- }
+ pixmapLeft = posterWidth + left + 20;
+ pixmapWidth = width - posterWidth - 20;
}
pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height));
pixmapTextScroller->Fill(clrTransparent);
@@ -1018,6 +1015,15 @@ void cNopacityRecordingMenuItem::CreateText() {
}
void cNopacityRecordingMenuItem::SetPoster(void) {
+ posterHeight = height - 10;
+ posterWidth = config.posterWidth * ((double)posterHeight / (double)config.posterHeight);
+ //check first if manually set poster exists
+ cString posterFound;
+ cImageLoader imgLoader;
+ hasManualPoster = imgLoader.SearchRecordingPoster(Recording->FileName(), posterFound);
+ if (hasManualPoster)
+ manualPosterPath = posterFound;
+ //no manually set poster found, check tvscraper
const cRecordingInfo *info = Recording->Info();
if (info) {
const cEvent *event = info->GetEvent();
@@ -1027,20 +1033,8 @@ void cNopacityRecordingMenuItem::SetPoster(void) {
poster.isRecording = true;
if (pTVScraper->Service("TVScraperGetPoster", &poster)) {
hasPoster = true;
- int posterWidthOrig = poster.media.width;
- int posterHeightOrig = poster.media.height;
- if ((posterWidthOrig > 10) && (posterHeightOrig > 10)) {
- posterHeight = height - 10;
- posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
- } else {
- hasPoster = false;
- posterHeight = 0;
- posterWidth = 0;
- }
} else {
hasPoster = false;
- posterHeight = 0;
- posterWidth = 0;
}
}
}
@@ -1056,9 +1050,7 @@ int cNopacityRecordingMenuItem::CheckScrollable(bool hasIcon) {
}
int cNopacityRecordingMenuItem::CheckScrollableRecording(void) {
- int spaceLeft = spaceMenu;
- if (hasPoster)
- spaceLeft += posterWidth + 15;
+ int spaceLeft = spaceMenu + posterWidth + 15;
int iconWidth = 0;
if (Recording->IsNew())
iconWidth += font->Height() + 10;
@@ -1110,7 +1102,7 @@ void cNopacityRecordingMenuItem::DrawBackground(void) {
void cNopacityRecordingMenuItem::SetTextFullFolder(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- if (hasPoster)
+ if (hasPoster || hasManualPoster)
DrawPoster();
else
DrawFolderIcon();
@@ -1143,7 +1135,7 @@ void cNopacityRecordingMenuItem::SetTextShort(void) {
void cNopacityRecordingMenuItem::SetTextShortFolder(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- if (hasPoster)
+ if (hasPoster || hasManualPoster)
DrawPoster();
else
DrawFolderIcon();
@@ -1194,20 +1186,8 @@ void cNopacityRecordingMenuItem::DrawFolderIcon(void) {
}
void cNopacityRecordingMenuItem::DrawRecDateTime(void) {
- int iconDateTimeSize = config.menuRecFolderSize / 2;
- int iconHeight = height/2 + (height/2 - iconDateTimeSize)/2;
- int left = 10;
- if (hasPoster) {
- left += posterWidth + 10;
- }
- if (!drawn) {
- cImageLoader imgLoader;
- if (imgLoader.LoadIcon("skinIcons/recordingdatetime", iconDateTimeSize)) {
- pixmapIcon->DrawImage(cPoint(left, iconHeight), imgLoader.GetImage());
- }
- drawn = true;
- }
- pixmapIcon->DrawRectangle(cRect(iconHeight+left, 0, width-iconHeight, height), clrTransparent);
+ int left = posterWidth + 20;
+ pixmapIcon->DrawRectangle(cRect(left, 0, width, height), clrTransparent);
const cEvent *Event = NULL;
Event = Recording->Info()->GetEvent();
cString strDateTime("");
@@ -1229,10 +1209,9 @@ void cNopacityRecordingMenuItem::DrawRecDateTime(void) {
int textHeight = height/2 + (height/4 - fontSmall->Height())/2;
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
- pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10 + left, textHeight), *strDateTime, clrFont, clrTransparent, fontSmall);
+ pixmapIcon->DrawText(cPoint(10 + left, textHeight), *strDateTime, clrFont, clrTransparent, fontSmall);
textHeight += height/4;
- pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10 + left, textHeight), *strDuration, clrFont, clrTransparent, fontSmall);
-
+ pixmapIcon->DrawText(cPoint(10 + left, textHeight), *strDuration, clrFont, clrTransparent, fontSmall);
}
void cNopacityRecordingMenuItem::DrawFolderNewSeen(void) {
@@ -1244,8 +1223,18 @@ void cNopacityRecordingMenuItem::DrawFolderNewSeen(void) {
void cNopacityRecordingMenuItem::DrawPoster(void) {
cImageLoader imgLoader;
- if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) {
- pixmapIcon->DrawImage(cPoint(10, 5), imgLoader.GetImage());
+ if (hasManualPoster) {
+ if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) {
+ pixmapIcon->DrawImage(cPoint(10, 5), imgLoader.GetImage());
+ }
+ } else if (hasPoster) {
+ if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) {
+ pixmapIcon->DrawImage(cPoint(10, 5), imgLoader.GetImage());
+ }
+ } else {
+ if (imgLoader.LoadIcon("skinIcons/defaultPoster", posterWidth, posterHeight)) {
+ pixmapIcon->DrawImage(cPoint(10, 5), imgLoader.GetImage());
+ }
}
}
@@ -1256,9 +1245,7 @@ void cNopacityRecordingMenuItem::Render() {
DrawFolderNewSeen();
SetTextShort();
} else {
- if (hasPoster) {
- DrawPoster();
- }
+ DrawPoster();
DrawRecDateTime();
SetTextShort();
}
@@ -1282,13 +1269,15 @@ void cNopacityRecordingMenuItem::Render() {
infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, vidWin);
infoTextWindow->SetGeometry(textWindow);
infoTextWindow->SetText(Recording->Info()->Description());
- infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true);
+ if (!infoTextWindow->SetManualPoster(Recording))
+ infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true);
infoTextWindow->Start();
} else {
//fullscreen mode
infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, fontEPGWindowLarge);
infoTextWindow->SetGeometry(textWindow);
- infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true, true);
+ if (!infoTextWindow->SetManualPoster(Recording, true))
+ infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true, true);
infoTextWindow->SetRecording(Recording);
}
}
diff --git a/menuitem.h b/menuitem.h
index 1197091..a7e62dc 100644
--- a/menuitem.h
+++ b/menuitem.h
@@ -157,6 +157,8 @@ class cNopacityRecordingMenuItem : public cNopacityMenuItem {
private:
const cRecording *Recording;
bool isFolder;
+ bool hasManualPoster;
+ cString manualPosterPath;
bool hasPoster;
int posterWidth, posterHeight;
TVScraperGetPoster poster;
diff --git a/po/ca_ES.po b/po/ca_ES.po
index acf8c49..54b1159 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: 2013-09-16 10:09+0200\n"
+"POT-Creation-Date: 2013-09-16 11:10+0200\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Gabychan <gbonich@gmail.com>\n"
"Language-Team: \n"
@@ -389,6 +389,12 @@ msgstr "Mostra imatges EPG addicionals a vista detallada gravacions"
msgid "Folder Icon Size"
msgstr "Mida Carpeta Icones"
+msgid "Width of manually set recording poster"
+msgstr ""
+
+msgid "Height of manually set recording poster"
+msgstr ""
+
msgid "simple, one common image"
msgstr "simple, imatge genèrica"
diff --git a/po/de_DE.po b/po/de_DE.po
index 79d96c6..24dcd99 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: skinnopacity 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-09-16 10:09+0200\n"
+"POT-Creation-Date: 2013-09-16 11:10+0200\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -386,6 +386,12 @@ msgstr "Weitere EPG Bilder in der detaillierten Aufnahmeansicht anzeigen"
msgid "Folder Icon Size"
msgstr "Order Icon Größe"
+msgid "Width of manually set recording poster"
+msgstr ""
+
+msgid "Height of manually set recording poster"
+msgstr ""
+
msgid "simple, one common image"
msgstr "einfach, eine gemeinsame Graphik"
diff --git a/po/it_IT.po b/po/it_IT.po
index 7f4d4ea..8091e45 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: skinnopacity 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-09-16 10:09+0200\n"
+"POT-Creation-Date: 2013-09-16 11:10+0200\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -389,6 +389,12 @@ msgstr "Mostra immagini EPG aggiuntivo nella vista dettagli registrazione"
msgid "Folder Icon Size"
msgstr "Dim. icona cartella"
+msgid "Width of manually set recording poster"
+msgstr ""
+
+msgid "Height of manually set recording poster"
+msgstr ""
+
msgid "simple, one common image"
msgstr ""
diff --git a/po/sk_SK.po b/po/sk_SK.po
index 198157e..c1412bf 100644
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinnopacity 0.0.6\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-09-16 10:09+0200\n"
+"POT-Creation-Date: 2013-09-16 11:10+0200\n"
"PO-Revision-Date: 2013-03-12 15:59+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -389,6 +389,12 @@ msgstr "Zobrazi» ïal¹ie EPG obrázky v podrobnom zobrazení nahrávky"
msgid "Folder Icon Size"
msgstr "Veµkos» ikony prieèinku"
+msgid "Width of manually set recording poster"
+msgstr ""
+
+msgid "Height of manually set recording poster"
+msgstr ""
+
msgid "simple, one common image"
msgstr ""
diff --git a/setup.c b/setup.c
index 5a85086..4d91f5f 100644
--- a/setup.c
+++ b/setup.c
@@ -180,6 +180,8 @@ void cNopacitySetup::Store(void) {
SetupStore("epgImageHeight", config.epgImageHeight);
SetupStore("epgImageWidthLarge", config.epgImageWidthLarge);
SetupStore("epgImageHeightLarge", config.epgImageHeightLarge);
+ SetupStore("posterWidth", config.posterWidth);
+ SetupStore("posterHeight", config.posterHeight);
SetupStore("menuRecFolderSize", config.menuRecFolderSize);
SetupStore("borderDetailedEPG", config.borderDetailedEPG);
SetupStore("borderDetailedRecordings", config.borderDetailedRecordings);
@@ -476,6 +478,8 @@ void cNopacitySetupMenuDisplayRecordings::Set(void) {
if (tmpNopacityConfig->displayAdditionalRecEPGPictures)
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Number of EPG pictures to display")), &tmpNopacityConfig->numAdditionalRecEPGPictures, 1, 9));
Add(new cMenuEditIntItem(tr("Folder Icon Size"), &tmpNopacityConfig->menuRecFolderSize, 30, 300));
+ Add(new cMenuEditIntItem(tr("Width of manually set recording poster"), &tmpNopacityConfig->posterWidth, 100, 1000));
+ Add(new cMenuEditIntItem(tr("Height of manually set recording poster"), &tmpNopacityConfig->posterHeight, 100, 1000));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item"), &tmpNopacityConfig->fontMenuitemRecordings, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item Small"), &tmpNopacityConfig->fontMenuitemRecordingsSmall, -20, 20));
diff --git a/textwindow.c b/textwindow.c
index a6c01f7..80bc7ab 100644
--- a/textwindow.c
+++ b/textwindow.c
@@ -8,6 +8,10 @@ cNopacityTextWindow::cNopacityTextWindow(cOsd *osd, cFont *font, cRect *vidWin)
pixmapBackground = NULL;
pixmap = NULL;
scaledWindow = false;
+ posterWidth = 0;
+ posterHeight = 0;
+ hasManualPoster = false;
+ manualPosterPath = "";
hasPoster = false;
}
@@ -19,6 +23,10 @@ cNopacityTextWindow::cNopacityTextWindow(cOsd *osd, cFont *font, cFont *fontHead
pixmapBackground = NULL;
pixmap = NULL;
scaledWindow = false;
+ posterWidth = 0;
+ posterHeight = 0;
+ hasManualPoster = false;
+ manualPosterPath = "";
hasPoster = false;
}
@@ -45,6 +53,27 @@ cNopacityTextWindow::~cNopacityTextWindow(void) {
}
}
+bool cNopacityTextWindow::SetManualPoster(const cRecording *recording, bool fullscreen) {
+ cString posterFound;
+ cImageLoader imgLoader;
+ hasManualPoster = imgLoader.SearchRecordingPoster(recording->FileName(), posterFound);
+ if (hasManualPoster) {
+ manualPosterPath = posterFound;
+ int posterWidthOrig = config.posterWidth;
+ int posterHeightOrig = config.posterHeight;
+ if (!fullscreen) {
+ posterHeight = geometry->Height() - 5;
+ posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
+ esyslog("nopacity: posterWidth %d posterHeight %d geoh %d", posterWidth, posterHeight, geometry->Height());
+ } else {
+ posterWidth = geometry->Width() / 4;
+ posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig);
+ }
+ return true;
+ }
+ return false;
+}
+
void cNopacityTextWindow::SetPoster(const cEvent *event, bool isRecording, bool fullscreen) {
static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper");
if (pTVScraper && event) {
@@ -57,6 +86,7 @@ void cNopacityTextWindow::SetPoster(const cEvent *event, bool isRecording, bool
if (!fullscreen) {
posterHeight = geometry->Height() - 5;
posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
+ esyslog("nopacity: posterWidth %d posterHeight %d geoh %d", posterWidth, posterHeight, geometry->Height());
} else {
posterWidth = geometry->Width() / 4;
posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig);
@@ -73,7 +103,7 @@ bool cNopacityTextWindow::SetTextScroller(int border, int left) {
int lineHeight = font->Height();
bool scrolling = false;
drawportHeight = geometry->Height();
- if (!hasPoster) {
+ if (!(hasPoster || hasManualPoster)) {
drawTextTall = false;
drawTextFull = true;
twTextTall.Set("", font, 5);
@@ -227,7 +257,13 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) {
int y = border;
cImageLoader imgLoader;
bool recImageFound = false;
- if (hasPoster) {
+ if (hasManualPoster) {
+ if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) {
+ int posterX = width - posterWidth - border;
+ pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage());
+ widthTextHeader -= posterWidth;
+ }
+ } else if (hasPoster) {
if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) {
int posterX = width - posterWidth - border;
pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage());
@@ -255,7 +291,7 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) {
y += fontHeader->Height();
//Description
int maxHeight = height - y;
- if (hasPoster && (y < (border + posterHeight))) {
+ if ((hasPoster || hasManualPoster) && (y < (border + posterHeight))) {
int heightNarrow = border + posterHeight - y;
DrawTextWrapperFloat(recording->Info()->Description(),
widthTextHeader, widthText, y, heightNarrow,
@@ -344,7 +380,11 @@ int cNopacityTextWindow::DrawTextWrapperFloat(const char *text, int widthSmall,
void cNopacityTextWindow::DrawPoster(int border) {
cImageLoader imgLoader;
- if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) {
+ if (hasManualPoster) {
+ if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) {
+ pixmap->DrawImage(cPoint(border, font->Height()), imgLoader.GetImage());
+ }
+ } else if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) {
pixmap->DrawImage(cPoint(border, font->Height()), imgLoader.GetImage());
}
}
@@ -383,7 +423,7 @@ void cNopacityTextWindow::Action(void) {
int border = 5;
int left = 0;
- if (hasPoster)
+ if (hasPoster || hasManualPoster)
left = 10 + posterWidth;
bool scrolling = false;
if (Running()) {
@@ -393,7 +433,7 @@ void cNopacityTextWindow::Action(void) {
if (Running()) {
DrawText(border, left);
}
- if (Running() && hasPoster) {
+ if (Running() && (hasPoster || hasManualPoster)) {
DrawPoster(border);
}
//FadeIn
diff --git a/textwindow.h b/textwindow.h
index 8d3a7b1..9629c11 100644
--- a/textwindow.h
+++ b/textwindow.h
@@ -17,6 +17,8 @@ private:
cTextWrapper twTextFull;
bool drawTextTall;
bool drawTextFull;
+ bool hasManualPoster;
+ cString manualPosterPath;
bool hasPoster;
TVScraperGetPoster poster;
int posterWidth, posterHeight;
@@ -38,6 +40,7 @@ public:
void SetEvent(const cEvent *event);
void SetRecording(const cRecording *recording);
void SetText(cString Text) {text = Text;};
+ bool SetManualPoster(const cRecording *recording, bool fullscreen = false);
void SetPoster(const cEvent *event, bool isRecording, bool fullscreen = false);
};