diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | detailview.c | 12 | ||||
-rw-r--r-- | displaychannelview.c | 40 | ||||
-rw-r--r-- | helpers.c | 8 | ||||
-rw-r--r-- | helpers.h | 4 | ||||
-rw-r--r-- | menudetailview.c | 10 | ||||
-rw-r--r-- | menudetailview.h | 1 | ||||
-rw-r--r-- | menuitem.c | 25 | ||||
-rw-r--r-- | menuitem.h | 1 | ||||
-rw-r--r-- | services/scraper2vdr.h | 2 | ||||
-rw-r--r-- | services/tvscraper.h | 64 | ||||
-rw-r--r-- | textwindow.c | 42 | ||||
-rw-r--r-- | textwindow.h | 2 |
13 files changed, 35 insertions, 177 deletions
@@ -431,3 +431,4 @@ Version 1.1.3 - Vertical channel logo alignment configurable in displaychannel - added dedicated background pixmap in detailview +- added support for tvscraper again, tvscraper Version 0.2.0 needed diff --git a/detailview.c b/detailview.c index 48cd465..ad230b5 100644 --- a/detailview.c +++ b/detailview.c @@ -609,12 +609,12 @@ cNopacitySeriesView::~cNopacitySeriesView(void) { }
void cNopacitySeriesView::LoadMedia(void) {
- static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
- if (!pScraper2Vdr || seriesId < 1)
+ static cPlugin *pScraper = GetScraperPlugin();
+ if (!pScraper || seriesId < 1)
return;
series.seriesId = seriesId;
series.episodeId = episodeId;
- pScraper2Vdr->Service("GetSeries", &series);
+ pScraper->Service("GetSeries", &series);
}
void cNopacitySeriesView::SetTabs(void) {
@@ -869,11 +869,11 @@ cNopacityMovieView::~cNopacityMovieView(void) { }
void cNopacityMovieView::LoadMedia(void) {
- static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
- if (!pScraper2Vdr || movieId < 1)
+ static cPlugin *pScraper = GetScraperPlugin();
+ if (!pScraper || movieId < 1)
return;
movie.movieId = movieId;
- pScraper2Vdr->Service("GetMovie", &movie);
+ pScraper->Service("GetMovie", &movie);
}
void cNopacityMovieView::SetTabs(void) {
diff --git a/displaychannelview.c b/displaychannelview.c index 68a213a..078f003 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -1,4 +1,3 @@ -#include "services/tvscraper.h" #include "services/scraper2vdr.h" #include "displaychannelview.h" #include "config.h" @@ -577,11 +576,11 @@ void cNopacityDisplayChannelView::DrawPoster(const cEvent *event, bool initial) pixmapPoster = NULL; } - static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); - if (pScraper2Vdr) { + static cPlugin *pScraper = GetScraperPlugin(); + if (pScraper) { ScraperGetPosterBanner call; call.event = event; - if (pScraper2Vdr->Service("GetPosterBanner", &call)) { + if (pScraper->Service("GetPosterBanner", &call)) { int mediaWidth = 0; int mediaHeight = 0; std::string mediaPath = ""; @@ -614,39 +613,6 @@ void cNopacityDisplayChannelView::DrawPoster(const cEvent *event, bool initial) } return; } - - static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if (pTVScraper) { - TVScraperGetPosterOrBanner call; - call.event = event; - if (pTVScraper->Service("TVScraperGetPosterOrBanner", &call)) { - int mediaWidth = 0; - int mediaHeight = 0; - if (call.type == typeSeries) { - mediaWidth = call.media.width; - mediaHeight = call.media.height; - } else if (call.type == typeMovie) { - double ratio = (double)(cOsd::OsdHeight()/3) / (double)call.media.height; - mediaWidth = ratio * call.media.width; - mediaHeight = ratio * call.media.height; - } - 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(call.media.path.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); - } - } - } } void cNopacityDisplayChannelView::DrawSignalMeter(void) { @@ -161,3 +161,11 @@ std::vector<std::string>& splitstring::split(char delim, int rep) { flds.push_back(buf); return flds; } + +cPlugin *GetScraperPlugin(void) { + static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr"); + if( !pScraper ) // if it doesn't exit, try tvscraper + pScraper = cPluginManager::GetPlugin("tvscraper"); + return pScraper; +} + @@ -2,6 +2,8 @@ #define __HELPERS_H #include <vdr/osd.h> +#include <vdr/plugin.h> + cOsd *CreateOsd(int Left, int Top, int Width, int Height); void DrawBlendedBackground(cPixmap *pixmap, int xStart, int width, tColor color, tColor colorBlending, bool fromTop); void DrawRoundedCorners(cPixmap *p, int radius, int x, int y, int width, int height); @@ -17,4 +19,6 @@ public: splitstring(const char *s) : std::string(s) { }; std::vector<std::string>& split(char delim, int rep=0); }; + +cPlugin *GetScraperPlugin(void); #endif // __HELPERS_H diff --git a/menudetailview.c b/menudetailview.c index bc07318..e2a323a 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -37,16 +37,16 @@ void cNopacityDetailView::SetGeometry(int x, int width, int height, int top, int } void cNopacityDetailView::InitiateViewType(void) { - static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + static cPlugin *pScraper = GetScraperPlugin(); ScraperGetEventType call; switch (type) { case dvEvent: { if (!ev) break; call.event = ev; - if (!pScraper2Vdr) { + if (!pScraper) { view = new cNopacityEPGView(osd, imgCache); - } else if (pScraper2Vdr->Service("GetEventType", &call)) { + } else if (pScraper->Service("GetEventType", &call)) { if (call.type == tMovie) { view = new cNopacityMovieView(osd, imgCache, call.movieId); } else if (call.type == tSeries) { @@ -73,9 +73,9 @@ void cNopacityDetailView::InitiateViewType(void) { if (!rec) break; call.recording = rec; - if (!pScraper2Vdr) { + if (!pScraper) { view = new cNopacityEPGView(osd, imgCache); - } else if (pScraper2Vdr->Service("GetEventType", &call)) { + } else if (pScraper->Service("GetEventType", &call)) { if (call.type == tMovie) { view = new cNopacityMovieView(osd, imgCache, call.movieId); } else if (call.type == tSeries) { diff --git a/menudetailview.h b/menudetailview.h index 197a0a1..4f0d2af 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -8,7 +8,6 @@ #include <string> #include <sstream> #include "services/scraper2vdr.h" -#include "services/tvscraper.h" #include "services/epgsearch.h" #include "imagecache.h" #include "config.h" @@ -1174,30 +1174,16 @@ void cNopacityRecordingMenuItem::SetPoster(void) { if (hasManualPoster) manualPosterPath = posterFound; //no manually set poster found, check scraper - static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); - if (pScraper2Vdr) { + static cPlugin *pScraper = GetScraperPlugin(); + if (pScraper) { thumb.event = NULL; thumb.recording = Recording; - if (pScraper2Vdr->Service("GetPosterThumb", &thumb)) { + if (pScraper->Service("GetPosterThumb", &thumb)) { hasThumb = true; } else { hasThumb = false; } } - const cRecordingInfo *info = Recording->Info(); - if (info) { - const cEvent *event = info->GetEvent(); - static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if (pTVScraper && event) { - poster.event = event; - poster.isRecording = true; - if (pTVScraper->Service("TVScraperGetPoster", &poster)) { - hasPoster = true; - } else { - hasPoster = false; - } - } - } } int cNopacityRecordingMenuItem::CheckScrollable(bool hasIcon) { @@ -1400,11 +1386,6 @@ void cNopacityRecordingMenuItem::DrawPoster(void) { posterDrawn = true; pixmapStatic->DrawImage(cPoint(10, 5), imgLoader.GetImage()); } - } else if (hasPoster) { - if (imgLoader.LoadPoster(poster.media.path.c_str(), posterWidth, posterHeight)) { - posterDrawn = true; - pixmapStatic->DrawImage(cPoint(10, 5), imgLoader.GetImage()); - } } if (!posterDrawn) { cImage *imgIcon = imgCache->GetSkinIcon("skinIcons/defaultPoster", posterWidth, posterHeight); @@ -169,7 +169,6 @@ private: bool hasPoster; bool hasThumb; int posterWidth, posterHeight; - TVScraperGetPoster poster; ScraperGetPosterThumb thumb; int Level, Total, New; cRect *vidWin; diff --git a/services/scraper2vdr.h b/services/scraper2vdr.h index 703d077..3538130 100644 --- a/services/scraper2vdr.h +++ b/services/scraper2vdr.h @@ -1,6 +1,8 @@ #ifndef __SCRAPER2VDRSERVICES_H
#define __SCRAPER2VDRSERVICES_H
+#include <string>
+#include <vector>
#include <vdr/epg.h>
#include <vdr/recording.h>
diff --git a/services/tvscraper.h b/services/tvscraper.h deleted file mode 100644 index 8c3cf35..0000000 --- a/services/tvscraper.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __NOPACITY_TVSCRAPER_H -#define __NOPACITY_TVSCRAPER_H - -#include <string> -#include <vector> -#include <vdr/epg.h> - -enum tvMediaType { - typeSeries, - typeMovie, - typeNone, -}; - -struct tvMedia { - std::string path; - int width; - int height; -}; - -struct tvActor { - std::string name; - std::string role; - tvMedia thumb; -}; - -// Data structure for service "TVScraper-GetPosterOrBanner" -struct TVScraperGetPosterOrBanner -{ -// in - const cEvent *event; // search image for this event -//out - tvMediaType type; //typeSeries or typeMovie - tvMedia media; //banner or poster -}; - -// Data structure for service "TVScraper-GetPoster" -struct TVScraperGetPoster -{ -// in - const cEvent *event; // search image for this event - bool isRecording; // search in current EPG or recordings -//out - tvMedia media; //poster -}; - - -/* Data structure for service "TVScraper-GetFullEPGInformation" -if type == typeMovie a poster and a fanart image is delivered -if type == typeSeries a banner and up to three posters and fanarts are delivered -*/ -struct TVScraperGetFullInformation -{ -// in - const cEvent *event; // search all media for this event - bool isRecording; // search in current EPG or recordings -//out - tvMediaType type; - tvMedia banner; - std::vector<tvMedia> posters; - std::vector<tvMedia> fanart; - std::vector<tvActor> actors; - std::string description; -}; -#endif // __NOPACITY_TVSCRAPER_H
\ No newline at end of file diff --git a/textwindow.c b/textwindow.c index 26ca9f8..efe5dcd 100644 --- a/textwindow.c +++ b/textwindow.c @@ -81,11 +81,11 @@ bool cNopacityTextWindow::SetManualPoster(const cRecording *recording, bool full void cNopacityTextWindow::SetPoster(const cEvent *event, const cRecording *recording, bool fullscreen) { if (!event && !recording) return; - static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); - if (pScraper2Vdr) { + static cPlugin *pScraper = GetScraperPlugin(); + if (pScraper) { posterScraper2Vdr.event = event; posterScraper2Vdr.recording = recording; - if (pScraper2Vdr->Service("GetPoster", &posterScraper2Vdr)) { + if (pScraper->Service("GetPoster", &posterScraper2Vdr)) { hasPoster = true; int posterWidthOrig = posterScraper2Vdr.poster.width; int posterHeightOrig = posterScraper2Vdr.poster.height; @@ -101,34 +101,6 @@ void cNopacityTextWindow::SetPoster(const cEvent *event, const cRecording *recor 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; - if (recording) - poster.isRecording = true; - else - poster.isRecording = false; - if (pTVScraper->Service("TVScraperGetPoster", &poster)) { - hasPoster = true; - int posterWidthOrig = poster.media.width; - int posterHeightOrig = poster.media.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; - } } } @@ -251,9 +223,6 @@ void cNopacityTextWindow::SetEvent(const cEvent *event) { 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; } } else if (imgLoader.LoadEPGImage(event->EventID())) { epgImageFound = true; @@ -304,9 +273,6 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) { 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; } } else if (imgLoader.LoadRecordingImage(recording->FileName())) { pixmap->DrawImage(cPoint(width - config.GetValue("epgImageWidth") - border, y), imgLoader.GetImage()); @@ -422,8 +388,6 @@ void cNopacityTextWindow::DrawPoster(int border) { } } 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 568d152..72e50d3 100644 --- a/textwindow.h +++ b/textwindow.h @@ -3,7 +3,6 @@ #include <vdr/skins.h> #include <vdr/thread.h> -#include "services/tvscraper.h" #include "services/scraper2vdr.h" class cNopacityTextWindow : public cThread { @@ -26,7 +25,6 @@ private: bool hasManualPoster; cString manualPosterPath; bool hasPoster; - TVScraperGetPoster poster; ScraperGetPoster posterScraper2Vdr; int posterWidth, posterHeight; bool SetTextScroller(int border, int left); |