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

Changed time entry in the 'Jump' command during replay, so that it is filled up from right to left

This commit is contained in:
Klaus Schmidinger 2002-03-31 15:26:18 +02:00
parent cebd81cd60
commit 837ce0a299
3 changed files with 33 additions and 48 deletions

View File

@ -1152,3 +1152,5 @@ Video Disk Recorder Revision History
- Fixed a bug in the 'First day' timer parameter for timers that record over - Fixed a bug in the 'First day' timer parameter for timers that record over
midnight. midnight.
- Added units to Setup parameters. - Added units to Setup parameters.
- Changed time entry in the 'Jump' command during replay, so that it is filled
up from right to left.

69
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.178 2002/03/31 13:39:56 kls Exp $ * $Id: menu.c 1.179 2002/03/31 15:20:47 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -3108,64 +3108,47 @@ bool cReplayControl::ShowProgress(bool Initial)
void cReplayControl::TimeSearchDisplay(void) void cReplayControl::TimeSearchDisplay(void)
{ {
char buf[64]; char buf[64];
int len;
strcpy(buf, tr("Jump: ")); strcpy(buf, tr("Jump: "));
len = strlen(buf); int len = strlen(buf);
char h10 = '0' + (timeSearchTime >> 24);
switch (timeSearchPos) { char h1 = '0' + ((timeSearchTime & 0x00FF0000) >> 16);
case 1: sprintf(buf + len, "%01d-:--", timeSearchHH / 10); break; char m10 = '0' + ((timeSearchTime & 0x0000FF00) >> 8);
case 2: sprintf(buf + len, "%02d:--", timeSearchHH); break; char m1 = '0' + (timeSearchTime & 0x000000FF);
case 3: sprintf(buf + len, "%02d:%01d-", timeSearchHH, timeSearchMM / 10); break; char ch10 = timeSearchPos > 3 ? h10 : '-';
case 4: sprintf(buf + len, "%02d:%02d", timeSearchHH, timeSearchMM); break; char ch1 = timeSearchPos > 2 ? h1 : '-';
default: sprintf(buf + len, "--:--"); break; char cm10 = timeSearchPos > 1 ? m10 : '-';
} char cm1 = timeSearchPos > 0 ? m1 : '-';
sprintf(buf + len, "%c%c:%c%c", ch10, ch1, cm10, cm1);
DisplayAtBottom(buf); DisplayAtBottom(buf);
} }
void cReplayControl::TimeSearchProcess(eKeys Key) void cReplayControl::TimeSearchProcess(eKeys Key)
{ {
int Seconds = timeSearchHH * 3600 + timeSearchMM * 60; #define STAY_SECONDS_OFF_END 10
int Seconds = (timeSearchTime >> 24) * 36000 + ((timeSearchTime & 0x00FF0000) >> 16) * 3600 + ((timeSearchTime & 0x0000FF00) >> 8) * 600 + (timeSearchTime & 0x000000FF) * 60;
int Current = (lastCurrent / FRAMESPERSEC);
int Total = (lastTotal / FRAMESPERSEC);
switch (Key) { switch (Key) {
case k0 ... k9: case k0 ... k9:
{ if (timeSearchPos < 4) {
int n = Key - k0; timeSearchTime <<= 8;
int s = (lastTotal / FRAMESPERSEC); timeSearchTime |= Key - k0;
int m = s / 60 % 60;
int h = s / 3600;
switch (timeSearchPos) {
case 0: if (n * 10 <= h) {
timeSearchHH = n * 10;
timeSearchPos++; timeSearchPos++;
}
break;
case 1: if (timeSearchHH + n <= h) {
timeSearchHH += n;
timeSearchPos++;
}
break;
case 2: if (n <= 5 && timeSearchHH * 60 + n * 10 <= h * 60 + m) {
timeSearchMM += n * 10;
timeSearchPos++;
}
break;
case 3: if (timeSearchHH * 60 + timeSearchMM + n <= h * 60 + m) {
timeSearchMM += n;
timeSearchPos++;
}
break;
}
TimeSearchDisplay(); TimeSearchDisplay();
} }
break; break;
case kLeft: case kLeft:
case kRight: case kRight: {
dvbApi->SkipSeconds(Seconds * (Key == kRight ? 1 : -1)); int dir = (Key == kRight ? 1 : -1);
if (dir > 0)
Seconds = min(Total - Current - STAY_SECONDS_OFF_END, Seconds);
dvbApi->SkipSeconds(Seconds * dir);
timeSearchActive = false; timeSearchActive = false;
}
break; break;
case kUp: case kUp:
case kDown: case kDown:
Seconds = min(Total - STAY_SECONDS_OFF_END, Seconds);
dvbApi->Goto(Seconds * FRAMESPERSEC, Key == kDown); dvbApi->Goto(Seconds * FRAMESPERSEC, Key == kDown);
timeSearchActive = false; timeSearchActive = false;
break; break;
@ -3185,7 +3168,7 @@ void cReplayControl::TimeSearchProcess(eKeys Key)
void cReplayControl::TimeSearch(void) void cReplayControl::TimeSearch(void)
{ {
timeSearchHH = timeSearchMM = timeSearchPos = 0; timeSearchTime = timeSearchPos = 0;
timeSearchHide = false; timeSearchHide = false;
if (modeOnly) if (modeOnly)
Hide(); Hide();

4
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.40 2002/03/16 09:51:10 kls Exp $ * $Id: menu.h 1.41 2002/03/31 13:53:23 kls Exp $
*/ */
#ifndef _MENU_H #ifndef _MENU_H
@ -116,7 +116,7 @@ private:
int lastCurrent, lastTotal; int lastCurrent, lastTotal;
time_t timeoutShow; time_t timeoutShow;
bool timeSearchActive, timeSearchHide; bool timeSearchActive, timeSearchHide;
int timeSearchHH, timeSearchMM, timeSearchPos; int timeSearchTime, timeSearchPos;
void TimeSearchDisplay(void); void TimeSearchDisplay(void);
void TimeSearchProcess(eKeys Key); void TimeSearchProcess(eKeys Key);
void TimeSearch(void); void TimeSearch(void);