Implemented 'pause live video'

This commit is contained in:
Klaus Schmidinger 2003-04-21 14:57:13 +02:00
parent 33d670f7d7
commit a54427e28d
7 changed files with 95 additions and 16 deletions

View File

@ -2034,7 +2034,7 @@ Video Disk Recorder Revision History
- Fixed handling of Ca parameters with values <= MAXDEVICES, which don't indicate - Fixed handling of Ca parameters with values <= MAXDEVICES, which don't indicate
an actual encrypted channel (thanks to Stefan Huelswitt for reporting this one). an actual encrypted channel (thanks to Stefan Huelswitt for reporting this one).
2003-04-19: Version 1.1.28 2003-04-21: Version 1.1.28
- Using masks in EIT filtering to reduce the number of filters (thanks to Andreas - Using masks in EIT filtering to reduce the number of filters (thanks to Andreas
Schultz). Schultz).
@ -2050,3 +2050,6 @@ Video Disk Recorder Revision History
single card systems! single card systems!
- Enhanced detection of pending user I/O from CAMs to avoid sluggish reaction - Enhanced detection of pending user I/O from CAMs to avoid sluggish reaction
to remote control keypresses. to remote control keypresses.
- Implemented "pause live video". You can now press "Menu/Yellow" or "Pause" on
your remote control while watching live video to start an instant recording
of the current programme and immediately start replaying that recording.

18
MANUAL
View File

@ -19,7 +19,7 @@ Video Disk Recorder User's Manual
Back - Menu off VDR menu VDR menu Discard VDR menu Recordings menu Back - Menu off VDR menu VDR menu Discard VDR menu Recordings menu
Red - Record Edit Edit ABC/abc Play/Commands(2) Jump Red - Record Edit Edit ABC/abc Play/Commands(2) Jump
Green - Language New New Ins/Ovr Rewind Skip -60s Green - Language New New Ins/Ovr Rewind Skip -60s
Yellow - - Delete Delete Delete Delete Skip +60s Yellow - Pause live Delete Delete Delete Delete Skip +60s
Blue - Stop/Resume Mark On/Off(1) - Summary Stop Blue - Stop/Resume Mark On/Off(1) - Summary Stop
0..9 Ch select - - - Numeric inp. Exec cmd(2) Editing 0..9 Ch select - - - Numeric inp. Exec cmd(2) Editing
@ -31,7 +31,7 @@ Video Disk Recorder User's Manual
following functions: following functions:
Play resume normal replay Play resume normal replay
Pause pause replay Pause pause replay or live video
Stop stop replay Stop stop replay
Record instant recording Record instant recording
FastFwd fast forward FastFwd fast forward
@ -191,6 +191,20 @@ Video Disk Recorder User's Manual
Stop instant recording by pressing the "Menu" button and selecting Stop instant recording by pressing the "Menu" button and selecting
"Stop Recording", or by disabling the timer. "Stop Recording", or by disabling the timer.
* Pausing live video
If you want to pause the live programme you are just watching, simple press
"Menu/Yellow" or "Pause" on your remote control. VDR will start an instant
recording of the current channel (just as if you had pressed "Menu/Red" or
"Record") and immediately begin replaying that recording. Replay will be
put into "pause" mode, so you can attend to whatever it was that disturbed
your live viewing session. Once you're back, simply press the "Up" or "Play"
button and you'll be watching the current channel in time shift mode, right
from the point where you left off. The instant recording VDR has started
will use the same parameters for priority, lifetime and recording duration
as any other instant recording, so by default it will record 3 hours (which
should be enough for any normal broadcast).
* Replaying a Recording * Replaying a Recording
All recordings are listed in the "Recordings" menu. Browse through the All recordings are listed in the "Recordings" menu. Browse through the

