diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | displaymenu.c | 16 | ||||
-rw-r--r-- | imageloader.c | 26 | ||||
-rw-r--r-- | imageloader.h | 1 |
4 files changed, 42 insertions, 2 deletions
@@ -12,6 +12,7 @@ VDR Plugin 'skinflatplus' Revision History - [add] theme colors clrMenuEventTitleLine and clrMenuRecTitleLine for the line under title in event and recording - [add] theme color clrChannelEPGBorderFg and clrChannelEPGBorderBg for border color of epg image in chanel info - [add] decor option ChannelEPGBorderType and ChannelEPGBorderSize for border of epg image in chanel info +- [add] patch - load epg image cover_vdr.jpg in recordings folder (thanks to Saman@vdr-portal.de) 2014-11-05: Version 0.3.0 - [fix] use only current Event in extraevent display in displaychannel diff --git a/displaymenu.c b/displaymenu.c index 9d66c364..b199b37a 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -2476,6 +2476,15 @@ void cFlatDisplayMenu::DrawItemExtraRecording(const cRecording *Recording, cStri } } + cString recPath = cString::sprintf("%s", Recording->FileName()); + cString recImage; + if( imgLoader.SearchRecordingPoster(recPath, recImage) ) { + mediaWidth = cWidth/2 - marginItem*3; + mediaHeight = 999; + mediaType = 2; + mediaPath = recImage; + } + if( mediaPath.length() > 0 ) { cImage *img = imgLoader.LoadFile(mediaPath.c_str(), mediaWidth, mediaHeight); if( img && mediaType == 2 ) { @@ -2863,6 +2872,13 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { dsyslog("SetRecording tvscraper time: %d ms", tick3 - tick2); #endif + cString recPath = cString::sprintf("%s", Recording->FileName()); + cString recImage; + if( imgLoader.SearchRecordingPoster(recPath, recImage) ) { + mediaWidth = cWidth/2 - marginItem*2; + mediaHeight = cHeight - marginItem*2 - fontHeight - 6; + mediaPath = recImage; + } if( mediaPath.length() > 0 ) { cImage *img = imgLoader.LoadFile(mediaPath.c_str(), mediaWidth, mediaHeight); if( img ) { diff --git a/imageloader.c b/imageloader.c index 02b7825e..a5e3a91d 100644 --- a/imageloader.c +++ b/imageloader.c @@ -219,6 +219,28 @@ void cImageLoader::toLowerCase(std::string &str) { } bool cImageLoader::FileExits(const std::string& name) { - struct stat buffer; - return (stat (name.c_str(), &buffer) == 0); + struct stat buffer; + return (stat (name.c_str(), &buffer) == 0); +} + +bool cImageLoader::SearchRecordingPoster(cString recPath, cString &found) { + cString manualPoster = cString::sprintf("%s/cover_vdr.jpg", *recPath); + if (FileSize(*manualPoster) != -1) { + dsyslog("Poster found in %s/cover_vdr.jpg", *recPath); + found = manualPoster; + return true; + } + manualPoster = cString::sprintf("%s/../../../cover_vdr.jpg", *recPath); + if (FileSize(*manualPoster) != -1) { + dsyslog("Poster found in %s/../../../cover_vdr.jpg", *recPath); + found = manualPoster; + return true; + } + manualPoster = cString::sprintf("%s/../../cover_vdr.jpg", *recPath); + if (FileSize(*manualPoster) != -1) { + dsyslog("Poster found in %s/../../cover_vdr.jpg", *recPath); + found = manualPoster; + return true; + } + return false; } diff --git a/imageloader.h b/imageloader.h index 023314ce..b340f9a0 100644 --- a/imageloader.h +++ b/imageloader.h @@ -20,6 +20,7 @@ public: cImage* LoadIcon(const char *cIcon, int width, int height, bool preserveAspect = true); cImage* LoadFile(const char *cFile, int width, int height, bool preserveAspect = true); bool FileExits(const std::string& name); + bool SearchRecordingPoster(cString recPath, cString &found); private: int epgImageWidthLarge, epgImageHeightLarge; int epgImageWidth, epgImageHeight; |