Mailing List archive

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

[vdr] Re: Feature Request for 1.3 - Zap back to previous



Thomas Keil wrote:
> 
> On Sun, 15 Jun 2003 03:12:00 +0200
> theNoad <theNoad@SoftHome.net> wrote:
> 
> >> now since 1.2 got stable I want to make a feature request for > the future
> > > development branch; an improved "zap back" function.
> > Hi,
> > the following patch adds your requested behavior with a delay of 2secs > before
> > changing the previous channel.
> 
> Wow.
> That was a quick reply!
> 
> Thanks a lot :)

Here's how I've adopted this patch:

--- vdr.c       2003/05/29 12:27:26     1.160
+++ vdr.c       2003/06/15 14:35:05
@@ -57,6 +57,7 @@
 #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
 #define SHUTDOWNWAIT   300 // seconds to wait in user prompt before automatic shutdown
 #define MANUALSTART    600 // seconds the next timer must be in the future to assume manual start
+#define ZAPTIMEOUT       3 // seconds until a channel counts as "previous" for switching with '0'
 
 static int Interrupted = 0;
 
@@ -455,6 +456,8 @@
   int LastChannel = -1;
   int LastTimerChannel = -1;
   int PreviousChannel = cDevice::CurrentChannel();
+  int LastLastChannel = PreviousChannel;
+  time_t LastChannelChanged = time(NULL);
   time_t LastActivity = 0;
   int MaxLatencyTime = 0;
   bool ForceShutdown = false;
@@ -492,9 +495,12 @@
         if (!EITScanner.Active() && cDevice::CurrentChannel() != LastChannel) {
            if (!Menu)
               Menu = Temp = new cDisplayChannel(cDevice::CurrentChannel(), LastChannel > 0);
-           if (LastChannel > 0)
-              PreviousChannel = LastChannel;
            LastChannel = cDevice::CurrentChannel();
+           LastChannelChanged = time(NULL);
+           }
+        if (LastLastChannel != LastChannel && time(NULL) - LastChannelChanged >= ZAPTIMEOUT) {
+           PreviousChannel = LastLastChannel;
+           LastLastChannel = LastChannel;
            }
         // Timers and Recordings:
         if (!Timers.BeingEdited()) {

Please try this to see whether it still works as expected.

Since "theNoad" didn't reveal his/her real name (and I only list real people
in VDR/CONTRIBUTORS) I'm going to give _you_ the credit for suggesting this.
I do believe, though, that somebody has already suggested this earlier, but
I can't remember who. If so, that person might want to come forward and send
me the original message. This is, of course, no big deal, but credits should
always go to who deserves them ;-)

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index