18
i18n.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: i18n.c 1.105 2003/04/12 09:39:35 kls Exp $ * $Id: i18n.c 1.106 2003/04/21 14:05:17 kls Exp $
* *
* Translations provided by: * Translations provided by:
* *
@ -3411,6 +3411,22 @@ const tI18nPhrase Phrases[] = {
"Caut inregistrari...", "Caut inregistrari...",
"Felvett adások böngészése...", "Felvett adások böngészése...",
}, },
{ "Pausing live video...",
"Live-Signal wird angehalten...",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "This plugin has no setup parameters!", { "This plugin has no setup parameters!",
"Dieses Plugin hat keine Setup-Parameter!", "Dieses Plugin hat keine Setup-Parameter!",
"",// TODO "",// TODO

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.236 2003/04/20 09:21:36 kls Exp $ * $Id: menu.c 1.237 2003/04/21 14:57:13 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2488,7 +2488,7 @@ void cMenuMain::Set(const char *Plugin)
// Color buttons: // Color buttons:
SetHelp(tr("Record"), cDevice::PrimaryDevice()->NumAudioTracks() > 1 ? tr("Language") : NULL, NULL, replaying ? tr("Button$Stop") : cReplayControl::LastReplayed() ? tr("Resume") : NULL); SetHelp(tr("Record"), cDevice::PrimaryDevice()->NumAudioTracks() > 1 ? tr("Language") : NULL, replaying ? NULL : tr("Pause"), replaying ? tr("Button$Stop") : cReplayControl::LastReplayed() ? tr("Resume") : NULL);
Display(); Display();
lastActivity = time(NULL); lastActivity = time(NULL);
} }
@ -2560,6 +2560,9 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
} }
} }
break; break;
case kYellow: if (!HasSubMenu())
state = osPause;
break;
case kBlue: if (!HasSubMenu()) case kBlue: if (!HasSubMenu())
state = replaying ? osStopReplay : cReplayControl::LastReplayed() ? osReplay : osContinue; state = replaying ? osStopReplay : cReplayControl::LastReplayed() ? osReplay : osContinue;
break; break;
@ -2936,6 +2939,8 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer)
if (device->AttachReceiver(recorder)) { if (device->AttachReceiver(recorder)) {
Recording.WriteSummary(); Recording.WriteSummary();
cStatus::MsgRecording(device, Recording.Name()); cStatus::MsgRecording(device, Recording.Name());
if (!Timer && !cReplayControl::LastReplayed()) // an instant recording, maybe from cRecordControls::PauseLiveVideo()
cReplayControl::SetRecording(fileName, Recording.Name());
} }
else else
DELETENULL(recorder); DELETENULL(recorder);
@ -3073,6 +3078,26 @@ bool cRecordControls::StopPrimary(bool DoIt)
return false; return false;
} }
bool cRecordControls::PauseLiveVideo(void)
{
Interface->Open(Setup.OSDwidth, -1);
Interface->Status(tr("Pausing live video..."));
Interface->Flush();
cReplayControl::SetRecording(NULL, NULL); // make sure the new cRecordControl will set cReplayControl::LastReplayed()
if (Start()) {
sleep(2); // allow recorded file to fill up enough to start replaying
cReplayControl *rc = new cReplayControl;
cControl::Launch(rc);
cControl::Attach();
sleep(1); // allow device to replay some frames, so we have a picture
Interface->Close();
rc->ProcessKey(kPause); // pause, allowing replay mode display
return true;
}
Interface->Close();
return false;
}
const char *cRecordControls::GetInstantId(const char *LastInstantId) const char *cRecordControls::GetInstantId(const char *LastInstantId)
{ {
for (int i = 0; i < MAXRECORDCONTROLS; i++) { for (int i = 0; i < MAXRECORDCONTROLS; i++) {

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.53 2003/01/12 14:54:05 kls Exp $ * $Id: menu.h 1.54 2003/04/21 13:40:45 kls Exp $
*/ */
#ifndef __MENU_H #ifndef __MENU_H
@ -135,6 +135,7 @@ public:
static void Stop(const char *InstantId); static void Stop(const char *InstantId);
static void Stop(cDevice *Device); static void Stop(cDevice *Device);
static bool StopPrimary(bool DoIt = false); static bool StopPrimary(bool DoIt = false);
static bool PauseLiveVideo(void);
static const char *GetInstantId(const char *LastInstantId); static const char *GetInstantId(const char *LastInstantId);
static cRecordControl *GetRecordControl(const char *FileName); static cRecordControl *GetRecordControl(const char *FileName);
static void Process(time_t t); static void Process(time_t t);

3
osd.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: osd.h 1.38 2002/12/08 12:21:26 kls Exp $ * $Id: osd.h 1.39 2003/04/21 13:40:45 kls Exp $
*/ */
#ifndef __OSD_H #ifndef __OSD_H
@ -30,6 +30,7 @@ enum eOSState { osUnknown,
osPlugin, osPlugin,
osSetup, osSetup,
osCommands, osCommands,
osPause,
osRecord, osRecord,
osReplay, osReplay,
osStopRecord, osStopRecord,

35
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.149 2003/04/12 13:57:45 kls Exp $ * $Id: vdr.c 1.150 2003/04/21 14:41:41 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -553,6 +553,26 @@ int main(int argc, char *argv[])
cDisplayVolume::Process(key); cDisplayVolume::Process(key);
key = kNone; // nobody else needs to see these keys key = kNone; // nobody else needs to see these keys
break; break;
// Pausing live video:
case kPause:
if (!cControl::Control()) {
DELETENULL(Menu);
Temp = NULL;
if (!cRecordControls::PauseLiveVideo())
Interface->Error(tr("No free DVB device to record!"));
key = kNone; // nobody else needs to see this key
}
break;
// Instant recording:
case kRecord:
if (!cControl::Control()) {
if (cRecordControls::Start())
;//XXX Interface->Info(tr("Recording"));
else
Interface->Error(tr("No free DVB device to record!"));
key = kNone; // nobody else needs to see this key
}
break;
// Power off: // Power off:
case kPower: isyslog("Power button pressed"); case kPower: isyslog("Power button pressed");
DELETENULL(Menu); DELETENULL(Menu);
@ -577,6 +597,12 @@ int main(int argc, char *argv[])
if (state == osUnknown && ISMODELESSKEY(key) && cControl::Control() && Interact != cControl::Control()) if (state == osUnknown && ISMODELESSKEY(key) && cControl::Control() && Interact != cControl::Control())
state = cControl::Control()->ProcessKey(key); state = cControl::Control()->ProcessKey(key);
switch (state) { switch (state) {
case osPause: DELETENULL(Menu);
cControl::Shutdown(); // just in case
Temp = NULL;
if (!cRecordControls::PauseLiveVideo())
Interface->Error(tr("No free DVB device to record!"));
break;
case osRecord: DELETENULL(Menu); case osRecord: DELETENULL(Menu);
Temp = NULL; Temp = NULL;
if (cRecordControls::Start()) if (cRecordControls::Start())
@ -652,13 +678,6 @@ int main(int argc, char *argv[])
break; break;
// Viewing Control: // Viewing Control:
case kOk: LastChannel = -1; break; // forces channel display case kOk: LastChannel = -1; break; // forces channel display
// Instant recording:
case kRecord:
if (cRecordControls::Start())
;//XXX Interface->Info(tr("Recording"));
else
Interface->Error(tr("No free DVB device to record!"));
break;
// Key macros: // Key macros:
case kRed: case kRed:
case kGreen: case kGreen: