[mythtv] [PATCH] MythTV Hide OSD

Ben Bucksch linux.news at bucksch.org
Fri Apr 18 08:50:27 EDT 2003


Ben Bucksch wrote:

> I would write it as in the attached diff

Changed code style to be a bit cleaner and match the rest.
-------------- next part --------------
Index: tv_play.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.45
diff -u -r1.45 tv_play.cpp
--- tv_play.cpp	18 Apr 2003 03:25:32 -0000	1.45
+++ tv_play.cpp	18 Apr 2003 05:47:56 -0000
@@ -972,8 +972,7 @@
     {
         switch (keypressed)
         {
-            case 'i': case 'I': UpdateOSD(); break;
-
+            case 'i': case 'I': ToggleOSD(); break;
             case wsUp: ChangeChannel(CHANNEL_DIRECTION_UP); break;
             case wsDown: ChangeChannel(CHANNEL_DIRECTION_DOWN); break;
             case '/': ChangeChannel(CHANNEL_DIRECTION_FAVORITE); break;
@@ -1585,15 +1584,23 @@
         osd->HideSet("channel_number");
 }
 
-void TV::UpdateOSD(void)
+void TV::ToggleOSD(void)
 {
     if (osd->Visible())
     {
         osd->HideSet("program_info");
         osd->HideSet("channel_number");
-        return;
+        osd->EndPause();
     }
+    else
+    {
+        UpdateOSD();
+        // Should re-display channel and pause info, without timer
+    }
+}
 
+void TV::UpdateOSD(void)
+{
     QString title, subtitle, desc, category, starttime, endtime;
     QString callsign, iconpath, channelname, chanid;
 
Index: tv_play.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_play.h,v
retrieving revision 1.26
diff -u -r1.26 tv_play.h
--- tv_play.h	18 Apr 2003 03:25:32 -0000	1.26
+++ tv_play.h	18 Apr 2003 05:47:56 -0000
@@ -100,7 +100,8 @@
     void DoJumpBack(void);
     void DoSkipCommercials(int direction);
     int  calcSliderPos(int offset, QString &desc);
-    
+
+    void ToggleOSD(void);
     void UpdateOSD(void);
     void UpdateOSDInput(void);
 


More information about the mythtv-dev mailing list