From a7136cf5186808c474365953f166665416a7083d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 21 Oct 2001 14:29:03 +0200 Subject: [PATCH] Pressing the 'Back' button while replaying a DVD now leads to the DVD menu --- HISTORY | 1 + menu.c | 12 +++++++++--- menu.h | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index d56af941..5087c9ef 100644 --- a/HISTORY +++ b/HISTORY @@ -829,3 +829,4 @@ Video Disk Recorder Revision History - Fixed reading timers.conf and channels.conf that contain blanks after numeric values. - Fixed handling trick modes near the beginning and end of a recording. +- Pressing the "Back" button while replaying a DVD now leads to the DVD menu. diff --git a/menu.c b/menu.c index c36d3df1..0242d91f 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.130 2001/10/20 11:16:56 kls Exp $ + * $Id: menu.c 1.131 2001/10/21 14:28:14 kls Exp $ */ #include "menu.h" @@ -1636,11 +1636,12 @@ cMenuDVD::cMenuDVD(void) dvd->Open(); ifo_handle_t *vmg = dvd->openVMG(); if (vmg) { + int lastTitleID = cReplayControl::LastTitleID(); dsyslog(LOG_INFO, "DVD: vmg: %p", vmg);//XXX tt_srpt_t *tt_srpt = vmg->tt_srpt; dsyslog(LOG_INFO, "DVD: tt_srpt: %p", tt_srpt);//XXX for (int i = 0; i < tt_srpt->nr_of_srpts; i++) - Add(new cMenuDVDItem(i, tt_srpt->title[i].nr_of_ptts)); + Add(new cMenuDVDItem(i, tt_srpt->title[i].nr_of_ptts), i == lastTitleID); } } SetHelp(tr("Play"), NULL, NULL, NULL); @@ -2382,6 +2383,11 @@ void cReplayControl::SetDVD(cDVD *DVD, int Title)//XXX dvd = DVD; titleid = Title; } + +int cReplayControl::LastTitleID(void) +{ + return titleid; +} #endif //DVDSUPPORT const char *cReplayControl::LastReplayed(void) @@ -2748,7 +2754,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key) else Show(); break; - case kBack: return osRecordings; + case kBack: return fileName ? osRecordings : osDVD; default: return osUnknown; } } diff --git a/menu.h b/menu.h index 710decf2..b41a935b 100644 --- a/menu.h +++ b/menu.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.h 1.32 2001/10/20 11:15:26 kls Exp $ + * $Id: menu.h 1.33 2001/10/21 14:26:01 kls Exp $ */ #ifndef _MENU_H @@ -133,6 +133,7 @@ public: static void SetRecording(const char *FileName, const char *Title); #ifdef DVDSUPPORT static void SetDVD(cDVD *DVD, int Title);//XXX + static int LastTitleID(void); #endif //DVDSUPPORT static const char *LastReplayed(void); static void ClearLastReplayed(const char *FileName);