Implemented separate PausePriority and PauseLifetime parameters for the recordings created when pausing live video

This commit is contained in:
Klaus Schmidinger 2003-05-11 14:10:00 +02:00
parent 11df7f8100
commit c6e759f436
10 changed files with 76 additions and 23 deletions

View File

@ -646,3 +646,7 @@ Jonan Santiago <jonan-lists-vdr@callisia.com>
Juri Haberland <juri@koschikode.com>
for his help in keeping 'channels.conf.terr' up to date
Alfred Zastrow <vdr@zastrow4u.de>
for suggesting to implement separate PausePriority and PauseLifetime parameters for
the recordings created when pausing live video

View File

@ -2137,3 +2137,5 @@ Video Disk Recorder Revision History
or the "Back" button during replay.
- Further increased the timeout until an index file is considerd no longer to be
written.
- Implemented separate PausePriority and PauseLifetime parameters for the recordings
created when pausing live video (suggested by Alfred Zastrow).

13
MANUAL
View File

@ -186,10 +186,11 @@ Video Disk Recorder User's Manual
You can start recording the current channel by pressing the "Red" button
in the "VDR" menu. This will create a timer event named "@channelname" that
starts at the current time and records for two hours.
starts at the current time and by default records for 3 hours.
If you want to modify the recording time you need to edit the timer.
Stop instant recording by pressing the "Menu" button and selecting
"Stop Recording", or by disabling the timer.
"Stop Recording", or by disabling the timer. The default priority, lifetime
and recording time can be defined in the "Setup/Recording" menu.
* Pausing live video
@ -201,8 +202,9 @@ Video Disk Recorder User's Manual
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
will use the parameters for "Pause priority" and "Pause lifetime" as defined
in the "Setup/Recording" menu. Recording time will be the same as for
any other instant recording, so by default it will record 3 hours (which
should be enough for any normal broadcast).
* Replaying a Recording
@ -548,6 +550,9 @@ Video Disk Recorder User's Manual
means that this recording will never be deleted
automatically.
Pause priority = 10 The Priority and Lifetime values used when pausing live
Pause lifetime = 1 video.
Use episode name = yes Repeating timers use the EPG's 'Episode name' information
to create recording file names in a hierarchical structure
(for instance to gather all episodes of a series in a

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.113 2003/04/12 09:37:48 kls Exp $
* $Id: config.c 1.114 2003/05/11 13:50:02 kls Exp $
*/
#include "config.h"
@ -266,6 +266,8 @@ cSetup::cSetup(void)
PrimaryLimit = 0;
DefaultPriority = 50;
DefaultLifetime = 50;
PausePriority = 10;
PauseLifetime = 1;
UseSubtitle = 1;
RecordingDirs = 1;
VideoFormat = 0;
@ -415,6 +417,8 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value);
else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value);
else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value);
else if (!strcasecmp(Name, "PausePriority")) PausePriority = atoi(Value);
else if (!strcasecmp(Name, "PauseLifetime")) PauseLifetime = atoi(Value);
else if (!strcasecmp(Name, "UseSubtitle")) UseSubtitle = atoi(Value);
else if (!strcasecmp(Name, "RecordingDirs")) RecordingDirs = atoi(Value);
else if (!strcasecmp(Name, "VideoFormat")) VideoFormat = atoi(Value);
@ -462,6 +466,8 @@ bool cSetup::Save(void)
Store("PrimaryLimit", PrimaryLimit);
Store("DefaultPriority", DefaultPriority);
Store("DefaultLifetime", DefaultLifetime);
Store("PausePriority", PausePriority);
Store("PauseLifetime", PauseLifetime);
Store("UseSubtitle", UseSubtitle);
Store("RecordingDirs", RecordingDirs);
Store("VideoFormat", VideoFormat);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.157 2003/05/11 09:12:01 kls Exp $
* $Id: config.h 1.158 2003/05/11 13:45:44 kls Exp $
*/
#ifndef __CONFIG_H
@ -218,6 +218,7 @@ public:
int SortTimers;
int PrimaryLimit;
int DefaultPriority, DefaultLifetime;
int PausePriority, PauseLifetime;
int UseSubtitle;
int RecordingDirs;
int VideoFormat;

