mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Implemented 'Jump' function in replay mode
This commit is contained in:
parent
8e99289b55
commit
8e7c06006f
@ -99,6 +99,7 @@ Stefan Huelswitt <huels@iname.com>
|
|||||||
for fixing the repeat function with LIRC
|
for fixing the repeat function with LIRC
|
||||||
for making the position of the channel display configurable
|
for making the position of the channel display configurable
|
||||||
for making the width and height of the OSD configurable
|
for making the width and height of the OSD configurable
|
||||||
|
for implementing the "Jump" function in replay mode
|
||||||
|
|
||||||
Ulrich Röder <dynamite@efr-net.de>
|
Ulrich Röder <dynamite@efr-net.de>
|
||||||
for pointing out that there are channels that have a symbol rate higher than
|
for pointing out that there are channels that have a symbol rate higher than
|
||||||
|
3
HISTORY
3
HISTORY
@ -642,3 +642,6 @@ Video Disk Recorder Revision History
|
|||||||
See 'vdr --help' for details.
|
See 'vdr --help' for details.
|
||||||
- Making sure the disk is up and running before starting recording (this
|
- Making sure the disk is up and running before starting recording (this
|
||||||
is important for systems that turn off the video disk when it is not used).
|
is important for systems that turn off the video disk when it is not used).
|
||||||
|
- Added the "Jump" function in replay mode (thanks to Stefan Huelswitt).
|
||||||
|
See the description of the "Red" key in MANUAL under "Replay Control" for
|
||||||
|
details.
|
||||||
|
6
MANUAL
6
MANUAL
@ -17,7 +17,7 @@ Video Disk Recorder User's Manual
|
|||||||
Ok Ch display Select Switch Edit Accept Play Progress disp.
|
Ok Ch display Select Switch Edit Accept Play Progress disp.
|
||||||
Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu on
|
Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu on
|
||||||
Back - Menu off Main menu Main menu Discard Main menu Recordings menu
|
Back - Menu off Main menu Main menu Discard Main menu Recordings menu
|
||||||
Red - Record Edit Edit - Play -
|
Red - Record Edit Edit - Play Jump
|
||||||
Green - Language New New - Rewind Skip -60s
|
Green - Language New New - Rewind Skip -60s
|
||||||
Yellow - Eject DVD Delete Delete - Delete Skip +60s
|
Yellow - Eject DVD Delete Delete - Delete Skip +60s
|
||||||
Blue - Resume Mark Mark - Summary Stop
|
Blue - Resume Mark Mark - Summary Stop
|
||||||
@ -172,6 +172,10 @@ Video Disk Recorder User's Manual
|
|||||||
backward at a slower speed; press again to return to pause mode.
|
backward at a slower speed; press again to return to pause mode.
|
||||||
Pressing and holding down the button performs the function until
|
Pressing and holding down the button performs the function until
|
||||||
the button is released again.
|
the button is released again.
|
||||||
|
- Red Jump to a specific location. Enter the time you want to jump to
|
||||||
|
and then press "Left" or "Right" to jump relative to the current
|
||||||
|
position, "Up" to jump to an absolute position, and "Down" to
|
||||||
|
jump and pause at an absolute position.
|
||||||
- Green
|
- Green
|
||||||
Yellow Skips about 60 seconds back or forward.
|
Yellow Skips about 60 seconds back or forward.
|
||||||
Pressing and holding down the button performs the function until
|
Pressing and holding down the button performs the function until
|
||||||
|
4
dvbapi.c
4
dvbapi.c
@ -7,7 +7,7 @@
|
|||||||
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
|
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
|
||||||
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
|
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
|
||||||
*
|
*
|
||||||
* $Id: dvbapi.c 1.104 2001/08/11 10:17:26 kls Exp $
|
* $Id: dvbapi.c 1.105 2001/08/11 12:21:49 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#define DVDDEBUG 1
|
//#define DVDDEBUG 1
|
||||||
@ -57,8 +57,6 @@ extern "C" {
|
|||||||
// The maximum size of a single frame:
|
// The maximum size of a single frame:
|
||||||
#define MAXFRAMESIZE (192*1024)
|
#define MAXFRAMESIZE (192*1024)
|
||||||
|
|
||||||
#define FRAMESPERSEC 25
|
|
||||||
|
|
||||||
// The maximum file size is limited by the range that can be covered
|
// The maximum file size is limited by the range that can be covered
|
||||||
// with 'int'. 4GB might be possible (if the range is considered
|
// with 'int'. 4GB might be possible (if the range is considered
|
||||||
// 'unsigned'), 2GB should be possible (even if the range is considered
|
// 'unsigned'), 2GB should be possible (even if the range is considered
|
||||||
|
4
dvbapi.h
4
dvbapi.h
@ -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: dvbapi.h 1.45 2001/08/10 14:56:40 kls Exp $
|
* $Id: dvbapi.h 1.46 2001/08/11 12:22:01 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DVBAPI_H
|
#ifndef __DVBAPI_H
|
||||||
@ -40,6 +40,8 @@ typedef struct CRect {
|
|||||||
signed short x, y, width, height;
|
signed short x, y, width, height;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define FRAMESPERSEC 25
|
||||||
|
|
||||||
const char *IndexToHMSF(int Index, bool WithFrame = false);
|
const char *IndexToHMSF(int Index, bool WithFrame = false);
|
||||||
// Converts the given index to a string, optionally containing the frame number.
|
// Converts the given index to a string, optionally containing the frame number.
|
||||||
int HMSFToIndex(const char *HMSF);
|
int HMSFToIndex(const char *HMSF);
|
||||||
|
10
i18n.c
10
i18n.c
@ -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: i18n.c 1.30 2001/08/11 08:43:51 kls Exp $
|
* $Id: i18n.c 1.31 2001/08/11 13:22:24 kls Exp $
|
||||||
*
|
*
|
||||||
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
|
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
|
||||||
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
|
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
|
||||||
@ -1113,6 +1113,14 @@ const tPhrase Phrases[] = {
|
|||||||
"bas",
|
"bas",
|
||||||
"", // TODO
|
"", // TODO
|
||||||
},
|
},
|
||||||
|
{ "Jump: ", // note the trailing blank
|
||||||
|
"Springen: ",
|
||||||
|
"", // TODO
|
||||||
|
"", // TODO
|
||||||
|
"", // TODO
|
||||||
|
"", // TODO
|
||||||
|
"", // TODO
|
||||||
|
},
|
||||||
{ " Stop replaying", // note the leading blank!
|
{ " Stop replaying", // note the leading blank!
|
||||||
" Wiedergabe beenden",
|
" Wiedergabe beenden",
|
||||||
" Prekini ponavljanje",
|
" Prekini ponavljanje",
|
||||||
|
100
menu.c
100
menu.c
@ -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.99 2001/08/11 08:43:31 kls Exp $
|
* $Id: menu.c 1.100 2001/08/11 14:30:21 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -2256,6 +2256,7 @@ cReplayControl::cReplayControl(void)
|
|||||||
visible = shown = displayFrames = false;
|
visible = shown = displayFrames = false;
|
||||||
lastCurrent = lastTotal = -1;
|
lastCurrent = lastTotal = -1;
|
||||||
timeoutShow = 0;
|
timeoutShow = 0;
|
||||||
|
timeSearchActive = false;
|
||||||
if (fileName) {
|
if (fileName) {
|
||||||
marks.Load(fileName);
|
marks.Load(fileName);
|
||||||
dvbApi->StartReplay(fileName);
|
dvbApi->StartReplay(fileName);
|
||||||
@ -2360,6 +2361,98 @@ bool cReplayControl::ShowProgress(bool Initial)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cReplayControl::TimeSearchDisplay(void)
|
||||||
|
{
|
||||||
|
char buf[64];
|
||||||
|
int len;
|
||||||
|
|
||||||
|
strcpy(buf, tr("Jump: "));
|
||||||
|
len = strlen(buf);
|
||||||
|
|
||||||
|
switch (timeSearchPos) {
|
||||||
|
case 1: sprintf(buf + len, "%01d-:--", timeSearchHH / 10); break;
|
||||||
|
case 2: sprintf(buf + len, "%02d:--", timeSearchHH); break;
|
||||||
|
case 3: sprintf(buf + len, "%02d:%01d-", timeSearchHH, timeSearchMM / 10); break;
|
||||||
|
case 4: sprintf(buf + len, "%02d:%02d", timeSearchHH, timeSearchMM); break;
|
||||||
|
default: sprintf(buf + len, "--:--"); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface->Write(12, 2, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cReplayControl::TimeSearchProcess(eKeys Key)
|
||||||
|
{
|
||||||
|
int Seconds = timeSearchHH * 3600 + timeSearchMM * 60;
|
||||||
|
switch (Key) {
|
||||||
|
case k0 ... k9:
|
||||||
|
{
|
||||||
|
int n = Key - k0;
|
||||||
|
int s = (lastTotal / FRAMESPERSEC);
|
||||||
|
int m = s / 60 % 60;
|
||||||
|
int h = s / 3600;
|
||||||
|
switch (timeSearchPos) {
|
||||||
|
case 0: if (n * 10 <= h) {
|
||||||
|
timeSearchHH = n * 10;
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kLeft:
|
||||||
|
case kRight:
|
||||||
|
dvbApi->SkipSeconds(Seconds * (Key == kRight ? 1 : -1));
|
||||||
|
timeSearchActive = false;
|
||||||
|
break;
|
||||||
|
case kUp:
|
||||||
|
case kDown:
|
||||||
|
dvbApi->Goto(Seconds * FRAMESPERSEC, Key == kDown);
|
||||||
|
timeSearchActive = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
timeSearchActive = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!timeSearchActive) {
|
||||||
|
if (timeSearchHide)
|
||||||
|
Hide();
|
||||||
|
else
|
||||||
|
Interface->Fill(12, 2, Width() - 22, 1, clrBackground);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cReplayControl::TimeSearch(void)
|
||||||
|
{
|
||||||
|
timeSearchHH = timeSearchMM = timeSearchPos = 0;
|
||||||
|
timeSearchHide = false;
|
||||||
|
if (!visible) {
|
||||||
|
Show();
|
||||||
|
if (visible)
|
||||||
|
timeSearchHide = true;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TimeSearchDisplay();
|
||||||
|
timeSearchActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
void cReplayControl::MarkToggle(void)
|
void cReplayControl::MarkToggle(void)
|
||||||
{
|
{
|
||||||
int Current, Total;
|
int Current, Total;
|
||||||
@ -2456,6 +2549,10 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
|
|||||||
}
|
}
|
||||||
bool DisplayedFrames = displayFrames;
|
bool DisplayedFrames = displayFrames;
|
||||||
displayFrames = false;
|
displayFrames = false;
|
||||||
|
if (timeSearchActive && Key != kNone) {
|
||||||
|
TimeSearchProcess(Key);
|
||||||
|
return osContinue;
|
||||||
|
}
|
||||||
switch (Key) {
|
switch (Key) {
|
||||||
// Positioning:
|
// Positioning:
|
||||||
case kUp: dvbApi->Play(); break;
|
case kUp: dvbApi->Play(); break;
|
||||||
@ -2464,6 +2561,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
|
|||||||
case kLeft: dvbApi->Backward(); break;
|
case kLeft: dvbApi->Backward(); break;
|
||||||
case kRight|k_Release:
|
case kRight|k_Release:
|
||||||
case kRight: dvbApi->Forward(); break;
|
case kRight: dvbApi->Forward(); break;
|
||||||
|
case kRed: TimeSearch(); break;
|
||||||
case kGreen|k_Repeat:
|
case kGreen|k_Repeat:
|
||||||
case kGreen: dvbApi->SkipSeconds(-60); break;
|
case kGreen: dvbApi->SkipSeconds(-60); break;
|
||||||
case kYellow|k_Repeat:
|
case kYellow|k_Repeat:
|
||||||
|
7
menu.h
7
menu.h
@ -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.22 2001/08/05 16:04:58 kls Exp $
|
* $Id: menu.h 1.23 2001/08/11 14:08:50 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MENU_H
|
#ifndef _MENU_H
|
||||||
@ -102,6 +102,11 @@ private:
|
|||||||
bool visible, shown, displayFrames;
|
bool visible, shown, displayFrames;
|
||||||
int lastCurrent, lastTotal;
|
int lastCurrent, lastTotal;
|
||||||
time_t timeoutShow;
|
time_t timeoutShow;
|
||||||
|
bool timeSearchActive, timeSearchHide;
|
||||||
|
int timeSearchHH, timeSearchMM, timeSearchPos;
|
||||||
|
void TimeSearchDisplay(void);
|
||||||
|
void TimeSearchProcess(eKeys Key);
|
||||||
|
void TimeSearch(void);
|
||||||
void Show(int Seconds = 0);
|
void Show(int Seconds = 0);
|
||||||
void Hide(void);
|
void Hide(void);
|
||||||
static char *fileName;
|
static char *fileName;
|
||||||
|
Loading…
Reference in New Issue
Block a user