1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Combined displaying time search and replay mode

This commit is contained in:
Klaus Schmidinger 2001-09-14 15:10:12 +02:00
parent e425cb9434
commit 1a2c3e1b84
2 changed files with 21 additions and 13 deletions

29
menu.c
View File

@ -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.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" #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; bool Play, Forward;
int Speed; int Speed;
if (dvbApi->GetReplayMode(Play, Forward, Speed)) { if (dvbApi->GetReplayMode(Play, Forward, Speed)) {
@ -2427,15 +2439,10 @@ bool cReplayControl::ShowMode(void)
*p = Speed > 0 ? '1' + Speed - 1 : ' '; *p = Speed > 0 ? '1' + Speed - 1 : ' ';
eDvbFont OldFont = Interface->SetFont(fontFix); eDvbFont OldFont = Interface->SetFont(fontFix);
int w = dvbApi->WidthInCells(buf); DisplayAtBottom(buf);
int d = max(Width() - w, 0) / 2;
Interface->Write(d, -1, buf);
Interface->Flush();
Interface->SetFont(OldFont); Interface->SetFont(OldFont);
return true;
} }
} }
return false;
} }
bool cReplayControl::ShowProgress(bool Initial) bool cReplayControl::ShowProgress(bool Initial)
@ -2496,7 +2503,7 @@ void cReplayControl::TimeSearchDisplay(void)
default: sprintf(buf + len, "--:--"); break; default: sprintf(buf + len, "--:--"); break;
} }
Interface->Write(12, 2, buf); DisplayAtBottom(buf);
} }
void cReplayControl::TimeSearchProcess(eKeys Key) void cReplayControl::TimeSearchProcess(eKeys Key)
@ -2553,7 +2560,7 @@ void cReplayControl::TimeSearchProcess(eKeys Key)
if (timeSearchHide) if (timeSearchHide)
Hide(); Hide();
else else
Interface->Fill(12, 2, Width() - 22, 1, clrBackground); DisplayAtBottom();
ShowMode(); ShowMode();
} }
} }

5
menu.h
View File

@ -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.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 #ifndef _MENU_H
@ -118,7 +118,8 @@ private:
static int titleid;//XXX static int titleid;//XXX
#endif //DVDSUPPORT #endif //DVDSUPPORT
static char *title; static char *title;
bool ShowMode(void); void DisplayAtBottom(const char *s = NULL);
void ShowMode(void);
bool ShowProgress(bool Initial); bool ShowProgress(bool Initial);
void MarkToggle(void); void MarkToggle(void);
void MarkJump(bool Forward); void MarkJump(bool Forward);