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

Setup parameter for VideoFormat

This commit is contained in:
Klaus Schmidinger 2001-06-16 14:31:14 +02:00
parent 0af14457e0
commit d3f255e79e
8 changed files with 49 additions and 9 deletions

View File

@ -531,3 +531,5 @@ Video Disk Recorder Revision History
- The compile time switch VFAT has been fixed to recognize the ':' character - The compile time switch VFAT has been fixed to recognize the ':' character
in recording names, too. in recording names, too.
- Setting all PIDs to 0x1FFF before switching channel. - Setting all PIDs to 0x1FFF before switching channel.
- New setup parameter "VideoFormat" to define the aspect ratio of the tv set
in use (4:3 or 16:9).

9
MANUAL
View File

@ -355,6 +355,15 @@ Video Disk Recorder User's Manual
never keep the user from viewing stuff on the primary never keep the user from viewing stuff on the primary
interface. On systems with only one DVB card, timers interface. On systems with only one DVB card, timers
with a priority below PrimaryLimit will never execute. with a priority below PrimaryLimit will never execute.
DefaultPriority = 50 The default Priority and Lifetime values used when
DefaultLifetime = 50 creating a new timer event. A Lifetime value of 99
means that this recording will never be deleted
automatically.
VideoFormat = 0 The video format (or aspect ratio) of the tv set in use.
0 = 4:3
1 = 16:9
* Executing system commands * Executing system commands

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 1.46 2001/06/02 13:57:25 kls Exp $ * $Id: config.c 1.47 2001/06/16 14:06:56 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -756,6 +756,7 @@ cSetup::cSetup(void)
PrimaryLimit = 0; PrimaryLimit = 0;
DefaultPriority = 50; DefaultPriority = 50;
DefaultLifetime = 50; DefaultLifetime = 50;
VideoFormat = VIDEO_FORMAT_4_3;
CurrentChannel = -1; CurrentChannel = -1;
} }
@ -781,6 +782,7 @@ bool cSetup::Parse(char *s)
else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value); else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = 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, "VideoFormat")) VideoFormat = atoi(Value);
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value); else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
else else
return false; return false;
@ -841,6 +843,7 @@ bool cSetup::Save(const char *FileName)
fprintf(f, "PrimaryLimit = %d\n", PrimaryLimit); fprintf(f, "PrimaryLimit = %d\n", PrimaryLimit);
fprintf(f, "DefaultPriority = %d\n", DefaultPriority); fprintf(f, "DefaultPriority = %d\n", DefaultPriority);
fprintf(f, "DefaultLifetime = %d\n", DefaultLifetime); fprintf(f, "DefaultLifetime = %d\n", DefaultLifetime);
fprintf(f, "VideoFormat = %d\n", VideoFormat);
fprintf(f, "CurrentChannel = %d\n", CurrentChannel); fprintf(f, "CurrentChannel = %d\n", CurrentChannel);
f.Close(); f.Close();
isyslog(LOG_INFO, "saved setup to %s", FileName); isyslog(LOG_INFO, "saved setup to %s", FileName);

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 1.48 2001/06/14 08:20:34 kls Exp $ * $Id: config.h 1.49 2001/06/16 14:05:58 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -275,6 +275,7 @@ public:
int SVDRPTimeout; int SVDRPTimeout;
int PrimaryLimit; int PrimaryLimit;
int DefaultPriority, DefaultLifetime; int DefaultPriority, DefaultLifetime;
int VideoFormat;
int CurrentChannel; int CurrentChannel;
cSetup(void); cSetup(void);
bool Load(const char *FileName); bool Load(const char *FileName);

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: dvbapi.c 1.76 2001/06/16 11:36:40 kls Exp $ * $Id: dvbapi.c 1.77 2001/06/16 14:23:28 kls Exp $
*/ */
#include "dvbapi.h" #include "dvbapi.h"
@ -1375,6 +1375,10 @@ cDvbApi::cDvbApi(int n)
fd_dvr = -1; fd_dvr = -1;
// Video format:
SetVideoFormat(Setup.VideoFormat ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3);
// We only check the devices that must be present - the others will be checked before accessing them: // We only check the devices that must be present - the others will be checked before accessing them:
if (((fd_qpskfe >= 0 && fd_sec >= 0) || fd_qamfe >= 0) && fd_demuxv >= 0 && fd_demuxa1 >= 0 && fd_demuxa2 >= 0 && fd_demuxt >= 0) { if (((fd_qpskfe >= 0 && fd_sec >= 0) || fd_qamfe >= 0) && fd_demuxv >= 0 && fd_demuxa1 >= 0 && fd_demuxa2 >= 0 && fd_demuxt >= 0) {
@ -2027,6 +2031,12 @@ void cDvbApi::SetModeNormal(bool FromRecording)
} }
} }
void cDvbApi::SetVideoFormat(videoFormat_t Format)
{
if (fd_video)
CHECK(ioctl(fd_video, VIDEO_SET_FORMAT, Format));
}
bool cDvbApi::SetPid(int fd, dmxPesType_t PesType, dvb_pid_t Pid, dmxOutput_t Output) bool cDvbApi::SetPid(int fd, dmxPesType_t PesType, dvb_pid_t Pid, dmxOutput_t Output)
{ {
if (Pid == 0) { if (Pid == 0) {

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: dvbapi.h 1.38 2001/06/14 14:54:25 kls Exp $ * $Id: dvbapi.h 1.39 2001/06/16 14:21:16 kls Exp $
*/ */
#ifndef __DVBAPI_H #ifndef __DVBAPI_H
@ -173,6 +173,10 @@ public:
void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground); void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground);
void Flush(void); void Flush(void);
// Video format facilities:
void SetVideoFormat(videoFormat_t Format);
// Channel facilities // Channel facilities
private: private:

8
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.18 2001/06/03 12:57:21 kls Exp $ * $Id: i18n.c 1.19 2001/06/16 14:27:10 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>
@ -530,6 +530,12 @@ const tPhrase Phrases[] = {
"", // TODO "", // TODO
"", // TODO "", // TODO
}, },
{ "VideoFormat",
"Video Format",
"", // TODO
"", // TODO
"", // TODO
},
// The days of the week: // The days of the week:
{ "MTWTFSS", { "MTWTFSS",
"MDMDFSS", "MDMDFSS",

13
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.73 2001/06/14 14:55:16 kls Exp $ * $Id: menu.c 1.74 2001/06/16 14:23:02 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -118,21 +118,24 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key)
class cMenuEditBoolItem : public cMenuEditIntItem { class cMenuEditBoolItem : public cMenuEditIntItem {
protected: protected:
const char *falseString, *trueString;
virtual void Set(void); virtual void Set(void);
public: public:
cMenuEditBoolItem(const char *Name, int *Value); cMenuEditBoolItem(const char *Name, int *Value, const char *FalseString = NULL, const char *TrueString = NULL);
}; };
cMenuEditBoolItem::cMenuEditBoolItem(const char *Name, int *Value) cMenuEditBoolItem::cMenuEditBoolItem(const char *Name, int *Value, const char *FalseString, const char *TrueString)
:cMenuEditIntItem(Name, Value, 0, 1) :cMenuEditIntItem(Name, Value, 0, 1)
{ {
falseString = FalseString ? FalseString : tr("no");
trueString = TrueString ? TrueString : tr("yes");
Set(); Set();
} }
void cMenuEditBoolItem::Set(void) void cMenuEditBoolItem::Set(void)
{ {
char buf[16]; char buf[16];
snprintf(buf, sizeof(buf), "%s", *value ? tr("yes") : tr("no")); snprintf(buf, sizeof(buf), "%s", *value ? trueString : falseString);
SetValue(buf); SetValue(buf);
} }
@ -1620,6 +1623,7 @@ void cMenuSetup::Set(void)
Add(new cMenuEditIntItem( tr("PrimaryLimit"), &data.PrimaryLimit, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("PrimaryLimit"), &data.PrimaryLimit, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("DefaultPriority"), &data.DefaultPriority, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("DefaultPriority"), &data.DefaultPriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("DefaultLifetime"), &data.DefaultLifetime, 0, MAXLIFETIME)); Add(new cMenuEditIntItem( tr("DefaultLifetime"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("VideoFormat"), &data.VideoFormat, "4:3", "16:9"));
} }
eOSState cMenuSetup::ProcessKey(eKeys Key) eOSState cMenuSetup::ProcessKey(eKeys Key)
@ -1630,6 +1634,7 @@ eOSState cMenuSetup::ProcessKey(eKeys Key)
switch (Key) { switch (Key) {
case kOk: state = (Setup.PrimaryDVB != data.PrimaryDVB) ? osSwitchDvb : osEnd; case kOk: state = (Setup.PrimaryDVB != data.PrimaryDVB) ? osSwitchDvb : osEnd;
cDvbApi::PrimaryDvbApi->SetUseTSTime(data.SetSystemTime); cDvbApi::PrimaryDvbApi->SetUseTSTime(data.SetSystemTime);
cDvbApi::PrimaryDvbApi->SetVideoFormat(data.VideoFormat ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3);
Setup = data; Setup = data;
Setup.Save(); Setup.Save();
break; break;