Implemented the setup option "Recording/Record key handling"

This commit is contained in:
Klaus Schmidinger 2015-09-11 08:29:41 +02:00
parent 4e46d2bb3b
commit f1bef11f45
7 changed files with 37 additions and 12 deletions

View File

@ -3357,6 +3357,7 @@ Dietmar Spingler <d_spingler@gmx.de>
for suggesting to add the channel name to log messages that reference a channel for suggesting to add the channel name to log messages that reference a channel
for suggesting to provide a way of using no DVB devices at all for suggesting to provide a way of using no DVB devices at all
for suggesting that the -V and -h options should list the plugins in alphabetical order for suggesting that the -V and -h options should list the plugins in alphabetical order
for suggesting to implement the setup option "Recording/Record key handling"
Stefan Schallenberg <infos@nafets.de> Stefan Schallenberg <infos@nafets.de>
for adding the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement() for adding the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement()

View File

@ -8596,7 +8596,7 @@ Video Disk Recorder Revision History
- Bumped all version numbers to 2.2.0. - Bumped all version numbers to 2.2.0.
- Official release. - Official release.
2015-09-10: Version 2.3.1 2015-09-11: Version 2.3.1
- The new function cOsd::MaxPixmapSize() can be called to determine the maximum size - The new function cOsd::MaxPixmapSize() can be called to determine the maximum size
a cPixmap may have on the current OSD. The 'osddemo' example has been modified a cPixmap may have on the current OSD. The 'osddemo' example has been modified
@ -8820,3 +8820,6 @@ Video Disk Recorder Revision History
"DVB SI table strings" instead of "EPG data". "DVB SI table strings" instead of "EPG data".
- The width and height of the OSD are now limited to the actual maximum dimensions - The width and height of the OSD are now limited to the actual maximum dimensions
of the output device, taking into account the top and left offset. of the output device, taking into account the top and left offset.
- The new setup option "Recording/Record key handling" can be used to define
what happens if the Record key on the remote control is pressed during
live tv (suggested by Dietmar Spingler).

12
MANUAL
View File

@ -890,8 +890,13 @@ Version 2.2
means that this recording will never be deleted means that this recording will never be deleted
automatically. automatically.
Pause priority = 10 The Priority and Lifetime values used when pausing live Record key handling = 2
Pause lifetime = 1 video. Defines what happens if the Record key on the remote control
is pressed during live tv.
0 = no instant recording
1 = confirm instant recording
2 = record instantly
The default is 2.
Pause key handling = 2 Defines what happens if the Pause key on the remote control Pause key handling = 2 Defines what happens if the Pause key on the remote control
is pressed during live tv. is pressed during live tv.
@ -900,6 +905,9 @@ Version 2.2
2 = pause live video 2 = pause live video
The default is 2. The default is 2.
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 Use episode name = yes Repeating timers use the EPG's 'Episode name' information
to create recording file names in a hierarchical structure to create recording file names in a hierarchical structure
(for instance to gather all episodes of a series in a (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 * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 4.2 2015/09/06 13:17:19 kls Exp $ * $Id: config.c 4.3 2015/09/11 08:08:05 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -421,6 +421,7 @@ cSetup::cSetup(void)
RcRepeatDelta = 100; RcRepeatDelta = 100;
DefaultPriority = 50; DefaultPriority = 50;
DefaultLifetime = MAXLIFETIME; DefaultLifetime = MAXLIFETIME;
RecordKeyHandling = 2;
PauseKeyHandling = 2; PauseKeyHandling = 2;
PausePriority = 10; PausePriority = 10;
PauseLifetime = 1; PauseLifetime = 1;
@ -647,6 +648,7 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "RcRepeatDelta")) RcRepeatDelta = atoi(Value); else if (!strcasecmp(Name, "RcRepeatDelta")) RcRepeatDelta = atoi(Value);
else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value); else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value);
else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value); else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value);
else if (!strcasecmp(Name, "RecordKeyHandling")) RecordKeyHandling = atoi(Value);
else if (!strcasecmp(Name, "PauseKeyHandling")) PauseKeyHandling = atoi(Value); else if (!strcasecmp(Name, "PauseKeyHandling")) PauseKeyHandling = atoi(Value);
else if (!strcasecmp(Name, "PausePriority")) PausePriority = atoi(Value); else if (!strcasecmp(Name, "PausePriority")) PausePriority = atoi(Value);
else if (!strcasecmp(Name, "PauseLifetime")) PauseLifetime = atoi(Value); else if (!strcasecmp(Name, "PauseLifetime")) PauseLifetime = atoi(Value);
@ -776,6 +778,7 @@ bool cSetup::Save(void)
Store("RcRepeatDelta", RcRepeatDelta); Store("RcRepeatDelta", RcRepeatDelta);
Store("DefaultPriority", DefaultPriority); Store("DefaultPriority", DefaultPriority);
Store("DefaultLifetime", DefaultLifetime); Store("DefaultLifetime", DefaultLifetime);
Store("RecordKeyHandling", RecordKeyHandling);
Store("PauseKeyHandling", PauseKeyHandling); Store("PauseKeyHandling", PauseKeyHandling);
Store("PausePriority", PausePriority); Store("PausePriority", PausePriority);
Store("PauseLifetime", PauseLifetime); Store("PauseLifetime", PauseLifetime);

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: config.h 4.4 2015/09/06 09:50:13 kls Exp $ * $Id: config.h 4.5 2015/09/11 08:07:34 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -296,8 +296,9 @@ public:
int RcRepeatDelay; int RcRepeatDelay;
int RcRepeatDelta; int RcRepeatDelta;
int DefaultPriority, DefaultLifetime; int DefaultPriority, DefaultLifetime;
int PausePriority, PauseLifetime; int RecordKeyHandling;
int PauseKeyHandling; int PauseKeyHandling;
int PausePriority, PauseLifetime;
int UseSubtitle; int UseSubtitle;
int UseVps; int UseVps;
int VpsMargin; int VpsMargin;

