]> git.vomp.tv Git - vompclient.git/commitdiff
Support for epgimages
authorMarten Richter <marten.richter@freenet.de>
Sun, 5 Oct 2014 15:30:33 +0000 (17:30 +0200)
committerMarten Richter <marten.richter@freenet.de>
Sun, 5 Oct 2014 15:30:33 +0000 (17:30 +0200)
event.cc
event.h
osdopenvg.cc
osdvector.h
vdr.cc
vdr.h
vepglistadvanced.cc
wselectlist.cc

index ac272b8fc85b1e9acd7fab50874de9663ec18a59..f8cbffd3fc43f21ad5d8b0914b1fa883101deb0a 100644 (file)
--- 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 e2ad9344380f2582c73eb5de3a6101dddfc2ae0c..7b7822a204ee4050d977304ee1e08dc2533a4069 100644 (file)
--- a/event.h
+++ b/event.h
@@ -62,6 +62,7 @@ class Event
     int movieID;
     int seriesID;
     int episodeID;
+    int epgImage;
 };
 
 class EventSorter
index ca67d8d401030e4d9bc1344c8967498ae8fad8eb..d170c6d472ebeaefca983cb689a50a5acd9ed27d 100644 (file)
@@ -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 (imagewidth<imageheight && scaley!=0.f) {
+                                       scalex=0.f;
+                                       tx+=(command.w-imagewidth * scaley*aspect_correction)*0.5f;
+                               }
+                       }
                        if (scalex==0.f && scaley==0.f) {
                                scalex=aspect_correction;
                                scaley=1.f;
@@ -934,8 +946,7 @@ void OsdOpenVG::executeDrawCommand(SVGCommand & command)
                        } else if (scaley==0.f) {
                                scaley=scalex/aspect_correction;
                        }
-                       float tx=command.x;
-                       float ty=command.y;
+
 
                        if (command.corner ==  BottomRight || command.corner ==  BottomLeft || command.corner == BottomMiddle)
                        {
index a3e193ce619a962d84f7eb5f0ce6f86c3092697d..7881f3ad61df75dd5228a6468655eeaa5370cc9b 100644 (file)
@@ -55,7 +55,8 @@ enum Corner{
        BottomLeft,
        BottomRight,
        TopMiddle,
-       BottomMiddle
+       BottomMiddle,
+       TopLeftLimited
 };
 
 typedef  unsigned int ImageIndex;
diff --git a/vdr.cc b/vdr.cc
index 97be450cbb4b22f9c0c86f62400f51528d55286a..c73fea9de3d98e67890394e3ddaaf2f69ce9a239 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -1598,7 +1598,7 @@ void VDR::shutdownVDR()
 }
 
 void VDR::getScraperEventType(char * fileName, int & movieID,
-               int & seriesID, int & episodeID )
+               int & seriesID, int & episodeID)
 {
        movieID = 0;
        seriesID = 0;
@@ -1624,11 +1624,12 @@ void VDR::getScraperEventType(char * fileName, int & movieID,
 }
 
 void VDR::getScraperEventType(UINT channelid, UINT eventid, int & movieID,
-               int & seriesID, int & episodeID )
+               int & seriesID, int & episodeID, int & epgImage )
 {
        movieID = 0;
        seriesID = 0;
        episodeID = 0;
+       epgImage = 0;
        VDR_RequestPacket vrp;
        if (!vrp.init(VDR_GETEVENTSCRAPEREVENTTYPE, false, 0)) return;
        if (!vrp.addULONG(channelid)) return ;
@@ -1646,6 +1647,7 @@ void VDR::getScraperEventType(UINT channelid, UINT eventid, int & movieID,
        {
                movieID = vresp->extractLONG();
        }
+       epgImage = vresp->extractLONG();
        delete vresp;
 
 }
diff --git a/vdr.h b/vdr.h
index c4c29060cfe4fdb630299bb741d0d6f250093e6e..ce796a3d5fce8a3c25d11a9167a41597586baa7b 100644 (file)
--- 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);
index f86f0b83333677d8c3ea6818baafb8822d0c4f09..c87884daba7a79f82b3d4d8484269d0dc71192c1 100644 (file)
@@ -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);
index 7b40406013698c6300bfcb2874dd2af6228f495f..03610b4bd1dd5ced57d89c940c4020d71ebf32a7 100644 (file)
@@ -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++;
   }