diff options
-rw-r--r-- | displaychannel.c | 101 | ||||
-rw-r--r-- | displaychannel.h | 13 | ||||
-rw-r--r-- | displaymenu.c | 96 | ||||
-rw-r--r-- | services/scraper2vdr.h | 194 | ||||
-rw-r--r-- | setup.c | 3 | ||||
-rw-r--r-- | setup.h | 5 |
6 files changed, 324 insertions, 88 deletions
diff --git a/displaychannel.c b/displaychannel.c index 6c84c841..643d3168 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -7,7 +7,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { doOutput = false; return; } else - doOutput = true; + doOutput = true; present = NULL; channelName = ""; @@ -17,7 +17,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { chanLogoBGPixmap = NULL; chanIconsPixmap = NULL; chanEpgImagesPixmap = NULL; - + isGroup = false; isRecording = false, isRadioChannel = false; @@ -25,7 +25,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { screenWidth = lastScreenWidth = -1; LastSignalStrength = -1; LastSignalQuality = -1; - + CreateFullOsd(); if ( !osd ) return; @@ -42,7 +42,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { heightBottom += max(fontSmlHeight, (Config.decorProgressSignalSize*2) + marginItem) + marginItem; else if( Config.ChannelIconsShow ) heightBottom += fontSmlHeight + marginItem; - + int heightTop = fontHeight; int height = heightBottom; @@ -58,7 +58,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { TVSTop = topBarHeight + 20 + Config.decorBorderChannelSize; TVSWidth = osdWidth - 40 - Config.decorBorderChannelSize*2; TVSHeight = osdHeight - topBarHeight - heightBottom - 40 - Config.decorBorderChannelSize*2; - + chanEpgImagesPixmap = osd->CreatePixmap(2, cRect(TVSLeft, TVSTop, TVSWidth, TVSHeight)); chanEpgImagesPixmap->Fill( clrTransparent ); @@ -76,12 +76,12 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { Config.decorProgressChannelFg, Config.decorProgressChannelBarFg, Config.decorProgressChannelBg, Config.decorProgressChannelType, true); ProgressBarDrawBgColor(); - + height += heightTop; chanInfoTopPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightTop)); chanInfoTopPixmap->Fill( clrTransparent ); - + DecorBorderDraw(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightTop + heightBottom + Config.decorProgressChannelSize+marginItem*2, Config.decorBorderChannelSize, Config.decorBorderChannelType, Config.decorBorderChannelFg, Config.decorBorderChannelBg); @@ -113,17 +113,17 @@ void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) { isRecording = false; chanIconsPixmap->Fill( clrTransparent ); lastScreenWidth = -1; - + if (Channel) { isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false; isGroup = Channel->GroupSep(); - + channelName = Channel->Name(); if (!Channel->GroupSep()) channelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : ""); else if (Number) channelNumber = cString::sprintf("%d-", Number); - + CurChannel = Channel; } else channelName = ChannelString(NULL, 0); @@ -146,7 +146,7 @@ void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) { imageBGWidth = imgBG->Width(); chanLogoBGPixmap->DrawImage( cPoint(imageLeft, imageTop), *imgBG ); } - + cImage *img = imgLoader.LoadLogo(*channelName, imageBGWidth - 4, imageBGHeight - 4); if( img ) { imageTop = marginItem + (imageBGHeight - img->Height()) / 2; @@ -181,7 +181,7 @@ void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolut int top = heightBottom - height - marginItem; int imageTop = 0; cImage *img = NULL; - + int left = channelWidth - width - marginItem*2; if( Channel ) { @@ -312,7 +312,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi bool isRec = false; int RecWidth = fontSml->Width("REC"); - + int left = heightBottom * 1.34 + marginItem; if( Present ) { @@ -329,7 +329,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi isRec = true; epgWidth += marginItem + RecWidth; } - + int s = (int)(time(NULL) - Present->StartTime()) / 60; int sleft = (Present->Duration() / 60) - s; @@ -358,12 +358,12 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi } else { epgShort = Present->ShortText(); } - + chanInfoBottomPixmap->DrawText(cPoint(channelWidth - timeStringWidth - marginItem * 2, 0), *timeString, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); chanInfoBottomPixmap->DrawText(cPoint(channelWidth - seenWidth - marginItem * 2, fontSmlHeight), *seen, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); - + chanInfoBottomPixmap->DrawText(cPoint(left, 0), *epg, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), font); chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight), *epgShort, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); @@ -372,7 +372,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi Theme.Color(clrChannelRecordingPresentFg), Theme.Color(clrChannelRecordingPresentBg), fontSml); } } - + if( Following ) { isRec = false; cString startTime = Following->GetTimeString(); @@ -388,7 +388,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi epgWidth += marginItem + RecWidth; isRec = true; } - + cString dur = cString::sprintf("%d min", Following->Duration() / 60); int durWidth = fontSml->Width(*dur); @@ -433,17 +433,33 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi if( Config.ChannelIconsShow && CurChannel ) { ChannelIconsDraw(CurChannel, false); } - + + std::string mediaPath; + int mediaWidth = 0; + int mediaHeight = 0; + // TVScraper - chanEpgImagesPixmap->Fill(clrTransparent); - DecorBorderClearByFrom(BorderTVSPoster); static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if( Config.TVScraperChanInfoShowPoster && pTVScraper ) { + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if( Config.TVScraperChanInfoShowPoster && pScraper2Vdr ) { + ScraperGetPosterBanner call; + call.event = Present; + if (pScraper2Vdr->Service("GetPosterBanner", &call)) { + std::string mediaPath = ""; + if ((call.type == tSeries) && call.banner.path.size() > 0) { + mediaWidth = call.banner.width * Config.TVScraperChanInfoPosterSize*100; + mediaHeight = call.banner.height * Config.TVScraperChanInfoPosterSize*100; + mediaPath = call.banner.path; + } else if (call.type == tMovie && call.poster.path.size() > 0) { + mediaWidth = call.poster.width * 0.5 * Config.TVScraperChanInfoPosterSize*100; + mediaHeight = call.poster.height * 0.5 * Config.TVScraperChanInfoPosterSize*100; + mediaPath = call.poster.path; + } + } + } else if( Config.TVScraperChanInfoShowPoster && pTVScraper ) { TVScraperGetPosterOrBanner call; call.event = Present; if (pTVScraper->Service("TVScraperGetPosterOrBanner", &call)) { - int mediaWidth = 0; - int mediaHeight = 0; if (call.type == typeSeries) { mediaWidth = call.media.width * Config.TVScraperChanInfoPosterSize*100; mediaHeight = call.media.height * Config.TVScraperChanInfoPosterSize*100; @@ -451,14 +467,19 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi mediaWidth = call.media.width * 0.5 * Config.TVScraperChanInfoPosterSize*100; mediaHeight = call.media.height * 0.5 * Config.TVScraperChanInfoPosterSize*100; } - cImage *img = imgLoader.LoadFile(call.media.path.c_str(), mediaWidth, mediaHeight); + mediaPath = call.media.path; + } + } - if( img ) { - chanEpgImagesPixmap->DrawImage(cPoint(0, 0), *img); + chanEpgImagesPixmap->Fill(clrTransparent); + DecorBorderClearByFrom(BorderTVSPoster); + if( mediaPath.length() > 0 ) { + cImage *img = imgLoader.LoadFile(mediaPath.c_str(), mediaWidth, mediaHeight); + if( img ) { + chanEpgImagesPixmap->DrawImage(cPoint(0, 0), *img); - DecorBorderDraw(20 + Config.decorBorderChannelSize, topBarHeight + 20 + Config.decorBorderChannelSize, img->Width(), img->Height(), - Config.decorBorderChannelSize, Config.decorBorderChannelType, Config.decorBorderChannelFg, Config.decorBorderChannelBg, BorderTVSPoster); - } + DecorBorderDraw(20 + Config.decorBorderChannelSize, topBarHeight + 20 + Config.decorBorderChannelSize, img->Width(), img->Height(), + Config.decorBorderChannelSize, Config.decorBorderChannelType, Config.decorBorderChannelFg, Config.decorBorderChannelBg, BorderTVSPoster); } } } @@ -483,17 +504,17 @@ void cFlatDisplayChannel::SignalQualityDraw(void) { return; LastSignalStrength = SignalStrength; LastSignalQuality = SignalQuality; - + cFont *SignalFont = cFont::CreateFont(Setup.FontOsd, Config.decorProgressSignalSize); - + int top = fontHeight*2 + fontSmlHeight*2 + marginItem; top += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - fontSmlHeight / 2; int left = marginItem * 2; int progressTop = fontHeight*2 + fontSmlHeight*2 + marginItem; progressTop += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - Config.decorProgressSignalSize / 2; - + progressTop = top; - + chanInfoBottomPixmap->DrawText(cPoint(left, top), "STR", Theme.Color(clrChannelSignalFont), Theme.Color(clrChannelBg), SignalFont); int progressLeft = left + SignalFont->Width("STR") + SignalFont->Width(" ") + marginItem; @@ -505,12 +526,12 @@ void cFlatDisplayChannel::SignalQualityDraw(void) { //left = signalWidth / 2 + marginItem; top += Config.decorProgressSignalSize + marginItem; progressTop = top; - + chanInfoBottomPixmap->DrawText(cPoint(left, top), "SNR", Theme.Color(clrChannelSignalFont), Theme.Color(clrChannelBg), SignalFont); progressLeft = left + SignalFont->Width("STR") + SignalFont->Width(" ") + marginItem; //progressWidth = signalWidth - progressLeft - marginItem; - + ProgressBarDrawRaw(chanInfoBottomPixmap, chanInfoBottomPixmap, cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), SignalQuality, 100, Config.decorProgressSignalFg, Config.decorProgressSignalBarFg, Config.decorProgressSignalBg, Config.decorProgressSignalType, false, Config.SignalQualityUseColors); @@ -532,7 +553,7 @@ void cFlatDisplayChannel::Flush(void) { } if( Config.SignalQualityShow ) SignalQualityDraw(); - + if( Config.ChannelIconsShow ) { cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, screenAspect); if (screenWidth != lastScreenWidth) { @@ -549,7 +570,7 @@ void cFlatDisplayChannel::PreLoadImages(void) { imgLoader.LoadIcon("logo_background", height, height); int imageBGHeight, imageBGWidth; imageBGHeight = imageBGWidth = height; - + cImage *imgBG = imgLoader.LoadIcon("logo_background", height*1.34, height); if( imgBG ) { imageBGHeight = imgBG->Height(); @@ -557,7 +578,7 @@ void cFlatDisplayChannel::PreLoadImages(void) { } imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10); imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10); - + int index = 0; height = ((fontHeight*2) + (fontSmlHeight*2) + marginItem) - marginItem*2; cImage *img = NULL; @@ -567,7 +588,7 @@ void cFlatDisplayChannel::PreLoadImages(void) { if( img ) index++; } - + height = max(fontSmlHeight, Config.decorProgressSignalSize); imgLoader.LoadIcon("crypted", 999, height); imgLoader.LoadIcon("uncrypted", 999, height); diff --git a/displaychannel.h b/displaychannel.h index 756ba85c..696002a1 100644 --- a/displaychannel.h +++ b/displaychannel.h @@ -3,6 +3,7 @@ #include "baserender.h" #include "flat.h" #include "services/tvscraper.h" +#include "services/scraper2vdr.h" class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel { private: @@ -13,28 +14,28 @@ class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel { cString channelName; const cChannel *CurChannel; - + cPixmap *chanInfoTopPixmap; cPixmap *chanInfoBottomPixmap; cPixmap *chanLogoPixmap; cPixmap *chanLogoBGPixmap; cPixmap *chanIconsPixmap; cPixmap *chanEpgImagesPixmap; - + int screenWidth, lastScreenWidth; int screenHeight; double screenAspect; int heightBottom, heightImageLogo; - + int LastSignalStrength, LastSignalQuality; - + // TVScraper int TVSLeft, TVSTop, TVSWidth, TVSHeight; - + bool isRecording; bool isRadioChannel; bool isGroup; - + void SignalQualityDraw(void); void ChannelIconsDraw(const cChannel *Channel, bool Resolution); diff --git a/displaymenu.c b/displaymenu.c index da21460d..4163af40 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -1,5 +1,6 @@ #include "displaymenu.h" #include "services/tvscraper.h" +#include "services/scraper2vdr.h" #include "services/epgsearch.h" #ifndef VDRLOGO @@ -745,9 +746,9 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C Width = menuItemWidth - LeftName; if( Channel->GroupSep() ) { int lineTop = Top + (fontHeight - 3) / 2; - menuPixmap->DrawRectangle(cRect( Left, lineTop, menuWidth, 3), ColorFg); + menuPixmap->DrawRectangle(cRect( Left, lineTop, menuItemWidth - Left, 3), ColorFg); cString groupname = cString::sprintf(" %s ", *buffer); - menuPixmap->DrawText(cPoint(Left + (menuWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter); + menuPixmap->DrawText(cPoint(Left + (menuItemWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter); } else menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); } else { @@ -760,9 +761,9 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C if( Channel->GroupSep() ) { int lineTop = Top + (fontHeight - 3) / 2; - menuPixmap->DrawRectangle(cRect( Left, lineTop, menuWidth, 3), ColorFg); + menuPixmap->DrawRectangle(cRect( Left, lineTop, menuItemWidth - Left, 3), ColorFg); cString groupname = cString::sprintf(" %s ", *buffer); - menuPixmap->DrawText(cPoint(Left + (menuWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter); + menuPixmap->DrawText(cPoint(Left + (menuItemWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter); } else { menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); @@ -941,39 +942,56 @@ void cFlatDisplayMenu::DrawItemExtraEvent(const cEvent *Event, cString EmptyText ComplexContent.SetPosition(cRect(cLeft, cTop, cWidth, cHeight)); ComplexContent.SetBGColor(Theme.Color(clrMenuEventBg)); - if( Config.TVScraperEPGInfoShowPoster ) { - // TVScraper - DecorBorderClearByFrom(BorderTVSPoster); - static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if( Config.TVScraperChanInfoShowPoster && pTVScraper ) { - TVScraperGetPosterOrBanner call; - call.event = Event; - if (pTVScraper->Service("TVScraperGetPosterOrBanner", &call)) { - int mediaWidth = 0; - int mediaHeight = 0; - if (call.type == typeSeries) { - mediaWidth = cWidth - marginItem*2; - mediaHeight = 999; - } else if (call.type == typeMovie) { - mediaWidth = cWidth/2 - marginItem*3; - mediaHeight = 999; - } - cImage *img = imgLoader.LoadFile(call.media.path.c_str(), mediaWidth, mediaHeight); - if( img && call.type == typeMovie ) { - ComplexContent.AddImageWithFloatedText(img, CIP_Right, text.str().c_str(), cRect(marginItem, marginItem, cWidth - marginItem*2, cHeight - marginItem*2), - Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); - } else if( img && call.type == typeSeries ) { - ComplexContent.AddImage(img, cRect(marginItem, marginItem, img->Width(), img->Height()) ); - ComplexContent.AddText(text.str().c_str(), true, cRect(marginItem, marginItem + img->Height(), cWidth - marginItem*2, cHeight - marginItem*2), - Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); - } else { - ComplexContent.AddText(text.str().c_str(), true, cRect(marginItem, marginItem, cWidth - marginItem*2, cHeight - marginItem*2), - Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); - } - } else { - ComplexContent.AddText(text.str().c_str(), true, cRect(marginItem, marginItem, cWidth - marginItem*2, cHeight - marginItem*2), - Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); + std::string mediaPath; + int mediaWidth = 0; + int mediaHeight = 0; + int mediaType = 0; + // TVScraper + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if( Config.TVScraperEPGInfoShowPoster && pScraper2Vdr ) { + ScraperGetPosterBanner call; + call.event = Event; + if (pScraper2Vdr->Service("GetPosterBanner", &call)) { + std::string mediaPath = ""; + if ((call.type == tSeries) && call.banner.path.size() > 0) { + mediaWidth = cWidth - marginItem*2; + mediaHeight = 999; + mediaPath = call.banner.path; + mediaType = 1; + } else if (call.type == tMovie && call.poster.path.size() > 0) { + mediaWidth = cWidth/2 - marginItem*3; + mediaHeight = 999; + mediaPath = call.poster.path; + mediaType = 2; + } + } + } else if( Config.TVScraperEPGInfoShowPoster && pTVScraper ) { + TVScraperGetPosterOrBanner call; + call.event = Event; + if (pTVScraper->Service("TVScraperGetPosterOrBanner", &call)) { + if (call.type == typeSeries) { + mediaWidth = cWidth - marginItem*2; + mediaHeight = 999; + mediaType = 1; + } else if (call.type == typeMovie) { + mediaWidth = cWidth/2 - marginItem*3; + mediaHeight = 999; + mediaType = 2; } + mediaPath = call.media.path; + } + } + + if( mediaPath.length() > 0 ) { + cImage *img = imgLoader.LoadFile(mediaPath.c_str(), mediaWidth, mediaHeight); + if( img && mediaType == 2 ) { + ComplexContent.AddImageWithFloatedText(img, CIP_Right, text.str().c_str(), cRect(marginItem, marginItem, cWidth - marginItem*2, cHeight - marginItem*2), + Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); + } else if( img && mediaType == 1 ) { + ComplexContent.AddImage(img, cRect(marginItem, marginItem, img->Width(), img->Height()) ); + ComplexContent.AddText(text.str().c_str(), true, cRect(marginItem, marginItem + img->Height(), cWidth - marginItem*2, cHeight - marginItem*2), + Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); } else { ComplexContent.AddText(text.str().c_str(), true, cRect(marginItem, marginItem, cWidth - marginItem*2, cHeight - marginItem*2), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); @@ -1297,10 +1315,10 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current Left += imageBGWidth + marginItem * 2; LeftSecond = Left; - w = menuWidth / 10 * 2; + w = menuItemWidth / 10 * 2; if( Channel->GroupSep() ) { int lineTop = Top + (fontHeight - 3) / 2; - menuPixmap->DrawRectangle(cRect( Left, lineTop, menuWidth, 3), ColorFg); + menuPixmap->DrawRectangle(cRect( Left, lineTop, menuItemWidth - Left, 3), ColorFg); Left += w / 2; cString groupname = cString::sprintf(" %s ", Channel->ShortName(true)); menuPixmap->DrawText(cPoint(Left, Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter); @@ -1443,7 +1461,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current if( found >= 10 ) { std::string date = sep.substr(found - 10, 10); int lineTop = Top + (fontHeight - 3) / 2; - menuPixmap->DrawRectangle(cRect( 0, lineTop, menuWidth, 3), ColorFg); + menuPixmap->DrawRectangle(cRect( 0, lineTop, menuItemWidth, 3), ColorFg); cString datespace = cString::sprintf(" %s ", date.c_str()); menuPixmap->DrawText(cPoint(LeftSecond + menuWidth / 10 * 2, Top), datespace, ColorFg, ColorBg, font, 0, 0, taCenter); } else diff --git a/services/scraper2vdr.h b/services/scraper2vdr.h new file mode 100644 index 00000000..703d0771 --- /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 @@ -84,7 +84,8 @@ void cFlatSetup::Setup(void) { Add(new cOsdItem(tr("Tracks settings"), osUnknown, true)); static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); - if (pTVScraper) + static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); + if( pTVScraper || pScraper2Vdr ) Add(new cOsdItem(tr("TVScraper settings"), osUnknown, true)); else Add(new cOsdItem(tr("TVScraper not installed"), osUnknown, false)); @@ -4,14 +4,15 @@ #include <vdr/tools.h> #include "config.h" #include "services/tvscraper.h" +#include "services/scraper2vdr.h" class cFlatSetup : public cMenuSetupPage { public: cFlatSetup(void); - virtual ~cFlatSetup(); + virtual ~cFlatSetup(); private: cFlatConfig SetupConfig; - + int ItemLastSel; void Setup(void); protected: |