From 16fe4d783f2c5e34f18a329b542624e211e13e72 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 25 Feb 2007 14:14:06 +0100 Subject: [PATCH] Made "Channel entry timeout" a setup parameter --- CONTRIBUTORS | 1 + HISTORY | 5 +++++ MANUAL | 11 ++++++++++- config.c | 5 ++++- config.h | 3 ++- i18n.c | 24 +++++++++++++++++++++++- menu.c | 7 +++---- 7 files changed, 48 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b3c702cb..d1c492f2 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -584,6 +584,7 @@ Helmut Auer for suggesting to reduce the logging for the SVDRP GRAB command for reporting that the shutdown script is given a reboot time in the past if there is a recording going on or about to start, and the user insists in shutting down now + for suggesting to make the channel entry timeout configurable Jeremy Hall for fixing an incomplete initialization of the filter parameters in eit.c diff --git a/HISTORY b/HISTORY index b42ed247..bcc61aad 100644 --- a/HISTORY +++ b/HISTORY @@ -5129,3 +5129,8 @@ Video Disk Recorder Revision History discussion with Reinhard Nissl). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Increased the maximum number of DVB devices to 8 (thanks to Rolf Ahrenberg). +- The new Setup parameter "Channel entry timeout" can be used to customize the time + since the last keypress until a numerically entered channel number is considered + complete, and the channel is switched (suggested by Helmut Auer). Setting this + parameter to 0 turns off the automatic channel switching, and the user will + have to confirm the entry by pressing the "Ok" key. diff --git a/MANUAL b/MANUAL index ce90986c..4f4db682 100644 --- a/MANUAL +++ b/MANUAL @@ -786,9 +786,18 @@ Version 1.4 connection after which the connection is automatically closed. Default is 300, a value of 0 means no timeout. - Zap Timeout = 3 The time (in seconds) until a channel counts as "previous" + Zap timeout = 3 The time (in seconds) until a channel counts as "previous" for switching with '0' + Channel entry timeout = 1000 + The time (in milliseconds) after the last keypress until + a numerically entered channel number is considered + complete, and the channel is switched. Default is 1000, + a value of 0 turns this off, so a numerically entered + channel number then needs to be confirmed with the "Ok" + key. Note that the total maximum is also limited by + the "OSD/Channel info time" parameter. + Initial channel = 0 The number of the channel that shall be tuned to when VDR starts. Default is 0, which means that it will tune to the channel that was on before VDR was stopped. diff --git a/config.c b/config.c index e3e870b1..801fa06a 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.149 2007/02/25 11:27:24 kls Exp $ + * $Id: config.c 1.150 2007/02/25 13:58:45 kls Exp $ */ #include "config.h" @@ -242,6 +242,7 @@ cSetup::cSetup(void) EPGLinger = 0; SVDRPTimeout = 300; ZapTimeout = 3; + ChannelEntryTimeout = 1000; PrimaryLimit = 0; DefaultPriority = 50; DefaultLifetime = 99; @@ -404,6 +405,7 @@ bool cSetup::Parse(const char *Name, const char *Value) else if (!strcasecmp(Name, "EPGLinger")) EPGLinger = atoi(Value); else if (!strcasecmp(Name, "SVDRPTimeout")) SVDRPTimeout = atoi(Value); else if (!strcasecmp(Name, "ZapTimeout")) ZapTimeout = atoi(Value); + else if (!strcasecmp(Name, "ChannelEntryTimeout")) ChannelEntryTimeout= atoi(Value); else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value); else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value); else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value); @@ -473,6 +475,7 @@ bool cSetup::Save(void) Store("EPGLinger", EPGLinger); Store("SVDRPTimeout", SVDRPTimeout); Store("ZapTimeout", ZapTimeout); + Store("ChannelEntryTimeout",ChannelEntryTimeout); Store("PrimaryLimit", PrimaryLimit); Store("DefaultPriority", DefaultPriority); Store("DefaultLifetime", DefaultLifetime); diff --git a/config.h b/config.h index 652c64d2..67ae7a8d 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.286 2007/02/25 11:26:53 kls Exp $ + * $Id: config.h 1.287 2007/02/25 13:58:59 kls Exp $ */ #ifndef __CONFIG_H @@ -225,6 +225,7 @@ public: int EPGLinger; int SVDRPTimeout; int ZapTimeout; + int ChannelEntryTimeout; int PrimaryLimit; int DefaultPriority, DefaultLifetime; int PausePriority, PauseLifetime; diff --git a/i18n.c b/i18n.c index fde2ee77..c7f8d721 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.290 2007/02/25 11:57:25 kls Exp $ + * $Id: i18n.c 1.291 2007/02/25 13:59:28 kls Exp $ * * Translations provided by: * @@ -4646,6 +4646,28 @@ const tI18nPhrase Phrases[] = { "Zap timeout (s)", "Časový limit Zap (s)", }, + { "Setup.Miscellaneous$Channel entry timeout (ms)", + "Zeitlimit für Kanaleingabe (ms)", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, { "Setup.Miscellaneous$Initial channel", "Kanal beim Einschalten", "Privzeti kanal", diff --git a/menu.c b/menu.c index c89a3198..9e76ebed 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.449 2007/02/25 11:28:09 kls Exp $ + * $Id: menu.c 1.450 2007/02/25 14:04:33 kls Exp $ */ #include "menu.h" @@ -2662,6 +2662,7 @@ cMenuSetupMisc::cMenuSetupMisc(void) Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity)); Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (s)"), &data.SVDRPTimeout)); Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Zap timeout (s)"), &data.ZapTimeout)); + 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"))); } @@ -3089,8 +3090,6 @@ static void SetTrackDescriptions(int LiveChannel) // --- cDisplayChannel ------------------------------------------------------- -#define DIRECTCHANNELTIMEOUT 1000 //ms - cDisplayChannel *cDisplayChannel::currentDisplayChannel = NULL; cDisplayChannel::cDisplayChannel(int Number, bool Switched) @@ -3289,7 +3288,7 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key) Refresh(); break; case kNone: - if (number && lastTime.Elapsed() > DIRECTCHANNELTIMEOUT) { + if (number && Setup.ChannelEntryTimeout && int(lastTime.Elapsed()) > Setup.ChannelEntryTimeout) { channel = Channels.GetByNumber(number); if (channel) NewChannel = channel;