[mythtv] [PATCH] LCD channel info patch, third try

Tako Schotanus quintesse at palacio-cristal.com
Sun Aug 1 08:34:22 EDT 2004


Ok, Isaac, rewritten according to your specs. Just let me know if 
there's still something wrong with it.

Cheers,
 -Tako

-------------- next part --------------
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.197
diff -u -d -r1.197 tv_play.cpp
--- libs/libmythtv/tv_play.cpp	23 Jul 2004 19:39:14 -0000	1.197
+++ libs/libmythtv/tv_play.cpp	1 Aug 2004 12:28:26 -0000
@@ -239,9 +239,6 @@
 
     sleepTimer = new QTimer(this);
     connect(sleepTimer, SIGNAL(timeout()), SLOT(SleepEndTimer()));
-
-    lcdTimer = new QTimer(this);
-    connect(lcdTimer, SIGNAL(timeout()), SLOT(UpdateLCD()));
 }
 
 void TV::Init(bool createWindow)
@@ -374,11 +371,6 @@
         delete m_db;
 
     gContext->GetLCDDevice()->switchToTime();
-    if (lcdTimer)
-    {
-        lcdTimer->stop();
-        delete lcdTimer;
-    }
 }
 
 TVState TV::GetState(void)
@@ -514,7 +506,6 @@
     changeState = true;
 
     gContext->GetLCDDevice()->switchToChannel(rcinfo->chansign, rcinfo->title, rcinfo->subtitle);
-    lcdTimer->start(kLCDTimeout, false);
 
     return 1;
 }
@@ -1040,6 +1031,8 @@
     int updatecheck = 0;
     update_osd_pos = false;
 
+    UpdateLCD();
+    
     ChannelClear();
 
     switchingCards = false;
@@ -1141,6 +1134,23 @@
                     ChannelClear();
             }
         }
+        
+        if (lcdUpdate-- <= 0) {
+            if (internalState == kState_WatchingLiveTV)
+            {
+                ShowLCDChannelInfo();
+            }
+            lcdUpdate = 60;
+        }
+        
+        float progress = 0.0;
+        if (activenvp)
+        {
+            QString dummy;
+            int pos = activenvp->calcSliderPos(dummy);
+            progress = (float)pos / 1000;
+        }
+        gContext->GetLCDDevice()->setChannelProgress(progress);
     }
   
     nextState = kState_None;
@@ -2655,31 +2665,21 @@
 
 void TV::UpdateLCD(void)
 {
-/*
-    if (internalState == kState_WatchingLiveTV)
-    {
-        QString title, subtitle, callsign, dummy;
-        GetChannelInfo(recorder, title, subtitle, dummy, dummy, dummy, dummy, callsign, dummy, dummy, dummy, dummy, dummy, dummy);
-        if ((callsign != lcdCallsign) || (title != lcdTitle) || (subtitle != lcdSubtitle))
-        {
-            gContext->GetLCDDevice()->switchToChannel(callsign, title, subtitle);
-            lcdCallsign = callsign;
-            lcdTitle = title;
-            lcdSubtitle = subtitle;
-        }
-    }
+    // Make sure the LCD information gets updated shortly
+    lcdUpdate = 0;
+}
 
-    float progress = 0.0;
-    if (activenvp)
+void TV::ShowLCDChannelInfo(void)
+{
+    QString title, subtitle, callsign, dummy;
+    GetChannelInfo(recorder, title, subtitle, dummy, dummy, dummy, dummy, callsign, dummy, dummy, dummy, dummy, dummy, dummy);
+    if ((callsign != lcdCallsign) || (title != lcdTitle) || (subtitle != lcdSubtitle))
     {
-        QString dummy;
-        int pos = activenvp->calcSliderPos(dummy);
-        progress = (float)pos / 1000;
+        gContext->GetLCDDevice()->switchToChannel(callsign, title, subtitle);
+        lcdCallsign = callsign;
+        lcdTitle = title;
+        lcdSubtitle = subtitle;
     }
-    gContext->GetLCDDevice()->setChannelProgress(progress);
-
-    lcdTimer->start(kLCDTimeout, true);
-*/
 }
 
 void TV::GetNextProgram(RemoteEncoder *enc, int direction,
Index: libs/libmythtv/tv_play.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.h,v
retrieving revision 1.75
diff -u -d -r1.75 tv_play.h
--- libs/libmythtv/tv_play.h	1 Jul 2004 17:28:37 -0000	1.75
+++ libs/libmythtv/tv_play.h	1 Aug 2004 12:28:26 -0000
@@ -101,7 +101,6 @@
     void SleepEndTimer(void);
     void TreeMenuEntered(OSDListTreeType *tree, OSDGenericTree *item);
     void TreeMenuSelected(OSDListTreeType *tree, OSDGenericTree *item);
-    void UpdateLCD(void);
 
   protected:
     void doLoadMenu(void);
@@ -199,6 +198,9 @@
     void BuildOSDTreeMenu(void);
     void ShowOSDTreeMenu(void);
 
+    void UpdateLCD(void);
+    void ShowLCDChannelInfo(void);
+
     int osd_display_time;
 
     bool arrowAccel;
@@ -322,7 +324,7 @@
 
     char vbimode;
 
-    QTimer *lcdTimer;
+    long lcdUpdate;
     QString lcdTitle, lcdSubtitle, lcdCallsign;
     
     QString baseFilters;



More information about the mythtv-dev mailing list