1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Improved channel switching in case of numerical input

This commit is contained in:
Klaus Schmidinger 2003-06-13 14:44:31 +02:00
parent 68002f0037
commit bc16b8af53
3 changed files with 23 additions and 1 deletions

View File

@ -525,6 +525,8 @@ Jaakko Hyv
for fixing recording overlapping timers on the same channel in case for fixing recording overlapping timers on the same channel in case
DO_REC_AND_PLAY_ON_PRIMARY_DEVICE and/or DO_MULTIPLE_RECORDINGS is not defined DO_REC_AND_PLAY_ON_PRIMARY_DEVICE and/or DO_MULTIPLE_RECORDINGS is not defined
for fixing the minimum lifespan of deleted recordings for fixing the minimum lifespan of deleted recordings
for suggesting to improve channel switching in case of numerical input by switching
as soon as the channel is unique
Dennis Noordsij <dennis.noordsij@wiral.com> Dennis Noordsij <dennis.noordsij@wiral.com>
for reporting a small glitch when switching channels for reporting a small glitch when switching channels

View File

@ -2258,3 +2258,5 @@ Video Disk Recorder Revision History
- Fixed a bug in channel switching after Left/Right has been pressed (thanks to - Fixed a bug in channel switching after Left/Right has been pressed (thanks to
Michael Walle for reporting this one). Michael Walle for reporting this one).
- Improved channel switching in case of numerical input by switching as soon as
the channel is unique (suggested by Jaakko Hyvätti).

20
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.257 2003/06/12 16:11:32 kls Exp $ * $Id: menu.c 1.258 2003/06/13 14:31:15 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2742,6 +2742,24 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key)
cChannel *channel = Channels.GetByNumber(number); cChannel *channel = Channels.GetByNumber(number);
DisplayChannel(channel); DisplayChannel(channel);
lastTime = time_ms(); lastTime = time_ms();
// Lets see if there can be any useful further input:
int n = channel ? number : 0;
while (channel && (channel = Channels.Next(channel)) != NULL) {
if (!channel->GroupSep()) {
if (channel->Number() > n)
n *= 10;
if (n <= channel->Number() && channel->Number() <= n + 9) {
n = 0;
break;
}
}
}
if (n > 0) {
// This channel is the only one that fits the input, so let's take it right away:
Interface->Flush(); // makes sure the user sees his last input
Channels.SwitchTo(number);
return osEnd;
}
} }
} }
break; break;