]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Fix old remote osd in live tv
authorChris Tallon <chris@vomp.tv>
Sat, 14 Jun 2008 14:41:44 +0000 (14:41 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 14 Jun 2008 14:41:44 +0000 (14:41 +0000)
vvideolivetv.cc
vvideolivetv.h

index f61b551469431db13651d3e4b6288c62dd929c78..9f67cb46fdf2fbe471e18361e9248a8cda1c1cb6 100644 (file)
@@ -113,6 +113,10 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
     wssRegion.h = 2;
   }
   
+  // This variable is set to true if the user pressed OK to bring the OSD on screen
+  // This is only used on old remotes to stop up/down buttons being used for osd-epg scrolling
+  okTriggeredOSD = false;
+  
   Colour osdBack = Colour(0, 0, 0, 128);
   
   osd.setBackgroundColour(osdBack);
@@ -282,58 +286,66 @@ int VVideoLiveTV::handleCommand(int command)
       vchannelList->highlightChannel((*chanList)[currentChannelIndex]);
       return 4;
     }
+    
+    // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there
     case Remote::UP:
     {
-      // New remote only
-      // epg data up
       doUpDown(false);
       return 2;
     }
     case Remote::DOWN:
     {
-      // New remote only
-      // epg data down
       doUpDown(true);
       return 2;
     }
     case Remote::LEFT:
     {
-      // New remote only
-      // epg data ch down
       doLeftRight(false);
       return 2;
     }
     case Remote::RIGHT:
     {
-      // New remote only
-      // epg data ch up
       doLeftRight(true);
       return 2;
     }
-    case Remote::DF_UP:
+    // Continue new remote only...
+    case Remote::CHANNELUP:
     {
-      // Old remote, decide what to do based on whether the osd is showing
-      if (osd.getVisible()) doUpDown(false);
-      else doChanUpDown(UP);
+      doChanUpDown(UP);
       return 2;
     }
-    case Remote::DF_DOWN:
+    case Remote::CHANNELDOWN:
     {
-      // Old remote, decide what to do based on whether the osd is showing
-      if (osd.getVisible()) doUpDown(true);
-      else doChanUpDown(DOWN);
+      doChanUpDown(DOWN);
       return 2;
     }
-    case Remote::CHANNELUP:
+
+    // END NEW REMOTE ONLY, START OLD REMOTE ONLY
+    
+    // DF_LEFT and DF_RIGHT never get here because they are stolen
+    // by command as vol- and vol+
+    
+    // Old remote. Decide what to do based on whether
+    // OK was pressed - osd shown manually, use up/down for epg nav
+    // UP/DOWN was pressed to change channel, osd was shown auto, use up/down for ch+/ch-
+    
+    case Remote::DF_UP:
     {
-      doChanUpDown(UP);
+      // Old remote, decide what to do based on okTriggeredOSD
+      if (okTriggeredOSD) doUpDown(false);
+      else doChanUpDown(UP);
       return 2;
     }
-    case Remote::CHANNELDOWN:
+    case Remote::DF_DOWN:
     {
-      doChanUpDown(DOWN);
+      // Old remote, decide what to do based on okTriggeredOSD
+      if (okTriggeredOSD) doUpDown(true);
+      else doChanUpDown(DOWN);
       return 2;
     }
+
+    // END NEW/OLD REMOTE STUFF
+
     case Remote::PREVCHANNEL:
     {
       channelChange(PREVIOUS, 0);
@@ -479,6 +491,7 @@ void VVideoLiveTV::doOK()
   {
     osdChannelIndex = currentChannelIndex;
     displayOSD(true);
+    okTriggeredOSD = true;
   }
 }
 
@@ -701,6 +714,8 @@ void VVideoLiveTV::clearScreen()
   osd.setVisible(false);
   summary.setVisible(false);
 
+  okTriggeredOSD = false;
+
   draw();
   boxstack->update(this);
 }
@@ -760,6 +775,7 @@ void VVideoLiveTV::timercall(int ref)
       }
       
       osd.setVisible(false);
+      okTriggeredOSD = false;
       draw();
       boxstack->update(this, osd.getRegion());
     }
index d261d98c3aad5ec0a853d78319aaa790f9527006..78b7339b172b42d52cd3dadf31e500690ea883bf 100644 (file)
@@ -139,6 +139,8 @@ class VVideoLiveTV : public Boxx, public TimerReceiver
     Boxx summaryBlackLine;
     
     Region osdSummaryRegion;
+    
+    bool okTriggeredOSD;
 
 };