Hi,

One small feature I find is missing from vdr is to have the possibility to go from the last channel to the first channel and vice versa when changing channel to next/previous channel in live-tv mode. This is the normal behaviour in most TVs. So I made a small patch for vdr-1.7.11 (can be applied also to vdr-1.6.0) to make this possible with a menu option to enable/disable the feature. Would it be possible to have this feature included in future releases of vdr?


--
Matti
diff -Nur vdr-1.7.11-vanilla/config.c vdr-1.7.11-channeswrap/config.c
--- vdr-1.7.11-vanilla/config.c	2009-12-05 17:30:30.000000000 +0200
+++ vdr-1.7.11-channeswrap/config.c	2010-01-08 23:23:20.000000000 +0200
@@ -299,6 +299,7 @@
   CurrentDolby = 0;
   InitialChannel = 0;
   InitialVolume = -1;
+  ChannelsWrap = 0;
   EmergencyExit = 1;
 }
 
@@ -486,6 +487,7 @@
   else if (!strcasecmp(Name, "CurrentDolby"))        CurrentDolby       = atoi(Value);
   else if (!strcasecmp(Name, "InitialChannel"))      InitialChannel     = atoi(Value);
   else if (!strcasecmp(Name, "InitialVolume"))       InitialVolume      = atoi(Value);
+  else if (!strcasecmp(Name, "ChannelsWrap"))        ChannelsWrap       = atoi(Value);
   else if (!strcasecmp(Name, "EmergencyExit"))       EmergencyExit      = atoi(Value);
   else
      return false;
@@ -578,6 +580,7 @@
   Store("CurrentDolby",       CurrentDolby);
   Store("InitialChannel",     InitialChannel);
   Store("InitialVolume",      InitialVolume);
+  Store("ChannelsWrap",       ChannelsWrap);
   Store("EmergencyExit",      EmergencyExit);
 
   Sort();
diff -Nur vdr-1.7.11-vanilla/config.h vdr-1.7.11-channeswrap/config.h
--- vdr-1.7.11-vanilla/config.h	2009-11-22 21:55:04.000000000 +0200
+++ vdr-1.7.11-channeswrap/config.h	2010-01-08 23:24:34.000000000 +0200
@@ -272,6 +272,7 @@
   int CurrentDolby;
   int InitialChannel;
   int InitialVolume;
+  int ChannelsWrap;
   int EmergencyExit;
   int __EndData__;
   cSetup(void);
diff -Nur vdr-1.7.11-vanilla/menu.c vdr-1.7.11-channeswrap/menu.c
--- vdr-1.7.11-vanilla/menu.c	2009-12-06 13:29:05.000000000 +0200
+++ vdr-1.7.11-channeswrap/menu.c	2010-01-08 23:31:37.000000000 +0200
@@ -2746,6 +2746,7 @@
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Channel entry timeout (ms)"), &data.ChannelEntryTimeout, 0));
   Add(new cMenuEditChanItem(tr("Setup.Miscellaneous$Initial channel"),            &data.InitialChannel, tr("Setup.Miscellaneous$as before")));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Initial volume"),             &data.InitialVolume, -1, 255, tr("Setup.Miscellaneous$as before")));
+  Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Channels wrap"),              &data.ChannelsWrap));
   Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Emergency exit"),             &data.EmergencyExit));
 }
 
@@ -3245,6 +3246,8 @@
   if (Direction) {
      while (Channel) {
            Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
+           if (Setup.ChannelsWrap && !Channel)
+              Channel = Direction > 0 ? Channels.First() : Channels.Last();
            if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, 0, true))
               return Channel;
            }
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to