11
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 4.7 2015/09/10 13:29:30 kls Exp $ * $Id: menu.c 4.8 2015/09/11 08:28:51 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -3910,6 +3910,7 @@ eOSState cMenuSetupCAM::ProcessKey(eKeys Key)
class cMenuSetupRecord : public cMenuSetupBase { class cMenuSetupRecord : public cMenuSetupBase {
private: private:
const char *recordKeyHandlingTexts[3];
const char *pauseKeyHandlingTexts[3]; const char *pauseKeyHandlingTexts[3];
const char *delTimeshiftRecTexts[3]; const char *delTimeshiftRecTexts[3];
public: public:
@ -3919,6 +3920,9 @@ public:
cMenuSetupRecord::cMenuSetupRecord(void) cMenuSetupRecord::cMenuSetupRecord(void)
{ {
SetMenuCategory(mcSetupRecord); SetMenuCategory(mcSetupRecord);
recordKeyHandlingTexts[0] = tr("no instant recording");
recordKeyHandlingTexts[1] = tr("confirm instant recording");
recordKeyHandlingTexts[2] = tr("record instantly");
pauseKeyHandlingTexts[0] = tr("do not pause live video"); pauseKeyHandlingTexts[0] = tr("do not pause live video");
pauseKeyHandlingTexts[1] = tr("confirm pause live video"); pauseKeyHandlingTexts[1] = tr("confirm pause live video");
pauseKeyHandlingTexts[2] = tr("pause live video"); pauseKeyHandlingTexts[2] = tr("pause live video");
@ -3930,6 +3934,7 @@ cMenuSetupRecord::cMenuSetupRecord(void)
Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at stop (min)"), &data.MarginStop)); Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at stop (min)"), &data.MarginStop));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default priority"), &data.DefaultPriority, 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$Default lifetime (d)"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditStraItem(tr("Setup.Recording$Record key handling"), &data.RecordKeyHandling, 3, recordKeyHandlingTexts));
Add(new cMenuEditStraItem(tr("Setup.Recording$Pause key handling"), &data.PauseKeyHandling, 3, pauseKeyHandlingTexts)); Add(new cMenuEditStraItem(tr("Setup.Recording$Pause key handling"), &data.PauseKeyHandling, 3, pauseKeyHandlingTexts));
Add(new cMenuEditIntItem( tr("Setup.Recording$Pause priority"), &data.PausePriority, 0, MAXPRIORITY)); 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 cMenuEditIntItem( tr("Setup.Recording$Pause lifetime (d)"), &data.PauseLifetime, 0, MAXLIFETIME));
@ -4305,7 +4310,7 @@ bool cMenuMain::Update(bool Force)
stopReplayItem = NULL; stopReplayItem = NULL;
} }
// Color buttons: // Color buttons:
SetHelp(!replaying ? tr("Button$Record") : NULL, tr("Button$Audio"), replaying || !Setup.PauseKeyHandling ? NULL : tr("Button$Pause"), replaying ? tr("Button$Stop") : cReplayControl::LastReplayed() ? tr("Button$Resume") : tr("Button$Play")); SetHelp(!replaying && Setup.RecordKeyHandling ? tr("Button$Record") : NULL, tr("Button$Audio"), replaying || !Setup.PauseKeyHandling ? NULL : tr("Button$Pause"), replaying ? tr("Button$Stop") : cReplayControl::LastReplayed() ? tr("Button$Resume") : tr("Button$Play"));
result = true; result = true;
} }
@ -4391,7 +4396,7 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
default: switch (Key) { default: switch (Key) {
case kRecord: case kRecord:
case kRed: if (!HadSubMenu) case kRed: if (!HadSubMenu)
state = replaying ? osContinue : osRecord; state = replaying || !Setup.RecordKeyHandling ? osContinue : osRecord;
break; break;
case kGreen: if (!HadSubMenu) { case kGreen: if (!HadSubMenu) {
cRemote::Put(kAudio, true); cRemote::Put(kAudio, true);

10
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.tvdr.de * The project's page is at http://www.tvdr.de
* *
* $Id: vdr.c 4.6 2015/09/08 10:00:46 kls Exp $ * $Id: vdr.c 4.7 2015/09/11 08:02:50 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -1310,8 +1310,12 @@ int main(int argc, char *argv[])
// Instant recording: // Instant recording:
case kRecord: case kRecord:
if (!cControl::Control()) { if (!cControl::Control()) {
if (cRecordControls::Start()) if (Setup.RecordKeyHandling) {
Skins.QueueMessage(mtInfo, tr("Recording started")); if (Setup.RecordKeyHandling > 1 || Interface->Confirm(tr("Start recording?"))) {
if (cRecordControls::Start())
Skins.QueueMessage(mtInfo, tr("Recording started"));
}
}
key = kNone; // nobody else needs to see this key key = kNone; // nobody else needs to see this key
} }
break; break;