diff options
author | louis <louis.braun@gmx.de> | 2014-04-13 09:48:03 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-04-13 09:48:03 +0200 |
commit | ac8661ddae52764780ca27e1ea742e7fba47b1c2 (patch) | |
tree | f9fefe02e48df4079239a78a47ef6d4a07afabf7 | |
parent | 114fb900bb3fdbef09258eef5a2a8c3b08ab7ddc (diff) | |
download | skin-nopacity-ac8661ddae52764780ca27e1ea742e7fba47b1c2.tar.gz skin-nopacity-ac8661ddae52764780ca27e1ea742e7fba47b1c2.tar.bz2 |
Version 1.1.0 - added scraper2vdr support
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | displaychannelview.c | 40 | ||||
-rw-r--r-- | menudetailview.c | 559 | ||||
-rw-r--r-- | menudetailview.h | 9 | ||||
-rw-r--r-- | menuitem.c | 43 | ||||
-rw-r--r-- | menuitem.h | 2 | ||||
-rw-r--r-- | po/ca_ES.po | 89 | ||||
-rw-r--r-- | po/de_DE.po | 89 | ||||
-rw-r--r-- | po/it_IT.po | 89 | ||||
-rw-r--r-- | po/sk_SK.po | 89 | ||||
-rw-r--r-- | services/scraper2vdr.h | 194 | ||||
-rw-r--r-- | skinnopacity.c | 2 | ||||
-rw-r--r-- | textwindow.c | 50 | ||||
-rw-r--r-- | textwindow.h | 4 |
14 files changed, 1125 insertions, 138 deletions
@@ -408,4 +408,6 @@ Version 1.0.3 - Added information about running recordings in DisplayChannel (thanks @Soeren Moch for providing a patch) -Version 1.0.4 +Version 1.1.0 + +- Added scraper2vdr support diff --git a/displaychannelview.c b/displaychannelview.c index 7ace1a7..68a213a 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -1,4 +1,5 @@ #include "services/tvscraper.h" +#include "services/scraper2vdr.h" #include "displaychannelview.h" #include "config.h" #include "helpers.h" @@ -575,6 +576,45 @@ void cNopacityDisplayChannelView::DrawPoster(const cEvent *event, bool initial) osd->DestroyPixmap(pixmapPoster); pixmapPoster = NULL; } + + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if (pScraper2Vdr) { + ScraperGetPosterBanner call; + call.event = event; + if (pScraper2Vdr->Service("GetPosterBanner", &call)) { + int mediaWidth = 0; + int mediaHeight = 0; + std::string mediaPath = ""; + if ((call.type == tSeries) && call.banner.path.size() > 0) { + mediaWidth = call.banner.width; + mediaHeight = call.banner.height; + mediaPath = call.banner.path; + } else if (call.type == tMovie && call.poster.path.size() > 0) { + double ratio = (double)(cOsd::OsdHeight()/3) / (double)call.poster.height; + mediaWidth = ratio * call.poster.width; + mediaHeight = ratio * call.poster.height; + mediaPath = call.poster.path; + } else + return; + int border = config.GetValue("channelPosterBorder"); + pixmapPoster = osd->CreatePixmap(1, cRect(config.GetValue("channelBorderVertical"), + config.GetValue("channelBorderBottom"), + mediaWidth + 2 * border, + mediaHeight + 2 * border)); + if (initial && config.GetValue("channelFadeTime")) + pixmapPoster->SetAlpha(0); + cImageLoader imgLoader; + if (imgLoader.LoadPoster(mediaPath.c_str(), mediaWidth, mediaHeight)) { + pixmapPoster->Fill(Theme.Color(clrChannelBackground)); + pixmapPoster->DrawImage(cPoint(border, border), imgLoader.GetImage()); + DrawRoundedCorners(pixmapPoster, border, 0, 0, pixmapPoster->ViewPort().Width(), pixmapPoster->ViewPort().Height()); + } else { + pixmapPoster->Fill(clrTransparent); + } + } + return; + } + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); if (pTVScraper) { TVScraperGetPosterOrBanner call; diff --git a/menudetailview.c b/menudetailview.c index 3debf75..44c37ea 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -16,6 +16,8 @@ cNopacityMenuDetailView::cNopacityMenuDetailView(cOsd *osd, cImageCache *imgCach hasManualPoster = false; manualPosterPath = ""; hasAdditionalMedia = false; + isMovie = false; + isSeries = false; pixmapPoster = NULL; } @@ -51,10 +53,22 @@ void cNopacityMenuDetailView::DrawTextWrapper(cTextWrapper *wrapper, int top) { } int cNopacityMenuDetailView::HeightActorPics(void) { - int numActors = mediaInfo.actors.size(); + 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 (mediaInfo.type == typeMovie) { + 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) { @@ -69,18 +83,125 @@ int cNopacityMenuDetailView::HeightActorPics(void) { 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(); + int scrapInfoHeight = (scrapInfo.Lines() + 1) * lineHeight; + if (isSeries) { + if (series.banners.size() == 2) + scrapInfoHeight += series.banners[1].height + lineHeight; + else if (series.banners.size() == 3) + scrapInfoHeight += series.banners[1].height + series.banners[2].height + 2*lineHeight; + } + return scrapInfoHeight; +} + int cNopacityMenuDetailView::HeightFanart(void) { int retVal = 0; - if (mediaInfo.fanart.size() >= 1) { - int fanartWidthOrig = mediaInfo.fanart[0].width; - int fanartHeightOrig = mediaInfo.fanart[0].height; - int fanartWidth = fanartWidthOrig; - int fanartHeight = fanartHeightOrig; + 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; + } + 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 (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; @@ -92,6 +213,14 @@ void cNopacityMenuDetailView::DrawPoster(void) { if (hasManualPoster) { posterWidthOrig = config.GetValue("posterWidth"); posterHeightOrig = config.GetValue("posterHeight"); + } else if (isMovie) { + 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; @@ -123,39 +252,104 @@ void cNopacityMenuDetailView::DrawPoster(void) { int posterX = (widthPoster - posterWidth) / 2; int posterY = (contentHeight - posterHeight) / 2; cImageLoader imgLoader; - if (hasManualPoster) { - if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) { - if (Running() && pixmapPoster) - pixmapPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage()); - } + 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()); + pixmapPoster->DrawImage(cPoint(posterX, posterY), imgLoader.GetImage()); } } void cNopacityMenuDetailView::DrawBanner(int height) { - int bannerWidthOrig = mediaInfo.banner.width; - int bannerHeightOrig = mediaInfo.banner.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; + } int bannerWidth = bannerWidthOrig; int bannerHeight = bannerHeightOrig; - - if (bannerWidthOrig > contentWidth - 2*border) { + 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(mediaInfo.banner.path.c_str(), bannerWidth, bannerHeight)) { - int bannerX = (contentWidth - bannerWidth) / 2; + 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 > 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 = mediaInfo.actors.size(); + 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; @@ -178,15 +372,28 @@ void cNopacityMenuDetailView::DrawActors(int height) { return; if (actor == numActors) break; - std::string path = mediaInfo.actors[actor].thumb.path; + 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 << "\""; + } 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()); } - std::string name = mediaInfo.actors[actor].name; - std::stringstream sstrRole; - sstrRole << "\"" << mediaInfo.actors[actor].role << "\""; - std::string role = sstrRole.str(); + 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) @@ -206,10 +413,27 @@ void cNopacityMenuDetailView::DrawActors(int height) { } void cNopacityMenuDetailView::DrawFanart(int height) { - if (mediaInfo.fanart.size() < 1) + if (isSeries && series.fanarts.size() < 1) return; - int fanartWidthOrig = mediaInfo.fanart[0].width; - int fanartHeightOrig = mediaInfo.fanart[0].height; + 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; + } int fanartWidth = fanartWidthOrig; int fanartHeight = fanartHeightOrig; @@ -220,10 +444,34 @@ void cNopacityMenuDetailView::DrawFanart(int height) { if (!Running()) return; cImageLoader imgLoader; - if (imgLoader.LoadPoster(mediaInfo.fanart[0].path.c_str(), fanartWidth, fanartHeight)) { + if (isMovie) { int fanartX = (contentWidth - fanartWidth) / 2; - if (Running() && pixmapContent) - pixmapContent->DrawImage(cPoint(fanartX, height), imgLoader.GetImage()); + 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()); + } } } @@ -309,22 +557,56 @@ void cNopacityMenuDetailEventView::SetFonts(void) { void cNopacityMenuDetailEventView::SetContent(void) { if (event) { - static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if (pTVScraper) { - mediaInfo.event = event; - mediaInfo.isRecording = false; - if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) { - hasAdditionalMedia = true; + 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; + } + } + } else { + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper) { + mediaInfo.event = event; + mediaInfo.isRecording = false; + if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) { + hasAdditionalMedia = true; + } } } contentWidth = width; contentX = 0; - if (hasAdditionalMedia) { + bool displayPoster = false; + if (isSeries || isMovie) { + displayPoster = true; + } else if (hasAdditionalMedia) { if (mediaInfo.posters.size() >= 1) { - contentWidth -= widthPoster; - contentX = widthPoster; + displayPoster = true; } } + if (displayPoster) { + contentWidth -= widthPoster; + contentX = widthPoster; + } epgText.Set(event->Description(), font, contentWidth - 2 * border); if (config.GetValue("displayRerunsDetailEPGView")) { LoadReruns(); @@ -336,8 +618,11 @@ void cNopacityMenuDetailEventView::SetContentHeight(void) { int lineHeight = font->Height(); //Height of banner (only for series) int heightBanner = 0; - if (hasAdditionalMedia && (mediaInfo.type == typeSeries)) { - heightBanner = mediaInfo.banner.height + lineHeight; + 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; @@ -348,28 +633,36 @@ void cNopacityMenuDetailEventView::SetContentHeight(void) { } //Height of actor pictures int heightActors = 0; - if (hasAdditionalMedia) { + 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) { + if (hasAdditionalMedia || isMovie || isSeries) { heightFanart = HeightFanart() + lineHeight; } //Height of EPG Pictures int heightEPGPics = 0; - if ((config.GetValue("displayAdditionalEPGPictures") == 1) || ((config.GetValue("displayAdditionalEPGPictures") == 2) && !hasAdditionalMedia)) { + 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; - yFanart = yActors + heightActors; - yEPGPics = yFanart + heightFanart; + 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 + heightFanart + heightReruns + heightEPGPics; + int totalHeight = 2 * border + heightBanner + heightEPG + heightActors + heightScraperInfo + heightFanart + heightReruns + heightEPGPics; //check if pixmap content has to be scrollable if (totalHeight > contentHeight) { contentDrawPortHeight = totalHeight; @@ -390,7 +683,7 @@ void cNopacityMenuDetailEventView::CreatePixmaps(void) { pixmapContent->Fill(clrTransparent); pixmapLogo->Fill(clrTransparent); - if (hasAdditionalMedia) { + if (hasAdditionalMedia || isSeries || isMovie) { pixmapPoster = osd->CreatePixmap(4, cRect(x, top + headerHeight, widthPoster, contentHeight)); pixmapPoster->Fill(clrTransparent); } @@ -404,30 +697,44 @@ void cNopacityMenuDetailEventView::Render(void) { 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 && Running()) { + if ((hasAdditionalMedia || isSeries || isMovie) && Running()) { DrawPoster(); osd->Flush(); } //draw banner only for series - if (hasAdditionalMedia && (mediaInfo.type == typeSeries) && Running()) { + if (((hasAdditionalMedia && (mediaInfo.type == typeSeries)) || isSeries) && Running()) { DrawBanner(yBanner); osd->Flush(); } //draw actors - if (hasAdditionalMedia && Running()) { + if ((hasAdditionalMedia || isSeries || isMovie) && Running()) { DrawActors(yActors); osd->Flush(); } + //draw additional banners + if (isSeries && Running()) { + DrawAdditionalBanners(yScrapInfo, yFanart); + osd->Flush(); + } //draw fanart - if (hasAdditionalMedia && Running()) { + if ((hasAdditionalMedia || isSeries || isMovie) && Running()) { DrawFanart(yFanart); osd->Flush(); } //draw additional EPG Pictures - if (((config.GetValue("displayAdditionalEPGPictures") == 1) || ((config.GetValue("displayAdditionalEPGPictures") == 2) && !hasAdditionalMedia)) && Running()) { + if (((config.GetValue("displayAdditionalEPGPictures") == 1) || ((config.GetValue("displayAdditionalEPGPictures") == 2) && !hasAdditionalMedia && !isMovie && !isSeries)) && Running()) { DrawEPGPictures(yEPGPics); osd->Flush(); } @@ -469,7 +776,18 @@ void cNopacityMenuDetailEventView::DrawHeader(void) { } int widthTextHeader = width - 4 * border - logoWidth; cImageLoader imgLoader; - if (imgLoader.LoadEPGImage(event->EventID())) { + 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"); @@ -629,23 +947,57 @@ void cNopacityMenuDetailRecordingView::SetContent(void) { manualPosterPath = posterFound; contentWidth -= widthPoster; contentX = widthPoster; - } - 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; + } 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; + } + } } } - if (hasAdditionalMedia) { + bool displayPoster = false; + if (isSeries || isMovie) { + displayPoster = true; + } else if (hasAdditionalMedia) { if (mediaInfo.posters.size() >= 1) { - contentWidth -= widthPoster; - contentX = widthPoster; + displayPoster = true; } } + if (displayPoster) { + contentWidth -= widthPoster; + contentX = widthPoster; + } } recInfo.Set(recording->Info()->Description(), font, contentWidth - 2 * border); LoadRecordingInformation(); @@ -656,19 +1008,27 @@ void cNopacityMenuDetailRecordingView::SetContentHeight(void) { int lineHeight = font->Height(); //Height of banner (only for series) int heightBanner = 0; - if (!hasManualPoster && hasAdditionalMedia && (mediaInfo.type == typeSeries)) { - heightBanner = mediaInfo.banner.height + lineHeight; + 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) { + 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) { + if (!hasManualPoster && (hasAdditionalMedia || isMovie || isSeries)) { heightFanart = HeightFanart() + lineHeight; } //Height of EPG Pictures @@ -683,11 +1043,12 @@ void cNopacityMenuDetailRecordingView::SetContentHeight(void) { yBanner = border; yEPGText = yBanner + heightBanner; yActors = yEPGText + heightEPG; - yFanart = yActors + heightActors; + yScrapInfo = yActors + heightActors; + yFanart = yScrapInfo + heightScraperInfo; yEPGPics = yFanart + heightFanart; yAddInf = yEPGPics + heightEPGPics; - int totalHeight = 2*border + heightBanner + heightEPG + heightActors + heightFanart + heightAdditionalInfo + 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; @@ -706,7 +1067,7 @@ void cNopacityMenuDetailRecordingView::CreatePixmaps(void) { pixmapHeader->Fill(clrTransparent); pixmapHeader->DrawRectangle(cRect(0, headerHeight - 2, width, 2), Theme.Color(clrMenuBorder)); pixmapContent->Fill(clrTransparent); - if (hasManualPoster || hasAdditionalMedia) { + if (hasManualPoster || hasAdditionalMedia || isMovie || isSeries) { pixmapPoster = osd->CreatePixmap(4, cRect(x, top + headerHeight, widthPoster, contentHeight)); pixmapPoster->Fill(clrTransparent); } @@ -720,30 +1081,39 @@ void cNopacityMenuDetailRecordingView::Render(void) { 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) && Running()) { + if ((hasManualPoster || hasAdditionalMedia || isSeries || isMovie) && Running()) { DrawPoster(); osd->Flush(); } //draw banner only for series - if (!hasManualPoster && hasAdditionalMedia && (mediaInfo.type == typeSeries) && Running()) { + if (!hasManualPoster && (hasAdditionalMedia && (mediaInfo.type == typeSeries) || isSeries) && Running()) { DrawBanner(yBanner); osd->Flush(); } //draw actors - if (!hasManualPoster && hasAdditionalMedia && Running()) { - DrawActors(yActors); + if (!hasManualPoster && (hasAdditionalMedia || isSeries || isMovie) && Running()) { + DrawActors(yActors); osd->Flush(); } //draw fanart - if (!hasManualPoster && hasAdditionalMedia && Running()) { + if (!hasManualPoster && (hasAdditionalMedia || isSeries || isMovie) && Running()) { DrawFanart(yFanart); osd->Flush(); } //draw additional EPG Pictures - if (((config.GetValue("displayAdditionalRecEPGPictures") == 1) || ((config.GetValue("displayAdditionalRecEPGPictures") == 2) && !hasAdditionalMedia)) && Running()) { + if (((config.GetValue("displayAdditionalRecEPGPictures") == 1) || ((config.GetValue("displayAdditionalRecEPGPictures") == 2) && !(hasAdditionalMedia && !isMovie && !isSeries))) && Running()) { DrawEPGPictures(yEPGPics); osd->Flush(); } @@ -817,7 +1187,18 @@ void cNopacityMenuDetailRecordingView::DrawEPGPictures(int height) { void cNopacityMenuDetailRecordingView::DrawHeader(void) { cImageLoader imgLoader; int widthTextHeader = width - 2 * border; - if ((config.GetValue("displayAdditionalRecEPGPictures") == 1) && imgLoader.LoadRecordingImage(recording->FileName())) { + 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"); diff --git a/menudetailview.h b/menudetailview.h index 985ceb5..d3dd038 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -6,6 +6,7 @@ #include <vector> #include <string> +#include "services/scraper2vdr.h" #include "services/tvscraper.h" #include "imagecache.h" @@ -25,6 +26,7 @@ protected: int yBanner; int yEPGText; int yActors; + int yScrapInfo; int yFanart; int yAddInf; int yEPGPics; @@ -37,13 +39,20 @@ protected: 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) {}; @@ -564,13 +564,13 @@ void cNopacityScheduleMenuItem::Render() { infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, vidWin); infoTextWindow->SetGeometry(textWindow); infoTextWindow->SetText(Event->Description()); - infoTextWindow->SetPoster(Event, false); + infoTextWindow->SetPoster(Event, NULL); infoTextWindow->Start(); } else { //fullscreen mode infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, fontEPGWindowLarge); infoTextWindow->SetGeometry(textWindow); - infoTextWindow->SetPoster(Event, false, true); + infoTextWindow->SetPoster(Event, NULL, true); infoTextWindow->SetEvent(Event); } } @@ -1085,13 +1085,13 @@ void cNopacityTimerMenuItem::Render() { infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, vidWin); infoTextWindow->SetGeometry(textWindow); infoTextWindow->SetText(Event->Description()); - infoTextWindow->SetPoster(Event, false); + infoTextWindow->SetPoster(Event, NULL, false); infoTextWindow->Start(); } else { //fullscreen mode infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, fontEPGWindowLarge); infoTextWindow->SetGeometry(textWindow); - infoTextWindow->SetPoster(Event, false, true); + infoTextWindow->SetPoster(Event, NULL, true); infoTextWindow->SetEvent(Event); } } @@ -1130,6 +1130,7 @@ cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, cImageCache *i hasManualPoster = false; manualPosterPath = ""; hasPoster = false; + hasThumb = false; } cNopacityRecordingMenuItem::~cNopacityRecordingMenuItem(void) { @@ -1172,7 +1173,17 @@ void cNopacityRecordingMenuItem::SetPoster(void) { hasManualPoster = imgLoader.SearchRecordingPoster(Recording->FileName(), posterFound); if (hasManualPoster) manualPosterPath = posterFound; - //no manually set poster found, check tvscraper + //no manually set poster found, check scraper + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if (pScraper2Vdr) { + thumb.event = NULL; + thumb.recording = Recording; + if (pScraper2Vdr->Service("GetPosterThumb", &thumb)) { + hasThumb = true; + } else { + hasThumb = false; + } + } const cRecordingInfo *info = Recording->Info(); if (info) { const cEvent *event = info->GetEvent(); @@ -1266,7 +1277,7 @@ void cNopacityRecordingMenuItem::DrawBackground(void) { void cNopacityRecordingMenuItem::SetTextFullFolder(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - if (config.GetValue("useFolderPoster") && (hasPoster || hasManualPoster)) + if (config.GetValue("useFolderPoster") && (hasPoster || hasThumb || hasManualPoster)) DrawPoster(); else DrawFolderIcon(); @@ -1293,7 +1304,7 @@ void cNopacityRecordingMenuItem::SetTextShort(void) { void cNopacityRecordingMenuItem::SetTextShortFolder(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - if (config.GetValue("useFolderPoster") && (hasPoster || hasManualPoster)) + if (config.GetValue("useFolderPoster") && (hasPoster || hasThumb || hasManualPoster)) DrawPoster(); else DrawFolderIcon(); @@ -1378,16 +1389,24 @@ void cNopacityRecordingMenuItem::DrawFolderNewSeen(void) { void cNopacityRecordingMenuItem::DrawPoster(void) { cImageLoader imgLoader; + bool posterDrawn = false; if (hasManualPoster) { if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) { + posterDrawn = true; + pixmapStatic->DrawImage(cPoint(10, 5), imgLoader.GetImage()); + } + } else if (hasThumb) { + if (imgLoader.LoadPoster(thumb.poster.path.c_str(), posterWidth, posterHeight)) { + posterDrawn = true; pixmapStatic->DrawImage(cPoint(10, 5), imgLoader.GetImage()); } - } else if (hasPoster) { + } else if (hasPoster) { if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { + posterDrawn = true; pixmapStatic->DrawImage(cPoint(10, 5), imgLoader.GetImage()); } - } else { - + } + if (!posterDrawn) { cImage *imgIcon = imgCache->GetSkinIcon("skinIcons/defaultPoster", posterWidth, posterHeight); if (imgIcon) pixmapStatic->DrawImage(cPoint(10,5), *imgIcon); @@ -1432,14 +1451,14 @@ void cNopacityRecordingMenuItem::Render() { infoTextWindow->SetGeometry(textWindow); infoTextWindow->SetText(Recording->Info()->Description()); if (!infoTextWindow->SetManualPoster(Recording)) - infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true); + infoTextWindow->SetPoster(NULL, Recording); infoTextWindow->Start(); } else { //fullscreen mode infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, fontEPGWindowLarge); infoTextWindow->SetGeometry(textWindow); if (!infoTextWindow->SetManualPoster(Recording, true)) - infoTextWindow->SetPoster(Recording->Info()->GetEvent(), true, true); + infoTextWindow->SetPoster(NULL, Recording, true); infoTextWindow->SetRecording(Recording); } } @@ -167,8 +167,10 @@ private: bool hasManualPoster; cString manualPosterPath; bool hasPoster; + bool hasThumb; int posterWidth, posterHeight; TVScraperGetPoster poster; + ScraperGetPosterThumb thumb; int Level, Total, New; cRect *vidWin; std::string strRecName; diff --git a/po/ca_ES.po b/po/ca_ES.po index 0bb4bd2..a6ef9e7 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-02-01 14:51+0100\n" +"POT-Creation-Date: 2014-03-28 17:12+0100\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Gabychan <gbonich@gmail.com>\n" "Language-Team: \n" @@ -29,6 +29,87 @@ msgstr "Volum" msgid "images" msgstr "imatges" +msgid "TheTVDB Information" +msgstr "" + +msgid "Series Overview" +msgstr "" + +msgid "First aired" +msgstr "" + +msgid "Genre" +msgstr "" + +msgid "Network" +msgstr "" + +msgid "TheMovieDB Rating" +msgstr "" + +msgid "Status" +msgstr "" + +msgid "Episode" +msgstr "" + +msgid "Season" +msgstr "" + +msgid "Episode Overview" +msgstr "" + +msgid "Guest Stars" +msgstr "" + +msgid "TheMovieDB Information" +msgstr "" + +msgid "Original Title" +msgstr "" + +msgid "Tagline" +msgstr "" + +msgid "Overview" +msgstr "" + +msgid "yes" +msgstr "sÃ" + +msgid "no" +msgstr "no" + +msgid "Adult" +msgstr "" + +msgid "Collection" +msgstr "" + +msgid "Budget" +msgstr "" + +msgid "Revenue" +msgstr "" + +msgid "Homepage" +msgstr "" + +msgid "Release Date" +msgstr "" + +msgid "Runtime" +msgstr "" + +msgid "minutes" +msgstr "" + +msgid "TheMovieDB Popularity" +msgstr "" + +msgid "TheMovieDB Vote Average" +msgstr "" + msgid "Actors" msgstr "Actors" @@ -134,12 +215,6 @@ msgstr "normal" msgid "fast" msgstr "rà pid" -msgid "no" -msgstr "no" - -msgid "yes" -msgstr "sÃ" - msgid "auto" msgstr "auto" diff --git a/po/de_DE.po b/po/de_DE.po index ada4ecd..d0b972f 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-02-01 14:51+0100\n" +"POT-Creation-Date: 2014-03-28 17:12+0100\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -26,6 +26,87 @@ msgstr "Lautstärke" msgid "images" msgstr "Bilder" +msgid "TheTVDB Information" +msgstr "TheTVDB Information" + +msgid "Series Overview" +msgstr "Serienüberblick" + +msgid "First aired" +msgstr "Erstausstrahlung" + +msgid "Genre" +msgstr "Genre" + +msgid "Network" +msgstr "Sendeanstalt" + +msgid "TheMovieDB Rating" +msgstr "TheMovieDB Wertung" + +msgid "Status" +msgstr "Status" + +msgid "Episode" +msgstr "Episode" + +msgid "Season" +msgstr "Staffel" + +msgid "Episode Overview" +msgstr "Episodenüberblick" + +msgid "Guest Stars" +msgstr "Gast Stars" + +msgid "TheMovieDB Information" +msgstr "TheMovieDB Information" + +msgid "Original Title" +msgstr "Original Titel" + +msgid "Tagline" +msgstr "Zusammenfassung" + +msgid "Overview" +msgstr "Ãœberblick" + +msgid "yes" +msgstr "ja" + +msgid "no" +msgstr "nein" + +msgid "Adult" +msgstr "Nur für Erwachsene" + +msgid "Collection" +msgstr "Kollektion" + +msgid "Budget" +msgstr "Budget" + +msgid "Revenue" +msgstr "Einnahmen" + +msgid "Homepage" +msgstr "Homepage" + +msgid "Release Date" +msgstr "Veröffentlicht" + +msgid "Runtime" +msgstr "Laufzeit" + +msgid "minutes" +msgstr "Minuten" + +msgid "TheMovieDB Popularity" +msgstr "TheMovieDB Popularität" + +msgid "TheMovieDB Vote Average" +msgstr "TheMovieDB durchschnittliche Bewertung" + msgid "Actors" msgstr "Schauspieler" @@ -131,12 +212,6 @@ msgstr "mittel" msgid "fast" msgstr "schnell" -msgid "no" -msgstr "nein" - -msgid "yes" -msgstr "ja" - msgid "auto" msgstr "auto" diff --git a/po/it_IT.po b/po/it_IT.po index 9a0e60d..1c94fea 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-02-01 14:51+0100\n" +"POT-Creation-Date: 2014-03-28 17:12+0100\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -29,6 +29,87 @@ msgstr "Volume" msgid "images" msgstr "" +msgid "TheTVDB Information" +msgstr "" + +msgid "Series Overview" +msgstr "" + +msgid "First aired" +msgstr "" + +msgid "Genre" +msgstr "" + +msgid "Network" +msgstr "" + +msgid "TheMovieDB Rating" +msgstr "" + +msgid "Status" +msgstr "" + +msgid "Episode" +msgstr "" + +msgid "Season" +msgstr "" + +msgid "Episode Overview" +msgstr "" + +msgid "Guest Stars" +msgstr "" + +msgid "TheMovieDB Information" +msgstr "" + +msgid "Original Title" +msgstr "" + +msgid "Tagline" +msgstr "" + +msgid "Overview" +msgstr "" + +msgid "yes" +msgstr "" + +msgid "no" +msgstr "" + +msgid "Adult" +msgstr "" + +msgid "Collection" +msgstr "" + +msgid "Budget" +msgstr "" + +msgid "Revenue" +msgstr "" + +msgid "Homepage" +msgstr "" + +msgid "Release Date" +msgstr "" + +msgid "Runtime" +msgstr "" + +msgid "minutes" +msgstr "" + +msgid "TheMovieDB Popularity" +msgstr "" + +msgid "TheMovieDB Vote Average" +msgstr "" + msgid "Actors" msgstr "" @@ -134,12 +215,6 @@ msgstr "medio" msgid "fast" msgstr "veloce" -msgid "no" -msgstr "" - -msgid "yes" -msgstr "" - msgid "auto" msgstr "" diff --git a/po/sk_SK.po b/po/sk_SK.po index 499c79b..d40a9c1 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-02-01 14:51+0100\n" +"POT-Creation-Date: 2014-03-28 17:12+0100\n" "PO-Revision-Date: 2013-11-11 20:52+0100\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Language-Team: \n" @@ -26,6 +26,87 @@ msgstr "Hlasitos»" msgid "images" msgstr "obrázkov" +msgid "TheTVDB Information" +msgstr "" + +msgid "Series Overview" +msgstr "" + +msgid "First aired" +msgstr "" + +msgid "Genre" +msgstr "" + +msgid "Network" +msgstr "" + +msgid "TheMovieDB Rating" +msgstr "" + +msgid "Status" +msgstr "" + +msgid "Episode" +msgstr "" + +msgid "Season" +msgstr "" + +msgid "Episode Overview" +msgstr "" + +msgid "Guest Stars" +msgstr "" + +msgid "TheMovieDB Information" +msgstr "" + +msgid "Original Title" +msgstr "" + +msgid "Tagline" +msgstr "" + +msgid "Overview" +msgstr "" + +msgid "yes" +msgstr "áno" + +msgid "no" +msgstr "nie" + +msgid "Adult" +msgstr "" + +msgid "Collection" +msgstr "" + +msgid "Budget" +msgstr "" + +msgid "Revenue" +msgstr "" + +msgid "Homepage" +msgstr "" + +msgid "Release Date" +msgstr "" + +msgid "Runtime" +msgstr "" + +msgid "minutes" +msgstr "" + +msgid "TheMovieDB Popularity" +msgstr "" + +msgid "TheMovieDB Vote Average" +msgstr "" + msgid "Actors" msgstr "Herci" @@ -131,12 +212,6 @@ msgstr "stredne" msgid "fast" msgstr "rýchlo" -msgid "no" -msgstr "nie" - -msgid "yes" -msgstr "áno" - msgid "auto" msgstr "automaticky" diff --git a/services/scraper2vdr.h b/services/scraper2vdr.h new file mode 100644 index 0000000..703d077 --- /dev/null +++ b/services/scraper2vdr.h @@ -0,0 +1,194 @@ +#ifndef __SCRAPER2VDRSERVICES_H
+#define __SCRAPER2VDRSERVICES_H
+
+#include <vdr/epg.h>
+#include <vdr/recording.h>
+
+enum tvType {
+ tSeries,
+ tMovie,
+ tNone,
+};
+
+/*********************************************************************
+* Helper Structures
+*********************************************************************/
+class cTvMedia {
+public:
+ cTvMedia(void) {
+ path = "";
+ width = height = 0;
+ };
+ std::string path;
+ int width;
+ int height;
+};
+
+class cEpisode {
+public:
+ cEpisode(void) {
+ number = 0;
+ season = 0;
+ name = "";
+ firstAired = "";
+ guestStars = "";
+ overview = "";
+ rating = 0.0;
+ };
+ int number;
+ int season;
+ std::string name;
+ std::string firstAired;
+ std::string guestStars;
+ std::string overview;
+ float rating;
+ cTvMedia episodeImage;
+};
+
+class cActor {
+public:
+ cActor(void) {
+ name = "";
+ role = "";
+ };
+ std::string name;
+ std::string role;
+ cTvMedia actorThumb;
+};
+
+/*********************************************************************
+* Data Structures for Service Calls
+*********************************************************************/
+
+// Data structure for service "GetEventType"
+class ScraperGetEventType {
+public:
+ ScraperGetEventType(void) {
+ event = NULL;
+ recording = NULL;
+ type = tNone;
+ movieId = 0;
+ seriesId = 0;
+ episodeId = 0;
+ };
+// in
+ const cEvent *event; // check type for this event
+ const cRecording *recording; // or for this recording
+//out
+ tvType type; //typeSeries or typeMovie
+ int movieId;
+ int seriesId;
+ int episodeId;
+};
+
+//Data structure for full series and episode information
+class cMovie {
+public:
+ cMovie(void) {
+ title = "";
+ originalTitle = "";
+ tagline = "";
+ overview = "";
+ adult = false;
+ collectionName = "";
+ budget = 0;
+ revenue = 0;
+ genres = "";
+ homepage = "";
+ releaseDate = "";
+ runtime = 0;
+ popularity = 0.0;
+ voteAverage = 0.0;
+ };
+//IN
+ int movieId; // movieId fetched from ScraperGetEventType
+//OUT
+ std::string title;
+ std::string originalTitle;
+ std::string tagline;
+ std::string overview;
+ bool adult;
+ std::string collectionName;
+ int budget;
+ int revenue;
+ std::string genres;
+ std::string homepage;
+ std::string releaseDate;
+ int runtime;
+ float popularity;
+ float voteAverage;
+ cTvMedia poster;
+ cTvMedia fanart;
+ cTvMedia collectionPoster;
+ cTvMedia collectionFanart;
+ std::vector<cActor> actors;
+};
+
+//Data structure for full series and episode information
+class cSeries {
+public:
+ cSeries(void) {
+ seriesId = 0;
+ episodeId = 0;
+ name = "";
+ overview = "";
+ firstAired = "";
+ network = "";
+ genre = "";
+ rating = 0.0;
+ status = "";
+ };
+//IN
+ int seriesId; // seriesId fetched from ScraperGetEventType
+ int episodeId; // episodeId fetched from ScraperGetEventType
+//OUT
+ std::string name;
+ std::string overview;
+ std::string firstAired;
+ std::string network;
+ std::string genre;
+ float rating;
+ std::string status;
+ cEpisode episode;
+ std::vector<cActor> actors;
+ std::vector<cTvMedia> posters;
+ std::vector<cTvMedia> banners;
+ std::vector<cTvMedia> fanarts;
+ cTvMedia seasonPoster;
+};
+
+// Data structure for service "GetPosterBanner"
+class ScraperGetPosterBanner {
+public:
+ ScraperGetPosterBanner(void) {
+ type = tNone;
+ };
+// in
+ const cEvent *event; // check type for this event
+//out
+ tvType type; //typeSeries or typeMovie
+ cTvMedia poster;
+ cTvMedia banner;
+};
+
+// Data structure for service "GetPoster"
+class ScraperGetPoster {
+public:
+// in
+ const cEvent *event; // check type for this event
+ const cRecording *recording; // or for this recording
+//out
+ cTvMedia poster;
+};
+
+// Data structure for service "GetPosterThumb"
+class ScraperGetPosterThumb {
+public:
+// in
+ const cEvent *event; // check type for this event
+ const cRecording *recording; // or for this recording
+//out
+ cTvMedia poster;
+};
+
+#endif //__SCRAPER2VDRSERVICES_H
\ No newline at end of file diff --git a/skinnopacity.c b/skinnopacity.c index b85f551..4ded27f 100644 --- a/skinnopacity.c +++ b/skinnopacity.c @@ -19,7 +19,7 @@ #endif -static const char *VERSION = "1.0.4"; +static const char *VERSION = "1.1.0"; static const char *DESCRIPTION = "'nOpacity' Skin"; static const char *MAINMENUENTRY = "nOpacity"; diff --git a/textwindow.c b/textwindow.c index 1d313c6..26ca9f8 100644 --- a/textwindow.c +++ b/textwindow.c @@ -78,11 +78,41 @@ bool cNopacityTextWindow::SetManualPoster(const cRecording *recording, bool full return false; } -void cNopacityTextWindow::SetPoster(const cEvent *event, bool isRecording, bool fullscreen) { +void cNopacityTextWindow::SetPoster(const cEvent *event, const cRecording *recording, bool fullscreen) { + if (!event && !recording) + return; + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if (pScraper2Vdr) { + posterScraper2Vdr.event = event; + posterScraper2Vdr.recording = recording; + if (pScraper2Vdr->Service("GetPoster", &posterScraper2Vdr)) { + hasPoster = true; + int posterWidthOrig = posterScraper2Vdr.poster.width; + int posterHeightOrig = posterScraper2Vdr.poster.height; + if (!fullscreen) { + posterHeight = geometry->Height() - 5; + posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig); + } else { + posterWidth = geometry->Width() / 4; + posterHeight = posterHeightOrig * ((double)posterWidth / (double)posterWidthOrig); + } + } else { + hasPoster = false; + posterHeight = 0; + posterWidth = 0; + } + return; + } static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (recording && recording->Info()) { + event = recording->Info()->GetEvent(); + } if (pTVScraper && event) { poster.event = event; - poster.isRecording = isRecording; + if (recording) + poster.isRecording = true; + else + poster.isRecording = false; if (pTVScraper->Service("TVScraperGetPoster", &poster)) { hasPoster = true; int posterWidthOrig = poster.media.width; @@ -217,8 +247,11 @@ void cNopacityTextWindow::SetEvent(const cEvent *event) { cImageLoader imgLoader; bool epgImageFound = false; if (hasPoster) { - if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { - int posterX = width - posterWidth - border; + int posterX = width - posterWidth - border; + if (imgLoader.LoadPoster(posterScraper2Vdr.poster.path.c_str(), posterWidth, posterHeight)) { + pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage()); + widthTextHeader -= posterWidth + border; + } else if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage()); widthTextHeader -= posterWidth + border; } @@ -267,8 +300,11 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) { widthTextHeader -= posterWidth + border; } } else if (hasPoster) { - if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { - int posterX = width - posterWidth - border; + int posterX = width - posterWidth - border; + if (imgLoader.LoadPoster(posterScraper2Vdr.poster.path.c_str(), posterWidth, posterHeight)) { + pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage()); + widthTextHeader -= posterWidth + border; + } else if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { pixmap->DrawImage(cPoint(posterX, border), imgLoader.GetImage()); widthTextHeader -= posterWidth + border; } @@ -384,6 +420,8 @@ void cNopacityTextWindow::DrawPoster(int border) { if (imgLoader.LoadPoster(*manualPosterPath, posterWidth, posterHeight)) { pixmap->DrawImage(cPoint(border, posterY), imgLoader.GetImage()); } + } else if (imgLoader.LoadPoster(posterScraper2Vdr.poster.path.c_str(), posterWidth, posterHeight)) { + pixmap->DrawImage(cPoint(border, posterY), imgLoader.GetImage()); } else if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { pixmap->DrawImage(cPoint(border, posterY), imgLoader.GetImage()); } diff --git a/textwindow.h b/textwindow.h index b870a48..568d152 100644 --- a/textwindow.h +++ b/textwindow.h @@ -4,6 +4,7 @@ #include <vdr/skins.h> #include <vdr/thread.h> #include "services/tvscraper.h" +#include "services/scraper2vdr.h" class cNopacityTextWindow : public cThread { private: @@ -26,6 +27,7 @@ private: cString manualPosterPath; bool hasPoster; TVScraperGetPoster poster; + ScraperGetPoster posterScraper2Vdr; int posterWidth, posterHeight; bool SetTextScroller(int border, int left); void CreatePixmap(void); @@ -46,7 +48,7 @@ public: 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); + void SetPoster(const cEvent *event, const cRecording *recording, bool fullscreen = false); }; #endif //__NOPACITY_TEXTWINDOW_H
\ No newline at end of file |