]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Return to correct video mode after EPG. UP/DOWN trigger VLB
authorChris Tallon <chris@vomp.tv>
Sun, 4 Dec 2005 20:24:55 +0000 (20:24 +0000)
committerChris Tallon <chris@vomp.tv>
Sun, 4 Dec 2005 20:24:55 +0000 (20:24 +0000)
vdr.cc
vepg.cc
video.cc
video.h
vvideolive.cc
vvideolive.h

diff --git a/vdr.cc b/vdr.cc
index 696750b1eaff243927c0c69fa0216172ed436f21..6eb863a47314043fdb6f908412b2cb68375bf5bb 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -510,11 +510,15 @@ int VDR::stopStreaming()
     return 0;
   }
 
+printf("sent request\n");
+
   if (!getPacket())
   {
     pthread_mutex_unlock(&mutex);
     return 0;
   }
+printf("got reply\n");
+
 
   int toReturn = (int)extractULONG();
   freePacket();
@@ -634,7 +638,7 @@ EventList* VDR::getChannelSchedule(ULONG number)
 }
 
 EventList* VDR::getChannelSchedule(ULONG number, time_t start, ULONG duration)
-{ 
+{
 // retrieve event list (vector of events) from vdr within filter window. duration is in seconds
   if (!connected) return 0;
 
diff --git a/vepg.cc b/vepg.cc
index a28b53b2af629620b9eb1b261a4e619d4180e39f..014a90c0d3791780e38f8f8ca352ae3a836fc58f 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -297,14 +297,13 @@ int VEpg::handleCommand(int command)
     case Remote::BACK:\r
     case Remote::GUIDE:\r
     {\r
-    // return to normal TV mode TODO vvideolive should handle this (via message?)\r
-      Video::getInstance()->setMode(Video::NORMAL);\r
+      // return to normal TV mode\r
       videoLive->setEpgMode(FALSE);\r
       return 4;\r
     }\r
     case Remote::CHANNELUP:\r
     {\r
-    // change up channel on live TV TODO vvideolive should handle this\r
+    // change up channel on live TV\r
       Message* m = new Message();\r
       m->from = this;\r
       m->to = videoLive;\r
@@ -313,7 +312,7 @@ int VEpg::handleCommand(int command)
       return 2;\r
     }\r
     case Remote::CHANNELDOWN:\r
-    { // change down channel on live TV TODO vvideolive should handle this\r
+    { // change down channel on live TV\r
       Message* m = new Message();\r
       m->from = this;\r
       m->to = videoLive;\r
index ba073d8dbfb942e184d5bc210578759ee4fe4ba3..c0fc1b56c215dd997e5c468132790395aefcb42a 100644 (file)
--- a/video.cc
+++ b/video.cc
@@ -189,6 +189,11 @@ int Video::setMode(UCHAR tmode)
   return 1;
 }
 
+int Video::getMode()
+{
+  return mode;
+}
+
 int Video::signalOff()
 {
   if (ioctl(fdVideo, AV_SET_VID_DENC, 0) != 0) return 0;
diff --git a/video.h b/video.h
index f1d2180853ddbcdd84c8942b5afbffbff0d909c7..a8106f04e04f40668e1f891f5787219ce1ce4fd8 100644 (file)
--- a/video.h
+++ b/video.h
@@ -114,7 +114,7 @@ class Video
     int test2();
 #endif
 
-
+    int getMode();
     int getFD();
     UCHAR getFormat();
     UINT getScreenWidth();
index 8dfd9c64364c9cd53b5c7d5565f4dbbe842aa611..5bc2cdba7ca6b35eb6e83032696a310e3cd23611 100644 (file)
@@ -34,6 +34,7 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType)
   unavailableView = NULL;
   streamType = tstreamType;
   epgmode=false;
+  videoMode = Video::getInstance()->getMode();
   if (streamType == VDR::RADIO) player = new PlayerVideo(Command::getInstance(), 0, 1);
   else                          player = new PlayerVideo(Command::getInstance(), 0, 0);
 
@@ -80,6 +81,13 @@ int VVideoLive::handleCommand(int command)
       else stop();
       return 4;
     }
+    // Take up and down from new remote and do live banner
+    case Remote::UP:
+    case Remote::DOWN:
+    {
+      doBanner(true);
+      return 2;
+    }
     case Remote::DF_UP:
     case Remote::CHANNELUP:
     {
@@ -292,16 +300,13 @@ void VVideoLive::play(int noShowVLB)
 
 void VVideoLive::stop(int noRemoveVLB)
 {
-printf("1\n");
   if (unavailable) return;
-printf("2\n");
   if (!noRemoveVLB && VLiveBanner::getInstance()) viewman->removeView(VLiveBanner::getInstance()); // if live banner is present, remove it. won't cause damage if its not present
-printf("3\n");
 
   player->stop();
-printf("4\n");
+  Log::getInstance()->log("VVideoLive", Log::DEBUG, "Delay starts here due to time taken by plugin to stop");
   vdr->stopStreaming();
-printf("5\n");
+  Log::getInstance()->log("VVideoLive", Log::DEBUG, "Delay ends here due to time taken by plugin to stop");
 }
 
 UINT VVideoLive::upChannel()
@@ -348,5 +353,11 @@ void VVideoLive::showEPG()
 void VVideoLive::setEpgMode(bool mode)
 {
   epgmode = mode;
-}
 
+  // Ok so we do need this function
+  // but FIXME improve this, integrate with live mode switching from remote
+  if (mode == FALSE)
+  {
+    Video::getInstance()->setMode(videoMode);
+  }
+}
index 0f496b404961366ebab6c390c85b86cb3c644640..2d865c6265e45282338c392b06443976b005bd5a 100644 (file)
@@ -92,6 +92,7 @@ class VVideoLive : public View
     int xpos;
     bool epgmode;
     void showEPG();
+    int videoMode;
 };
 
 #endif