[mythtv] patch version 2? of the 6544 additions

Kirby Vandivort kvandivo at ks.uiuc.edu
Mon Sep 29 14:50:08 EDT 2003


OK..  

Another version of the previous patch..  This one pulls out the
isLocal calls so that it is only being done once, removes the
IsBusyRecordingLiveTV call, adds the ending time of the show currently
being recorded, and does the stuff that was previously mentioned as well.

-- 

Kirby Vandivort                      Theoretical and 
Senior Research Programmer            Computational Biophysics 
Email: kvandivo at ks.uiuc.edu          3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/    University of Illinois
Phone: (217) 244-5711                405 N. Mathews Ave
Fax  : (217) 244-6078                Urbana, IL  61801, USA
-------------- next part --------------
Index: programs/mythbackend/mainserver.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/mainserver.cpp,v
retrieving revision 1.82
diff -b -u -2 -r1.82 mainserver.cpp
--- programs/mythbackend/mainserver.cpp	24 Sep 2003 23:40:00 -0000	1.82
+++ programs/mythbackend/mainserver.cpp	29 Sep 2003 18:44:45 -0000
@@ -2321,29 +2350,40 @@
         EncoderLink *elink = iter.data();
 
-        if (elink->isLocal())
+        bool bIsLocal = elink->isLocal();
+
+        if (bIsLocal)
         {
-            os << "Encoder: " << elink->getCardId() << " is local and ";
+            os << "Encoder: " << elink->getCardId() << " is local ";
         }
         else
         {
-            os << "Encoder: " << elink->getCardId() << " is remote and ";
+            os << "Encoder: " << elink->getCardId() << " is remote ";
             if (elink->isConnected())
-                os << "is connected ";
+                os << "(currently connected) ";
             else
-                os << "is not connected ";
+                os << "(currently not connected) ";
         }
 
-        if (elink->IsBusyRecording())
+        if (bIsLocal && (elink->GetState() == kState_WatchingLiveTV))
         {
-            os << "is recording";
-            if (elink->isLocal())
+            os << "and is watching Live TV.\r\n";
+        }
+        else if (elink->IsBusyRecording())
+        {
+            os << "and is recording";
+            if (bIsLocal)
             {
                 ProgramInfo *pi = elink->GetRecording();
-                os << " '" << pi->title << "'";
+                if (pi)
+                {
+                   os << " '" << pi->title << "'.  This recording will end "
+                      << "at " << (pi->endts).toString(timeformat);
+                   delete pi;
+                }
             }
             os << ".\r\n";
         }
         else
-            os << "is not recording.\r\n";
+            os << "and is not recording.\r\n";
 
         os << "<br>\r\n";
@@ -2396,4 +2436,6 @@
     }
 
+    delete sched; sched=0;
+
     os << "<P>Machine Information:\r\n";
     os << "<TABLE WIDTH =100% BGCOLOR=EEEEEE>";
@@ -2424,11 +2466,13 @@
     
     // load average ---------------------
+    double rgdAverages[3];
+    if (-1 != getloadavg(rgdAverages, 3))  // don't bother if the call fails
+    {
     os << "This machine's load average:";
 
-    double rgdAverages[3];
-    getloadavg(rgdAverages, 3);
     os << "<UL><LI>1 Minute: " << rgdAverages[0] << "\r\n";
     os << "<LI>5 Minute: " << rgdAverages[1] << "\r\n";
     os << "<LI>15 Minute: " << rgdAverages[2] << "\r\n</UL>";
+    }
 
     os << "</TD></TR></TABLE>";    // end the machine information table


More information about the mythtv-dev mailing list