]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Code cleaning
authorChris Tallon <chris@vomp.tv>
Thu, 17 Jul 2008 19:57:56 +0000 (19:57 +0000)
committerChris Tallon <chris@vomp.tv>
Thu, 17 Jul 2008 19:57:56 +0000 (19:57 +0000)
vdr.cc
vrecordinglist.cc
vremoteconfig.cc
vvideolivetv.cc
vvideorec.cc

diff --git a/vdr.cc b/vdr.cc
index 57ef49246e24af6ad4773cc1e028938332a223ca..6b96c49b6c4aa097ce86d868e3eaa6341dc596f1 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2008 Chris Tallon
 
     This file is part of VOMP.
 
@@ -211,32 +211,12 @@ void VDR::threadMethod()
 
     if (!readSuccess)
     {
-      logger->log("VDR", Log::DEBUG, "Net read timeout");
+      //logger->log("VDR", Log::DEBUG, "Net read timeout");
       if (!tcp->isConnected()) { connectionDied(); return; } // return to stop this thread
     }
       
     // Error or timeout.
 
-    /* This is the simple version of timeout system until I work out how to make it better
-       e.g. different timeout lengths for different requests, a decent keepalive system
-       running in parallel etc etc.
-      
-       Ignore the stream channel
-       Start with lastPacketReceived = 0
-       When a packet comes in, set lastPacketReceived = time(NULL)
-       loop
-       {
-         if last packet is over 20s ago
-         {
-           if lastKAsent is less than 20s ago, continue
-           
-           if lastKAsent = 0, send a KA, continue
-           
-           if lastKAsent is over 20s ago, connection is dead, kill it
-         }
-       }         
-    */
-
     if (!lastKAsent) // have not sent a KA
     {
       if (lastKArecv < (timeNow - 5))
@@ -435,7 +415,7 @@ bool VDR::ed_cb_find(EDReceiver* edr, void* userTag)
 
 VDR_ResponsePacket* VDR::RequestResponse(VDR_RequestPacket* vrp)
 {
-  logger->log("VDR", Log::DEBUG, "RR %lu", vrp->getOpcode());
+  //logger->log("VDR", Log::DEBUG, "RR %lu", vrp->getOpcode());
 
   if (!connected)
   {
@@ -466,7 +446,7 @@ VDR_ResponsePacket* VDR::RequestResponse(VDR_RequestPacket* vrp)
   }
 
   // Sleep and block this thread. The sleep unlocks the mutex
-  logger->log("VDR", Log::DEBUG, "RR sleep");
+  logger->log("VDR", Log::DEBUG, "RR sleep - opcode %lu", vrp->getOpcode());
   edSleepThisReceiver(&vdrpr);
   logger->log("VDR", Log::DEBUG, "RR unsleep");
     
index 363efc5e33c4f5855411d2a1a693cc46a28c55a5..3894c34c31b83db288e9612f4a5bfd4c9d85cc7b 100644 (file)
@@ -392,16 +392,11 @@ int VRecordingList::handleCommand(int command)
     case Remote::DF_DOWN:
     case Remote::DOWN:
     {
-      Log::getInstance()->log("P", Log::DEBUG, "1");
       sl.down();
-      Log::getInstance()->log("P", Log::DEBUG, "1.5");
       sl.draw();
-      Log::getInstance()->log("P", Log::DEBUG, "2");
 
       doShowingBar();
-      Log::getInstance()->log("P", Log::DEBUG, "3");
       boxstack->update(this);
-      Log::getInstance()->log("P", Log::DEBUG, "4");
       return 2;
     }
     case Remote::SKIPBACK:
index 8ff349a2f2bcce724524730a02651e68d5ccd234..8630e6a743f40151416b05cdd59c45ba0097e49a 100644 (file)
@@ -157,33 +157,29 @@ void VRemoteConfig::processMessage(Message* m)
       }
     }
   }
-  
 }
 
-
 void VRemoteConfig::doSave()
 {
-    Message* m = new Message();
-    m->message = Message::CHANGED_REMOTECONTROL;
-    m->to = parent;
-    m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
-    
+  Message* m = new Message();
+  m->message = Message::CHANGED_REMOTECONTROL;
+  m->to = parent;
+  m->parameter = 0;
+  Command::getInstance()->postMessageNoLock(m);
 }
 
