The new setup option "Miscellaneous/Channels wrap" controls whether the current channel wraps around the beginning or end of the channel list when zapping

This commit is contained in:
Klaus Schmidinger
2010-01-17 15:21:28 +01:00
parent b19650251c
commit 27aaf4fc06
31 changed files with 121 additions and 28 deletions

5
menu.c
View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 2.11 2010/01/17 12:08:03 kls Exp $
* $Id: menu.c 2.12 2010/01/17 15:10:07 kls Exp $
*/
#include "menu.h"
@@ -3039,6 +3039,7 @@ cMenuSetupMisc::cMenuSetupMisc(void)
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));
}
@@ -3538,6 +3539,8 @@ cChannel *cDisplayChannel::NextAvailableChannel(cChannel *Channel, int Direction
if (Direction) {
while (Channel) {
Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
if (!Channel && Setup.ChannelsWrap)
Channel = Direction > 0 ? Channels.First() : Channels.Last();
if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, 0, true))
return Channel;
}