On Sat, 2005-09-24 at 19:58 +0100, Paul wrote:
> ----- Original Message ----- 
> From: "Darius Hardy" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Saturday, September 24, 2005 4:54 AM
> Subject: [mythtv] lcdserver patch (Ticket #324)
> 
> 
> > Just got around to adding the patch in ticket #324 for the new
> > mythlcdserver. Got loads of output about SET_GENERIC_PROGRESS not being
> > recognised by the server.
> > 
> > Adding setGenericProgress to lcdserver.cpp (& .h) using the
> > setChannelProgress code seems to have fixed it (well, it did after I
> > remembered to change all occurences of Generic to Progress).
> > 
> > -- 
> > Darius,
> >   She who travels light, forgot something.
> > 
> 
> Yes thanks Darius I hadn't spotted that.  Must not have used any
> progress dialogs during testing which looks like it is the only time
> setGenericProgress is used.
> 
> I'm putting together an updated patch which I'll add to the ticket later.
> 
> Thanks
> 
> Paul
> 
I only noticed because there wasn't a progress bar when starting the
frontend. I'm including a patch that has all the changes I made, didn't
do this earlier because I needed to go to bed ;-)

Includes a change in the VERBOSE line for 'bad float value in
SET_MUSIC_PROGRESS' where you were outputting token[1] instead of
token[2]

-- 
  Darius,
    She who travels light, forgot something.
diff -c ./lcdserver.cpp /net/server/home/darius/mythtv/programs/mythlcdserver/lcdserver.cpp
*** ./lcdserver.cpp	2005-09-23 23:50:17.000000000 퍝
--- /net/server/home/darius/mythtv/programs/mythlcdserver/lcdserver.cpp	2005-09-24 04:14:50.000000000 퍝
***************
*** 210,215 ****
--- 210,219 ----
      {
          setChannelProgress(tokens, socket);
      }
+     else if (tokens[0] == "SET_GENERIC_PROGRESS")
+     {
+         setGenericProgress(tokens, socket);
+     }
      else if (tokens[0] == "UPDATE_LEDS")
      {
          updateLEDs(tokens, socket);
***************
*** 579,585 ****
      if (!bOK)
      {
          VERBOSE(VB_ALL, "LCDServer: bad float value in SET_MUSIC_PROGRESS " 
!                         "command: " << tokens[1]);
          sendMessage(socket, "HUH?");
          return;
      }
--- 583,589 ----
      if (!bOK)
      {
          VERBOSE(VB_ALL, "LCDServer: bad float value in SET_MUSIC_PROGRESS " 
!                         "command: " << tokens[2]);
          sendMessage(socket, "HUH?");
          return;
      }
***************
*** 590,595 ****
--- 594,629 ----
      sendMessage(socket, "OK");
  }
  
+ void LCDServer::setGenericProgress(const QStringList &tokens, QSocket *socket)
+ {
+     if (LCDSERVER_DEBUG)
+         VERBOSE(VB_ALL, "LCDServer: SET_GENERIC_PROGRESS");
+ 
+     QString flat = tokens.join(" ");
+    
+     if (tokens.count() != 2)
+     {
+         VERBOSE(VB_ALL, "LCDServer: bad SET_GENERIC_PROGRESS command: " << flat);
+         sendMessage(socket, "HUH?");
+         return;
+     }
+      
+     bool bOK;
+     float progress = tokens[1].toFloat(&bOK);
+     if (!bOK)
+     {
+         VERBOSE(VB_ALL, "LCDServer: bad float value in SET_GENERIC_PROGRESS " 
+                         "command: " << tokens[1]);
+         sendMessage(socket, "HUH?");
+         return;
+     }
+     
+     if (m_lcd)
+         m_lcd->setGenericProgress(progress);
+         
+     sendMessage(socket, "OK");
+ }
+ 
  void LCDServer::setVolumeLevel(const QStringList &tokens, QSocket *socket)
  {
      if (LCDSERVER_DEBUG)
diff -c ./lcdserver.h /net/server/home/darius/mythtv/programs/mythlcdserver/lcdserver.h
*** ./lcdserver.h	2005-09-23 23:50:17.000000000 퍝
--- /net/server/home/darius/mythtv/programs/mythlcdserver/lcdserver.h	2005-09-24 03:58:37.000000000 퍝
***************
*** 45,50 ****
--- 45,51 ----
      void switchToMenu(const QStringList &tokens, QSocket *socket);
      void setChannelProgress(const QStringList &tokens, QSocket *socket);
      void setMusicProgress(const QStringList &tokens, QSocket *socket);
+     void setGenericProgress(const QStringList &tokens, QSocket *socket);
      void setVolumeLevel(const QStringList &tokens, QSocket *socket);
      void updateLEDs(const QStringList &tokens, QSocket *socket);
      
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to