summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-04-24 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-04-24 18:00:00 +0200
commit85b8e41e8bb16e4e66561768026456ec5f0ee276 (patch)
treedd52f93f8db69b395ed2170d641a3e9d574ed039 /menu.c
parent37250a0568d5b1d689d5c59f983e9be228ed49c2 (diff)
downloadvdr-patch-lnbsharing-85b8e41e8bb16e4e66561768026456ec5f0ee276.tar.gz
vdr-patch-lnbsharing-85b8e41e8bb16e4e66561768026456ec5f0ee276.tar.bz2
Version 0.04vdr-0.04
- Changed name from 'osm' to 'vdr' to avoid mixups with the 'oms' program that appears to be in use with DVD replay. - Implemented a channel display in the top menu line. - Implemented replay progress display (press "Ok" when replaying to bring it up). - Implemented direct channel selecting by pressing the numeric keys. - Added several 'const' keywords to please stricter compilers. - The repeat function for the remote control no longer adapts dynamically to the timing of the RCU (this sometimes caused the repeat function to kick in too early). - Channel selection is now blocked when recording or replaying. - Improved process handling.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c52
1 files changed, 38 insertions, 14 deletions
diff --git a/menu.c b/menu.c
index 92c0bd3..2a4cfa9 100644
--- a/menu.c
+++ b/menu.c
@@ -1,10 +1,10 @@
/*
* menu.c: The actual menu implementations
*
- * See the main source file 'osm.c' for copyright information and
+ * See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.3 2000/04/15 15:07:36 kls Exp $
+ * $Id: menu.c 1.8 2000/04/24 15:32:11 kls Exp $
*/
#include "menu.h"
@@ -428,7 +428,7 @@ void cMenuEditStrItem::Set(void)
char buf[1000];
if (pos >= 0) {
strncpy(buf, value, pos);
- char *s = value[pos] != ' ' ? value + pos + 1 : "";
+ const char *s = value[pos] != ' ' ? value + pos + 1 : "";
snprintf(buf + pos, sizeof(buf) - pos - 2, "[%c]%s", *(value + pos), s);
SetValue(buf);
}
@@ -915,16 +915,7 @@ cMenuRecordingItem::cMenuRecordingItem(cRecording *Recording)
void cMenuRecordingItem::Set(void)
{
- char *buffer = NULL;
- struct tm *t = localtime(&recording->start);
- asprintf(&buffer, "%02d.%02d.%04d\t%02d:%02d\t%s",
- t->tm_mday,
- t->tm_mon + 1,
- t->tm_year + 1900,
- t->tm_hour,
- t->tm_min,
- recording->name);
- SetText(buffer, false);
+ SetText(recording->Title('\t'));
}
// --- cMenuRecordings -------------------------------------------------------
@@ -957,7 +948,7 @@ eOSState cMenuRecordings::Play(void)
cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
if (ri) {
//XXX what if this recording's file is currently in use???
- if (ri->recording->Play())
+ if (DvbApi.StartReplay(ri->recording->FileName(), ri->recording->Title()))
return osEnd;
}
return osContinue;
@@ -1022,3 +1013,36 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
return state;
}
+// --- cReplayDisplay --------------------------------------------------------
+
+cReplayDisplay::cReplayDisplay(void)
+{
+ Interface.Open(MenuColumns, -3);
+ shown = DvbApi.ShowProgress(true);
+}
+
+cReplayDisplay::~cReplayDisplay()
+{
+ Interface.Close();
+}
+
+eKeys cReplayDisplay::ProcessKey(eKeys Key)
+{
+ if (!DvbApi.Replaying())
+ return kOk; // will turn off replay display
+ shown = DvbApi.ShowProgress(!shown);
+ switch (Key) {
+ case kBegin:
+ case kPause:
+ case kStop:
+ case kSearchBack:
+ case kSearchForward:
+ case kSkipBack:
+ case kSkipForward: break; // will be done in main loop
+ case kMenu: break; // allow direct switching to menu
+ case kOk: break; // switches off replay display
+ default: Key = kNone; // ignore anything not explicitly known here
+ }
+ return Key;
+}
+