From 5dc2d8faba9d0a3ee8cc40bca9ebc5f2a0a2e893 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 5 Oct 2014 17:30:33 +0200 Subject: [PATCH] Support for epgimages --- event.cc | 5 +++-- event.h | 1 + osdopenvg.cc | 17 ++++++++++++++--- osdvector.h | 3 ++- vdr.cc | 6 ++++-- vdr.h | 2 +- vepglistadvanced.cc | 11 +++++++++-- wselectlist.cc | 4 +++- 8 files changed, 37 insertions(+), 12 deletions(-) diff --git a/event.cc b/event.cc index ac272b8..f8cbffd 100644 --- a/event.cc +++ b/event.cc @@ -40,6 +40,7 @@ Event::Event() index = -1; movieID = 0; seriesID =0; + epgImage = 0; } Event::~Event() @@ -82,8 +83,8 @@ void Event::loadinfos(UINT channelid) if (movieID == 0 && seriesID == 0) { - vdr->getScraperEventType(channelid, id, movieID, seriesID, episodeID); - Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper EventType %d %d, %d %d %d", + vdr->getScraperEventType(channelid, id, movieID, seriesID, episodeID, epgImage); + Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper EventType %d %d, %d %d %d %d", id, channelid, movieID, seriesID, episodeID); } diff --git a/event.h b/event.h index e2ad934..7b7822a 100644 --- a/event.h +++ b/event.h @@ -62,6 +62,7 @@ class Event int movieID; int seriesID; int episodeID; + int epgImage; }; class EventSorter diff --git a/osdopenvg.cc b/osdopenvg.cc index ca67d8d..d170c6d 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -346,7 +346,7 @@ bool OsdOpenVG::screenShot(void *buffer, int width, int height, bool osd /*inclu VC_RECT_T rect; res=vc_dispmanx_resource_create(VC_IMAGE_RGBA32,width,height,&image_ptr); display=vc_dispmanx_display_open(0); - if (!osd ) { + if (!osd) { vc_dispmanx_snapshot(display, res, (DISPMANX_TRANSFORM_T)(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL/*|DISPMANX_SNAPSHOT_PACK*/)); } @@ -926,6 +926,18 @@ void OsdOpenVG::executeDrawCommand(SVGCommand & command) //vgScale(720.f/((float)BACKBUFFER_WIDTH), 576.f/((float)BACKBUFFER_HEIGHT)); float scalex=command.w/imagewidth; float scaley=command.h/imageheight; + float tx=command.x; + float ty=command.y; + if (command.corner == TopLeftLimited) { + if (imagewidth>imageheight && scalex!=0.f) { + scaley=0.f; + ty+=(command.h-imageheight * scalex/aspect_correction)*0.5f; + } + if (imagewidthextractLONG(); } + epgImage = vresp->extractLONG(); delete vresp; } diff --git a/vdr.h b/vdr.h index c4c2906..ce796a3 100644 --- a/vdr.h +++ b/vdr.h @@ -216,7 +216,7 @@ public ExternLogger //TV Scraper support void getScraperEventType(char * fileName, int & movieID, int & seriesID, int & episodeID); - void getScraperEventType(UINT eventid, UINT channelid, int & movieID, int & seriesID, int & episodeID); + void getScraperEventType(UINT eventid, UINT channelid, int & movieID, int & seriesID, int & episodeID, int & epgImage); MovieInfo *getScraperMovieInfo(int movieID); SeriesInfo *getScraperSeriesInfo(int seriesID, int episodeID); ULONG loadTVMedia(TVMediaInfo& tvmedia); diff --git a/vepglistadvanced.cc b/vepglistadvanced.cc index f86f0b8..c87884d 100644 --- a/vepglistadvanced.cc +++ b/vepglistadvanced.cc @@ -431,6 +431,7 @@ void VEpgListAdvanced::drawDataChannel(bool doIndexPop) sl.addColumn(0); sl.addColumn(25 ); sl.addColumn(25 + 7); + sl.addColumn(25 + 7+ 7); //sl.addColumn(118); int first = 1; @@ -457,7 +458,7 @@ void VEpgListAdvanced::drawDataChannel(bool doIndexPop) btime = localtime(&eventEndTime); strftime(tempB, 299, "- %H:%M ", btime); //#endif - sprintf(tempC, "%s\n \t%s%s", currentEvent->title,tempA,tempB); + sprintf(tempC, "\t %s\n \t \t%s%s", currentEvent->title,tempA,tempB); // New TVMedia stuff TVMediaInfo *info= new TVMediaInfo(); info->setPosterThumb(channelNumber, currentEvent->id); @@ -709,7 +710,13 @@ void VEpgListAdvanced::updateSelection() epgTVmedia.setTVMedia(poster.info, WTVMedia::ZoomHorizontal); epgTVmedia.setVisible(true); } else { - if (mode!=OneChannel) { + if (toShow->epgImage) + { + TVMediaInfo info; + info.setPosterThumb(channel,toShow->id); + epgTVmedia.setTVMedia(info, WTVMedia::ZoomHorizontal); + epgTVmedia.setVisible(true); + }else if (mode!=OneChannel) { TVMediaInfo info; info.setChannelLogo(channel); epgTVmedia.setTVMedia(info, WTVMedia::ZoomHorizontal); diff --git a/wselectlist.cc b/wselectlist.cc index 7b40406..03610b4 100644 --- a/wselectlist.cc +++ b/wselectlist.cc @@ -159,9 +159,11 @@ void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, cons int fontHeight = getFontHeight(); float ypos_mod= ypos + (linesPerOption-floor(linesPerOption))*((float)fontHeight)*0.5f; + int imagewidth=0; + if (numColumns>1) imagewidth=columns[1]-columns[0]; if (pict) { - drawTVMedia(*pict, xpos,ypos,0,fontHeight*linesPerOption,TopLeft); + drawTVMedia(*pict, xpos,ypos,imagewidth,fontHeight*linesPerOption,TopLeftLimited); taboffset++; } -- 2.39.2