34
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: i18n.c 1.107 2003/05/01 14:10:18 kls Exp $
* $Id: i18n.c 1.108 2003/05/11 13:54:23 kls Exp $
*
* Translations provided by:
*
@ -2222,6 +2222,38 @@ const tI18nPhrase Phrases[] = {
"Prioritate implicita",
"Default priority",
},
{ "Setup.Recording$Pause lifetime (d)",
"Pause Lebensdauer (d)",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.Recording$Pause priority",
"Pause Priorität",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.Recording$Default lifetime (d)",
"Default Lebensdauer (d)",
"Osnovni zivljenski cas (d)",

17
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.242 2003/05/11 12:19:11 kls Exp $
* $Id: menu.c 1.243 2003/05/11 13:58:13 kls Exp $
*/
#include "menu.h"
@ -2188,6 +2188,8 @@ cMenuSetupRecord::cMenuSetupRecord(void)
Add(new cMenuEditIntItem( tr("Setup.Recording$Primary limit"), &data.PrimaryLimit, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default priority"), &data.DefaultPriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default lifetime (d)"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditIntItem( tr("Setup.Recording$Pause priority"), &data.PausePriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Pause lifetime (d)"), &data.PauseLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Use episode name"), &data.UseSubtitle));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Mark instant recording"), &data.MarkInstantRecord));
Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord), tr(FileNameChars)));
@ -2907,7 +2909,7 @@ eOSState cDisplayVolume::ProcessKey(eKeys Key)
// --- cRecordControl --------------------------------------------------------
cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer)
cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause = false)
{
eventInfo = NULL;
instantId = NULL;
@ -2917,7 +2919,7 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer)
if (!device) device = cDevice::PrimaryDevice();//XXX
timer = Timer;
if (!timer) {
timer = new cTimer(true);
timer = new cTimer(true, Pause);
Timers.Add(timer);
Timers.Save();
asprintf(&instantId, cDevice::NumDevices() > 1 ? "%s - %d" : "%s", timer->Channel()->Name(), device->CardIndex() + 1);
@ -3014,14 +3016,15 @@ bool cRecordControl::Process(time_t t)
cRecordControl *cRecordControls::RecordControls[MAXRECORDCONTROLS] = { NULL };
bool cRecordControls::Start(cTimer *Timer)
bool cRecordControls::Start(cTimer *Timer, bool Pause)
{
int ch = Timer ? Timer->Channel()->Number() : cDevice::CurrentChannel();
cChannel *channel = Channels.GetByNumber(ch);
if (channel) {
bool NeedsDetachReceivers = false;
cDevice *device = cDevice::GetDevice(channel, Timer ? Timer->Priority() : Setup.DefaultPriority, &NeedsDetachReceivers);
int Priority = Timer ? Timer->Priority() : Pause ? Setup.PausePriority : Setup.DefaultPriority;
cDevice *device = cDevice::GetDevice(channel, Priority, &NeedsDetachReceivers);
if (device) {
if (NeedsDetachReceivers)
Stop(device);
@ -3031,7 +3034,7 @@ bool cRecordControls::Start(cTimer *Timer)
}
for (int i = 0; i < MAXRECORDCONTROLS; i++) {
if (!RecordControls[i]) {
RecordControls[i] = new cRecordControl(device, Timer);
RecordControls[i] = new cRecordControl(device, Timer, Pause);
return true;
}
}
@ -3087,7 +3090,7 @@ bool cRecordControls::PauseLiveVideo(void)
Interface->Status(tr("Pausing live video..."));
Interface->Flush();
cReplayControl::SetRecording(NULL, NULL); // make sure the new cRecordControl will set cReplayControl::LastReplayed()
if (Start()) {
if (Start(NULL, true)) {
sleep(2); // allow recorded file to fill up enough to start replaying
cReplayControl *rc = new cReplayControl;
cControl::Launch(rc);

6
menu.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 1.54 2003/04/21 13:40:45 kls Exp $
* $Id: menu.h 1.55 2003/05/11 13:43:58 kls Exp $
*/
#ifndef __MENU_H
@ -116,7 +116,7 @@ private:
char *fileName;
bool GetEventInfo(void);
public:
cRecordControl(cDevice *Device, cTimer *Timer = NULL);
cRecordControl(cDevice *Device, cTimer *Timer = NULL, bool Pause = false);
virtual ~cRecordControl();
bool Process(time_t t);
bool Uses(cDevice *Device) { return Device == device; }
@ -131,7 +131,7 @@ class cRecordControls {
private:
static cRecordControl *RecordControls[];
public:
static bool Start(cTimer *Timer = NULL);
static bool Start(cTimer *Timer = NULL, bool Pause = false);
static void Stop(const char *InstantId);
static void Stop(cDevice *Device);
static bool StopPrimary(bool DoIt = false);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: timers.c 1.4 2003/04/27 11:11:45 kls Exp $
* $Id: timers.c 1.5 2003/05/11 13:48:49 kls Exp $
*/
#include "timers.h"
@ -20,7 +20,7 @@
char *cTimer::buffer = NULL;
cTimer::cTimer(bool Instant)
cTimer::cTimer(bool Instant, bool Pause)
{
startTime = stopTime = 0;
recording = pending = false;
@ -35,8 +35,8 @@ cTimer::cTimer(bool Instant)
stop = (stop / 60) * 100 + (stop % 60);
if (stop >= 2400)
stop -= 2400;
priority = Setup.DefaultPriority;
lifetime = Setup.DefaultLifetime;
priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
*file = 0;
firstday = 0;
summary = NULL;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: timers.h 1.4 2003/02/09 12:49:45 kls Exp $
* $Id: timers.h 1.5 2003/05/11 13:35:53 kls Exp $
*/
#ifndef __TIMERS_H
@ -38,7 +38,7 @@ private:
time_t firstday;
char *summary;
public:
cTimer(bool Instant = false);
cTimer(bool Instant = false, bool Pause = false);
cTimer(const cEventInfo *EventInfo);
virtual ~cTimer();
cTimer& operator= (const cTimer &Timer);