mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
In the "Channels" menu the numeric keys now position the cursor to the channel with the given number
This commit is contained in:
parent
02ae3e98d4
commit
739fcc7aff
3
HISTORY
3
HISTORY
@ -4097,3 +4097,6 @@ Video Disk Recorder Revision History
|
|||||||
//#define USE_FADVISE
|
//#define USE_FADVISE
|
||||||
in tools.c.
|
in tools.c.
|
||||||
- Removed unused 'offset' member from cOsdItem.
|
- Removed unused 'offset' member from cOsdItem.
|
||||||
|
- In the "Channels" menu the numeric keys now position the cursor to the channel
|
||||||
|
with the given number (see MANUAL, section "Remote Control Keys", note (3) for
|
||||||
|
details).
|
||||||
|
7
MANUAL
7
MANUAL
@ -74,7 +74,12 @@ Version 1.2
|
|||||||
to "mark" a timer for moving.
|
to "mark" a timer for moving.
|
||||||
(2) See "Processing Recordings" below.
|
(2) See "Processing Recordings" below.
|
||||||
(3) In the "Channels" menu the '0' key switches the sort mode through "by number",
|
(3) In the "Channels" menu the '0' key switches the sort mode through "by number",
|
||||||
"by name" and "by provider".
|
"by name" and "by provider". Other numeric input positions the cursor to
|
||||||
|
the channel with the number entered so far. If there is no channel with that
|
||||||
|
number, nothing happens. While entering a channel number, the '0' key will
|
||||||
|
be treated as part of that number, not as a sort mode toggle. If no numeric
|
||||||
|
key has been pressed for more than one second, the number is reset and '0'
|
||||||
|
functions as sort mode toggle again.
|
||||||
(4) In the "Timers" menu, when on the "Day" item, the '0' key toggles between
|
(4) In the "Timers" menu, when on the "Day" item, the '0' key toggles between
|
||||||
a single shot and a repeating timer. If "Day" indicates a repeating timer,
|
a single shot and a repeating timer. If "Day" indicates a repeating timer,
|
||||||
the keys '1'...'7' can be used to toggle the individual days ('1' is Monday).
|
the keys '1'...'7' can be used to toggle the individual days ('1' is Monday).
|
||||||
|
37
menu.c
37
menu.c
@ -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.384 2006/01/04 14:42:13 kls Exp $
|
* $Id: menu.c 1.385 2006/01/05 13:26:37 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -381,12 +381,17 @@ void cMenuChannelItem::Set(void)
|
|||||||
|
|
||||||
// --- cMenuChannels ---------------------------------------------------------
|
// --- cMenuChannels ---------------------------------------------------------
|
||||||
|
|
||||||
|
#define CHANNELNUMBERTIMEOUT 1000 //ms
|
||||||
|
|
||||||
class cMenuChannels : public cOsdMenu {
|
class cMenuChannels : public cOsdMenu {
|
||||||
private:
|
private:
|
||||||
|
int number;
|
||||||
|
cTimeMs numberTimer;
|
||||||
void Setup(void);
|
void Setup(void);
|
||||||
cChannel *GetChannel(int Index);
|
cChannel *GetChannel(int Index);
|
||||||
void Propagate(void);
|
void Propagate(void);
|
||||||
protected:
|
protected:
|
||||||
|
eOSState Number(eKeys Key);
|
||||||
eOSState Switch(void);
|
eOSState Switch(void);
|
||||||
eOSState Edit(void);
|
eOSState Edit(void);
|
||||||
eOSState New(void);
|
eOSState New(void);
|
||||||
@ -401,6 +406,7 @@ public:
|
|||||||
cMenuChannels::cMenuChannels(void)
|
cMenuChannels::cMenuChannels(void)
|
||||||
:cOsdMenu(tr("Channels"), CHNUMWIDTH)
|
:cOsdMenu(tr("Channels"), CHNUMWIDTH)
|
||||||
{
|
{
|
||||||
|
number = 0;
|
||||||
Setup();
|
Setup();
|
||||||
Channels.IncBeingEdited();
|
Channels.IncBeingEdited();
|
||||||
}
|
}
|
||||||
@ -447,6 +453,30 @@ void cMenuChannels::Propagate(void)
|
|||||||
Channels.SetModified(true);
|
Channels.SetModified(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eOSState cMenuChannels::Number(eKeys Key)
|
||||||
|
{
|
||||||
|
if (HasSubMenu())
|
||||||
|
return osContinue;
|
||||||
|
if (numberTimer.TimedOut())
|
||||||
|
number = 0;
|
||||||
|
if (!number && Key == k0) {
|
||||||
|
cMenuChannelItem::IncSortMode();
|
||||||
|
Setup();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
number = number * 10 + Key - k0;
|
||||||
|
for (cMenuChannelItem *ci = (cMenuChannelItem *)First(); ci; ci = (cMenuChannelItem *)ci->Next()) {
|
||||||
|
if (!ci->Channel()->GroupSep() && ci->Channel()->Number() == number) {
|
||||||
|
SetCurrent(ci);
|
||||||
|
Display();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
numberTimer.Set(CHANNELNUMBERTIMEOUT);
|
||||||
|
}
|
||||||
|
return osContinue;
|
||||||
|
}
|
||||||
|
|
||||||
eOSState cMenuChannels::Switch(void)
|
eOSState cMenuChannels::Switch(void)
|
||||||
{
|
{
|
||||||
if (HasSubMenu())
|
if (HasSubMenu())
|
||||||
@ -531,9 +561,8 @@ eOSState cMenuChannels::ProcessKey(eKeys Key)
|
|||||||
default:
|
default:
|
||||||
if (state == osUnknown) {
|
if (state == osUnknown) {
|
||||||
switch (Key) {
|
switch (Key) {
|
||||||
case k0: cMenuChannelItem::IncSortMode();
|
case k0 ... k9:
|
||||||
Setup();
|
return Number(Key);
|
||||||
break;
|
|
||||||
case kOk: return Switch();
|
case kOk: return Switch();
|
||||||
case kRed: return Edit();
|
case kRed: return Edit();
|
||||||
case kGreen: return New();
|
case kGreen: return New();
|
||||||
|
@ -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: osdbase.c 1.25 2006/01/05 12:42:00 kls Exp $
|
* $Id: osdbase.c 1.26 2006/01/05 13:26:00 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "osdbase.h"
|
#include "osdbase.h"
|
||||||
@ -250,6 +250,8 @@ void cOsdMenu::DisplayCurrent(bool Current)
|
|||||||
|
|
||||||
void cOsdMenu::Clear(void)
|
void cOsdMenu::Clear(void)
|
||||||
{
|
{
|
||||||
|
if (marked >= 0)
|
||||||
|
SetStatus(NULL);
|
||||||
first = 0;
|
first = 0;
|
||||||
current = marked = -1;
|
current = marked = -1;
|
||||||
cList<cOsdItem>::Clear();
|
cList<cOsdItem>::Clear();
|
||||||
@ -453,6 +455,7 @@ eOSState cOsdMenu::ProcessKey(eKeys Key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (Key) {
|
switch (Key) {
|
||||||
|
case k0: return osUnknown;
|
||||||
case k1...k9: return hasHotkeys ? HotKey(Key) : osUnknown;
|
case k1...k9: return hasHotkeys ? HotKey(Key) : osUnknown;
|
||||||
case kUp|k_Repeat:
|
case kUp|k_Repeat:
|
||||||
case kUp: CursorUp(); break;
|
case kUp: CursorUp(); break;
|
||||||
|
Loading…
Reference in New Issue
Block a user