Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: how to display information on channel change?



Luca Olivetti wrote:
Klaus Schmidinger wrote:

I have many doubts here:

a) How can I display that the dish is moving and its position without
disrupting the normal osd and without crashing xine?


Try displaying a text message with

Skins.Message(mtInfo, "some text");

This should be displayed in the channel display (if open) or as a separate
message line.

Ideally the (new) channel display should stay open until the dish has
reached the position (so looking at the screen you know why the dish is
moving).
[.....]

Calling Skins.Message() is not thread safe, though. Maybe I need to do something
in that area...

Anyway the problem mentioned above (the display refreshed only every 2
seconds) won't go away, even if it is thread safe :-/
Well, I had to patch vdr to accomplish what I need.
This is not an ideal solution (only one plugin, the first in the chain, can add its message to the channel info osd) but it "works for me(tm)".
I added a method AlterDisplayChannel to cStatus. The method is given the osd with the channel info, so a plugin can add a status message (displayChannel->SetMessage), and, by returning true, it can keep the osd on screen more time.
Hopefully you can take the idea and come up with a better solution to accomplish the same result.
The patch is against vdr-1.3.11.

Bye

--
- Yo también quiero una Europa libre de Patentes de Software -
- I want a Software Patents Free Europe too! And you? -
---------------------------------------------------------------
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es
--- menu.c.orig	2004-06-22 19:17:03.929205392 +0200
+++ menu.c	2004-06-22 21:55:34.157430944 +0200
@@ -2637,6 +2637,7 @@
                      }
     };
   if (time_ms() - lastTime < INFOTIMEOUT) {
+     if (cStatus::MsgAlterDisplayChannel(displayChannel)) lastTime = time_ms();
      if (!number && group < 0 && channel && channel->Number() != cDevice::CurrentChannel())
         Refresh(); // makes sure a channel switch through the SVDRP CHAN command is displayed
      DisplayInfo();
--- status.c.orig	2004-06-22 19:31:04.912356520 +0200
+++ status.c	2004-06-22 19:40:43.091459936 +0200
@@ -100,3 +100,10 @@
   for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
       sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
 }
+
+bool cStatus::MsgAlterDisplayChannel(cSkinDisplayChannel *displayChannel)
+{
+  for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+      if (sm->AlterDisplayChannel(displayChannel)) return true;
+  return false;    
+}
--- status.h.orig	2004-06-22 19:30:58.919267608 +0200
+++ status.h	2004-06-22 19:40:43.582385304 +0200
@@ -59,6 +59,9 @@
                // The OSD displays the single line Text with the current channel information.
   virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
                // The OSD displays the given programme information.
+  virtual bool AlterDisplayChannel(cSkinDisplayChannel *displayChannel) { return false; }
+               // When channel information is on display the plugin can alter
+               // the display and, by returning true, keep it on screen 
 public:
   cStatus(void);
   virtual ~cStatus();
@@ -76,6 +79,7 @@
   static void MsgOsdTextItem(const char *Text,  bool Scroll = false);
   static void MsgOsdChannel(const char *Text);
   static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
+  static bool MsgAlterDisplayChannel(cSkinDisplayChannel *displayChannel);
   };
 
 #endif //__STATUS_H

Attachment: signature.asc
Description: OpenPGP digital signature


Home | Main Index | Thread Index