summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-10-08 15:08:26 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-10-08 15:08:26 +0200
commit9faf7a51e5d67f06e035705cb6e7420c59724341 (patch)
treefccc7cb90c3222b2fa2495a63426aed5b5e9f504 /menu.c
parenta1a52fe11f95e2a3a182cc374ddc62c52d1dabd3 (diff)
downloadvdr-9faf7a51e5d67f06e035705cb6e7420c59724341.tar.gz
vdr-9faf7a51e5d67f06e035705cb6e7420c59724341.tar.bz2
Pressing 'Back' in replay mode brings up 'Recordings' menu
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/menu.c b/menu.c
index 024349ac..d1cfb8b1 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.33 2000/10/08 12:44:00 kls Exp $
+ * $Id: menu.c 1.34 2000/10/08 14:50:42 kls Exp $
*/
#include "menu.h"
@@ -13,7 +13,6 @@
#include <stdio.h>
#include <string.h>
#include "config.h"
-#include "recording.h"
#define MENUTIMEOUT 120 // seconds
@@ -996,28 +995,19 @@ void cMenuRecordingItem::Set(void)
// --- cMenuRecordings -------------------------------------------------------
-class cMenuRecordings : public cOsdMenu {
-private:
- cRecordings Recordings;
- eOSState Play(void);
- eOSState Del(void);
- eOSState Summary(void);
-public:
- cMenuRecordings(void);
- virtual eOSState ProcessKey(eKeys Key);
- };
-
cMenuRecordings::cMenuRecordings(void)
:cOsdMenu("Recordings", 6, 6)
{
if (Recordings.Load()) {
+ const char *lastReplayed = cReplayControl::LastReplayed();
cRecording *recording = Recordings.First();
while (recording) {
- Add(new cMenuRecordingItem(recording));
+ Add(new cMenuRecordingItem(recording), lastReplayed && strcmp(lastReplayed, recording->FileName()) == 0);
recording = Recordings.Next(recording);
}
}
SetHelp("Play", NULL/*XXX"Resume"*/, "Delete", "Summary");
+ Display();
}
eOSState cMenuRecordings::Play(void)
@@ -1071,6 +1061,7 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key)
case kRed: return Play();
case kYellow: return Del();
case kBlue: return Summary();
+ case kMenu: return osEnd;
default: break;
}
}
@@ -1364,6 +1355,11 @@ void cReplayControl::SetRecording(const char *FileName, const char *Title)
title = Title ? strdup(Title) : NULL;
}
+const char *cReplayControl::LastReplayed(void)
+{
+ return fileName;
+}
+
void cReplayControl::Show(void)
{
if (!visible) {
@@ -1404,6 +1400,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
case kYellow: dvbApi->Skip(60); break;
case kMenu: Hide(); return osMenu; // allow direct switching to menu
case kOk: visible ? Hide() : Show(); break;
+ case kBack: return osRecordings;
default: return osUnknown;
}
return osContinue;