From 1a2c3e1b842517671089f4088179335aa33b7831 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 14 Sep 2001 15:10:12 +0200 Subject: Combined displaying time search and replay mode --- menu.c | 29 ++++++++++++++++++----------- menu.h | 5 +++-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/menu.c b/menu.c index 3998d2a5..49897110 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.118 2001/09/14 14:01:21 kls Exp $ + * $Id: menu.c 1.119 2001/09/14 15:10:12 kls Exp $ */ #include "menu.h" @@ -2401,9 +2401,21 @@ void cReplayControl::Hide(void) } } -bool cReplayControl::ShowMode(void) +void cReplayControl::DisplayAtBottom(const char *s) { - if (Setup.ShowReplayMode) { + if (s) { + int w = dvbApi->WidthInCells(s); + int d = max(Width() - w, 0) / 2; + Interface->Write(d, -1, s); + Interface->Flush(); + } + else + Interface->Fill(12, 2, Width() - 22, 1, clrBackground); +} + +void cReplayControl::ShowMode(void) +{ + if (Setup.ShowReplayMode && !timeSearchActive) { bool Play, Forward; int Speed; if (dvbApi->GetReplayMode(Play, Forward, Speed)) { @@ -2427,15 +2439,10 @@ bool cReplayControl::ShowMode(void) *p = Speed > 0 ? '1' + Speed - 1 : ' '; eDvbFont OldFont = Interface->SetFont(fontFix); - int w = dvbApi->WidthInCells(buf); - int d = max(Width() - w, 0) / 2; - Interface->Write(d, -1, buf); - Interface->Flush(); + DisplayAtBottom(buf); Interface->SetFont(OldFont); - return true; } } - return false; } bool cReplayControl::ShowProgress(bool Initial) @@ -2496,7 +2503,7 @@ void cReplayControl::TimeSearchDisplay(void) default: sprintf(buf + len, "--:--"); break; } - Interface->Write(12, 2, buf); + DisplayAtBottom(buf); } void cReplayControl::TimeSearchProcess(eKeys Key) @@ -2553,7 +2560,7 @@ void cReplayControl::TimeSearchProcess(eKeys Key) if (timeSearchHide) Hide(); else - Interface->Fill(12, 2, Width() - 22, 1, clrBackground); + DisplayAtBottom(); ShowMode(); } } diff --git a/menu.h b/menu.h index a03c26f3..bb31c72a 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.27 2001/09/14 13:42:08 kls Exp $ + * $Id: menu.h 1.28 2001/09/14 15:09:49 kls Exp $ */ #ifndef _MENU_H @@ -118,7 +118,8 @@ private: static int titleid;//XXX #endif //DVDSUPPORT static char *title; - bool ShowMode(void); + void DisplayAtBottom(const char *s = NULL); + void ShowMode(void); bool ShowProgress(bool Initial); void MarkToggle(void); void MarkJump(bool Forward); -- cgit v1.2.3