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

Avoiding unnecessary code execution in the replay progress display

This commit is contained in:
Klaus Schmidinger 2001-07-28 13:16:23 +02:00
parent 0f52c4fe33
commit 80d491ec45
4 changed files with 23 additions and 12 deletions

View File

@ -23,6 +23,7 @@ Guido Fiala <gfiala@s.netic.de>
for implementing the SVDRP command 'HITK' for implementing the SVDRP command 'HITK'
for implementing image grabbing for implementing image grabbing
for implementing overlay capabilities (see his 'kvdr' tool at http://www.s.netic.de/gfiala) for implementing overlay capabilities (see his 'kvdr' tool at http://www.s.netic.de/gfiala)
for making the replay progress display avoid unnecessary code execution
Robert Schneider <Robert.Schneider@lotus.com> Robert Schneider <Robert.Schneider@lotus.com>
for implementing EIT support for displaying the current/next info for implementing EIT support for displaying the current/next info

View File

@ -589,3 +589,5 @@ Video Disk Recorder Revision History
- Avoiding audio/video distortions in 'Transfer Mode'. - Avoiding audio/video distortions in 'Transfer Mode'.
- Fixed replaying in case there is no index file. - Fixed replaying in case there is no index file.
- Fixed jumping to an editing mark when replay has been paused. - Fixed jumping to an editing mark when replay has been paused.
- Avoiding unnecessary code execution in the replay progress display (thanks
to Guido Fiala).

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.84 2001/07/27 13:35:03 kls Exp $ * $Id: menu.c 1.85 2001/07/28 13:07:30 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2144,6 +2144,7 @@ cReplayControl::cReplayControl(void)
{ {
dvbApi = cDvbApi::PrimaryDvbApi; dvbApi = cDvbApi::PrimaryDvbApi;
visible = shown = displayFrames = false; visible = shown = displayFrames = false;
lastCurrent = lastTotal = -1;
if (fileName) { if (fileName) {
marks.Load(fileName); marks.Load(fileName);
dvbApi->StartReplay(fileName); dvbApi->StartReplay(fileName);
@ -2204,19 +2205,25 @@ bool cReplayControl::ShowProgress(bool Initial)
if (title) if (title)
Interface->Write(0, 0, title); Interface->Write(0, 0, title);
} }
Interface->Write(-7, 2, IndexToHMSF(Total)); if (Total != lastTotal) {
Interface->Flush(); Interface->Write(-7, 2, IndexToHMSF(Total));
Interface->Flush();
lastTotal = Total;
}
if (Current != lastCurrent) {
#ifdef DEBUG_OSD #ifdef DEBUG_OSD
int p = Width() * Current / Total; int p = Width() * Current / Total;
Interface->Fill(0, 1, p, 1, clrGreen); Interface->Fill(0, 1, p, 1, clrGreen);
Interface->Fill(p, 1, Width() - p, 1, clrWhite); Interface->Fill(p, 1, Width() - p, 1, clrWhite);
#else #else
cProgressBar ProgressBar(Width() * dvbApi->CellWidth(), dvbApi->LineHeight(), Current, Total, marks); cProgressBar ProgressBar(Width() * dvbApi->CellWidth(), dvbApi->LineHeight(), Current, Total, marks);
Interface->SetBitmap(0, dvbApi->LineHeight(), ProgressBar); Interface->SetBitmap(0, dvbApi->LineHeight(), ProgressBar);
Interface->Flush(); Interface->Flush();
#endif #endif
Interface->Write(0, 2, IndexToHMSF(Current, displayFrames)); Interface->Write(0, 2, IndexToHMSF(Current, displayFrames));
Interface->Flush(); Interface->Flush();
lastCurrent = Current;
}
return true; return true;
} }
return false; return false;

3
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.18 2001/02/11 10:30:35 kls Exp $ * $Id: menu.h 1.19 2001/07/28 13:03:39 kls Exp $
*/ */
#ifndef _MENU_H #ifndef _MENU_H
@ -83,6 +83,7 @@ private:
cDvbApi *dvbApi; cDvbApi *dvbApi;
cMarks marks; cMarks marks;
bool visible, shown, displayFrames; bool visible, shown, displayFrames;
int lastCurrent, lastTotal;
void Show(void); void Show(void);
void Hide(void); void Hide(void);
static char *fileName; static char *fileName;