-
 int VRemoteConfig::handleCommand(int command)
 {
   if (learnmode)
   {
-      learnmode = false;
-      if (command == Remote::NA_LEARN)
-      {
-          initSelectList(false);
-      }
-      draw();
-      viewman->updateView(this);
-      return 2;
+    learnmode = false;
+    if (command == Remote::NA_LEARN)
+    {
+      initSelectList(false);
+    }
+    draw();
+    viewman->updateView(this);
+    return 2;
   }
   switch(command)
   {
@@ -192,32 +188,25 @@ int VRemoteConfig::handleCommand(int command)
     {
       if (sl.getCurrentOption() != 0)
       {
-          sl.up();
-          sl.setShowSelOption(true);
-          draw();
-          viewman->updateView(this);
-          return 2;
+        sl.up();
+        sl.setShowSelOption(true);
+        draw();
+        viewman->updateView(this);
+        return 2;
       }
       else
       {
-          sl.setShowSelOption(false);
-          return 0; //Control to tab control
+        sl.setShowSelOption(false);
+        return 0; //Control to tab control
       }
     }
     case Remote::DF_DOWN:
     case Remote::DOWN:
     {
-      Log::getInstance()->log("P", Log::DEBUG, "1");
       sl.down();
       sl.setShowSelOption(true);
-      Log::getInstance()->log("P", Log::DEBUG, "1.5");
       draw();
-      Log::getInstance()->log("P", Log::DEBUG, "2");
-
-      
-      Log::getInstance()->log("P", Log::DEBUG, "3");
       viewman->updateView(this);
-      Log::getInstance()->log("P", Log::DEBUG, "4");
       return 2;
     }
     case Remote::SKIPBACK:
index 9f67cb46fdf2fbe471e18361e9248a8cda1c1cb6..f18c33d22baf574676128530d0b0dcec75eaee48 100644 (file)
@@ -131,7 +131,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
   osd.add(&clock);
 
   osdChanNum.setBackgroundColour(osdBack);
-  osdChanNum.setPosition(40, 4);
+  osdChanNum.setPosition(50, 4);
   osdChanNum.setSize((numberWidth*10) + 22, 30); // 10 px = width of number chars in font
   osd.add(&osdChanNum);  
 
@@ -141,7 +141,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
   osd.add(&osdChanName);
   
   boxRed.setBackgroundColour(Colour::RED);
-  boxRed.setPosition(50, 104);
+  boxRed.setPosition(54, 104);
   boxRed.setSize(18, 16);
   osd.add(&boxRed);
 
@@ -161,29 +161,29 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
   osd.add(&boxBlue);  
   
   textRed.setBackgroundColour(osdBack);
-  textRed.setPosition(boxRed.getX()+18, 98);
-  textRed.setSize(120, 30);
+  textRed.setPosition(boxRed.getX2(), 98);
+  textRed.setSize(boxGreen.getX() - boxRed.getX2(), 30);
   textRed.setText(tr("Summary"));
   osd.add(&textRed);  
     
   if (streamType == VDR::VIDEO)
   {
     textGreen.setBackgroundColour(osdBack);
-    textGreen.setPosition(boxGreen.getX()+18, 98);
-    textGreen.setSize(120, 30);
+    textGreen.setPosition(boxGreen.getX2(), 98);
+    textGreen.setSize(boxYellow.getX() - boxGreen.getX2(), 30);
     textGreen.setText(tr("Audio"));
     osd.add(&textGreen);  
   }
     
   textYellow.setBackgroundColour(osdBack);
-  textYellow.setPosition(boxYellow.getX()+18, 98);
-  textYellow.setSize(120, 30);
+  textYellow.setPosition(boxYellow.getX2(), 98);
+  textYellow.setSize(boxBlue.getX() - boxYellow.getX2(), 30);
   textYellow.setText("");
   osd.add(&textYellow);  
     
   textBlue.setBackgroundColour(osdBack);
-  textBlue.setPosition(boxBlue.getX()+18, 98);
-  textBlue.setSize(90, 30);
+  textBlue.setPosition(boxBlue.getX2(), 98);
+  textBlue.setSize(osd.getX2() - boxBlue.getX2(), 30);
   textBlue.setText(tr("EPG"));
   osd.add(&textBlue);  
     
index da60136d4e4b0751bf7bf846d85b83238efe3a21..e9c0b219026e7719b6f4febf607dfb08013eb68b 100644 (file)
@@ -826,9 +826,7 @@ void VVideoRec::removeBar()
   barScanHold = false;
   barVasHold = false;
   rectangle(barRegion, transparent);
-  Log::getInstance()->log("TEMP", Log::DEBUG, "A3");
   boxstack->update(this, &barRegion);
-  Log::getInstance()->log("TEMP", Log::DEBUG, "A4");
 }
 
 void VVideoRec::doSummary()