2000-02-19 13:36:48 +01:00
|
|
|
/*
|
|
|
|
* config.c: Configuration file handling
|
|
|
|
*
|
2000-04-24 09:46:05 +02:00
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
2000-02-19 13:36:48 +01:00
|
|
|
* how to reach the author.
|
|
|
|
*
|
2012-06-17 12:27:07 +02:00
|
|
|
* $Id: config.c 2.26 2012/06/17 12:27:07 kls Exp $
|
2000-02-19 13:36:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdlib.h>
|
2005-09-04 14:48:39 +02:00
|
|
|
#include "device.h"
|
2000-11-11 10:39:27 +01:00
|
|
|
#include "i18n.h"
|
2000-02-19 13:36:48 +01:00
|
|
|
#include "interface.h"
|
2002-05-09 16:26:56 +02:00
|
|
|
#include "plugin.h"
|
2002-06-16 12:57:31 +02:00
|
|
|
#include "recording.h"
|
2000-02-19 13:36:48 +01:00
|
|
|
|
2001-10-20 13:09:38 +02:00
|
|
|
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
|
|
|
|
// format characters in order to allow any number of blanks after a numeric
|
|
|
|
// value!
|
|
|
|
|
2009-06-13 10:26:37 +02:00
|
|
|
#define ChkDoublePlausibility(Variable, Default) { if (Variable < 0.00001) Variable = Default; }
|
|
|
|
|
2008-02-10 14:11:47 +01:00
|
|
|
// --- cSVDRPhost ------------------------------------------------------------
|
2002-02-02 17:20:54 +01:00
|
|
|
|
|
|
|
cSVDRPhost::cSVDRPhost(void)
|
|
|
|
{
|
|
|
|
addr.s_addr = 0;
|
|
|
|
mask = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSVDRPhost::Parse(const char *s)
|
|
|
|
{
|
|
|
|
mask = 0xFFFFFFFF;
|
|
|
|
const char *p = strchr(s, '/');
|
|
|
|
if (p) {
|
|
|
|
char *error = NULL;
|
|
|
|
int m = strtoul(p + 1, &error, 10);
|
2002-09-29 13:40:45 +02:00
|
|
|
if (error && *error && !isspace(*error) || m > 32)
|
2002-02-02 17:20:54 +01:00
|
|
|
return false;
|
|
|
|
*(char *)p = 0; // yes, we know it's 'const' - will be restored!
|
|
|
|
if (m == 0)
|
|
|
|
mask = 0;
|
2006-07-22 11:59:28 +02:00
|
|
|
else {
|
|
|
|
mask <<= (32 - m);
|
|
|
|
mask = htonl(mask);
|
|
|
|
}
|
2002-02-02 17:20:54 +01:00
|
|
|
}
|
|
|
|
int result = inet_aton(s, &addr);
|
|
|
|
if (p)
|
|
|
|
*(char *)p = '/'; // there it is again
|
|
|
|
return result != 0 && (mask != 0 || addr.s_addr == 0);
|
|
|
|
}
|
|
|
|
|
2010-01-17 12:27:01 +01:00
|
|
|
bool cSVDRPhost::IsLocalhost(void)
|
|
|
|
{
|
|
|
|
return addr.s_addr == htonl(INADDR_LOOPBACK);
|
|
|
|
}
|
|
|
|
|
2002-02-02 17:20:54 +01:00
|
|
|
bool cSVDRPhost::Accepts(in_addr_t Address)
|
|
|
|
{
|
2007-06-23 09:43:55 +02:00
|
|
|
return (Address & mask) == (addr.s_addr & mask);
|
2002-02-02 17:20:54 +01:00
|
|
|
}
|
|
|
|
|
2011-12-04 12:45:26 +01:00
|
|
|
// --- cSatCableNumbers ------------------------------------------------------
|
|
|
|
|
|
|
|
cSatCableNumbers::cSatCableNumbers(int Size, const char *s)
|
|
|
|
{
|
|
|
|
size = Size;
|
|
|
|
array = MALLOC(int, size);
|
|
|
|
FromString(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
cSatCableNumbers::~cSatCableNumbers()
|
|
|
|
{
|
|
|
|
free(array);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSatCableNumbers::FromString(const char *s)
|
|
|
|
{
|
|
|
|
char *t;
|
|
|
|
int i = 0;
|
|
|
|
const char *p = s;
|
|
|
|
while (p && *p) {
|
|
|
|
int n = strtol(p, &t, 10);
|
|
|
|
if (t != p) {
|
|
|
|
if (i < size)
|
|
|
|
array[i++] = n;
|
|
|
|
else {
|
|
|
|
esyslog("ERROR: too many sat cable numbers in '%s'", s);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
esyslog("ERROR: invalid sat cable number in '%s'", s);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
p = skipspace(t);
|
|
|
|
}
|
|
|
|
for ( ; i < size; i++)
|
|
|
|
array[i] = 0;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
cString cSatCableNumbers::ToString(void)
|
|
|
|
{
|
|
|
|
cString s("");
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
s = cString::sprintf("%s%d ", *s, array[i]);
|
|
|
|
}
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int cSatCableNumbers::FirstDeviceIndex(int DeviceIndex) const
|
|
|
|
{
|
|
|
|
if (0 <= DeviceIndex && DeviceIndex < size) {
|
|
|
|
if (int CableNr = array[DeviceIndex]) {
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
if (i < DeviceIndex && array[i] == CableNr)
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-01-17 12:08:03 +01:00
|
|
|
// --- cNestedItem -----------------------------------------------------------
|
|
|
|
|
|
|
|
cNestedItem::cNestedItem(const char *Text, bool WithSubItems)
|
|
|
|
{
|
|
|
|
text = strdup(Text ? Text : "");
|
|
|
|
subItems = WithSubItems ? new cList<cNestedItem> : NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cNestedItem::~cNestedItem()
|
|
|
|
{
|
|
|
|
delete subItems;
|
|
|
|
free(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
int cNestedItem::Compare(const cListObject &ListObject) const
|
|
|
|
{
|
|
|
|
return strcasecmp(text, ((cNestedItem *)&ListObject)->text);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cNestedItem::AddSubItem(cNestedItem *Item)
|
|
|
|
{
|
|
|
|
if (!subItems)
|
|
|
|
subItems = new cList<cNestedItem>;
|
|
|
|
if (Item)
|
|
|
|
subItems->Add(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cNestedItem::SetText(const char *Text)
|
|
|
|
{
|
|
|
|
free(text);
|
|
|
|
text = strdup(Text ? Text : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
void cNestedItem::SetSubItems(bool On)
|
|
|
|
{
|
|
|
|
if (On && !subItems)
|
|
|
|
subItems = new cList<cNestedItem>;
|
|
|
|
else if (!On && subItems) {
|
|
|
|
delete subItems;
|
|
|
|
subItems = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// --- cNestedItemList -------------------------------------------------------
|
|
|
|
|
|
|
|
cNestedItemList::cNestedItemList(void)
|
|
|
|
{
|
|
|
|
fileName = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cNestedItemList::~cNestedItemList()
|
|
|
|
{
|
|
|
|
free(fileName);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cNestedItemList::Parse(FILE *f, cList<cNestedItem> *List, int &Line)
|
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
cReadLine ReadLine;
|
|
|
|
while ((s = ReadLine.Read(f)) != NULL) {
|
|
|
|
Line++;
|
|
|
|
char *p = strchr(s, '#');
|
|
|
|
if (p)
|
|
|
|
*p = 0;
|
|
|
|
s = skipspace(stripspace(s));
|
|
|
|
if (!isempty(s)) {
|
2010-01-31 12:59:50 +01:00
|
|
|
p = s + strlen(s) - 1;
|
|
|
|
if (*p == '{') {
|
2010-01-17 12:08:03 +01:00
|
|
|
*p = 0;
|
|
|
|
stripspace(s);
|
|
|
|
cNestedItem *Item = new cNestedItem(s, true);
|
|
|
|
List->Add(Item);
|
|
|
|
if (!Parse(f, Item->SubItems(), Line))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else if (*s == '}')
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
List->Add(new cNestedItem(s));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cNestedItemList::Write(FILE *f, cList<cNestedItem> *List, int Indent)
|
|
|
|
{
|
|
|
|
for (cNestedItem *Item = List->First(); Item; Item = List->Next(Item)) {
|
|
|
|
if (Item->SubItems()) {
|
|
|
|
fprintf(f, "%*s%s {\n", Indent, "", Item->Text());
|
|
|
|
Write(f, Item->SubItems(), Indent + 2);
|
|
|
|
fprintf(f, "%*s}\n", Indent + 2, "");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fprintf(f, "%*s%s\n", Indent, "", Item->Text());
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void cNestedItemList::Clear(void)
|
|
|
|
{
|
|
|
|
free(fileName);
|
|
|
|
fileName = NULL;
|
|
|
|
cList<cNestedItem>::Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cNestedItemList::Load(const char *FileName)
|
|
|
|
{
|
|
|
|
cList<cNestedItem>::Clear();
|
|
|
|
if (FileName) {
|
|
|
|
free(fileName);
|
|
|
|
fileName = strdup(FileName);
|
|
|
|
}
|
|
|
|
bool result = false;
|
|
|
|
if (fileName && access(fileName, F_OK) == 0) {
|
|
|
|
isyslog("loading %s", fileName);
|
|
|
|
FILE *f = fopen(fileName, "r");
|
|
|
|
if (f) {
|
|
|
|
int Line = 0;
|
|
|
|
result = Parse(f, this, Line);
|
|
|
|
fclose(f);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
LOG_ERROR_STR(fileName);
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cNestedItemList::Save(void)
|
|
|
|
{
|
|
|
|
bool result = true;
|
|
|
|
cSafeFile f(fileName);
|
|
|
|
if (f.Open()) {
|
|
|
|
result = Write(f, this);
|
|
|
|
if (!f.Close())
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
result = false;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-01-31 12:59:50 +01:00
|
|
|
// --- Folders and Commands --------------------------------------------------
|
2000-11-11 16:38:41 +01:00
|
|
|
|
2010-01-31 12:59:50 +01:00
|
|
|
cNestedItemList Folders;
|
|
|
|
cNestedItemList Commands;
|
|
|
|
cNestedItemList RecordingCommands;
|
2000-11-11 16:38:41 +01:00
|
|
|
|
2008-02-10 14:11:47 +01:00
|
|
|
// --- cSVDRPhosts -----------------------------------------------------------
|
2002-02-02 17:20:54 +01:00
|
|
|
|
|
|
|
cSVDRPhosts SVDRPhosts;
|
|
|
|
|
2010-01-17 12:27:01 +01:00
|
|
|
bool cSVDRPhosts::LocalhostOnly(void)
|
|
|
|
{
|
|
|
|
cSVDRPhost *h = First();
|
|
|
|
while (h) {
|
|
|
|
if (!h->IsLocalhost())
|
|
|
|
return false;
|
|
|
|
h = (cSVDRPhost *)h->Next();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-02-02 17:20:54 +01:00
|
|
|
bool cSVDRPhosts::Acceptable(in_addr_t Address)
|
|
|
|
{
|
|
|
|
cSVDRPhost *h = First();
|
|
|
|
while (h) {
|
|
|
|
if (h->Accepts(Address))
|
|
|
|
return true;
|
|
|
|
h = (cSVDRPhost *)h->Next();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-02-10 14:11:47 +01:00
|
|
|
// --- cSetupLine ------------------------------------------------------------
|
2002-05-09 16:26:56 +02:00
|
|
|
|
|
|
|
cSetupLine::cSetupLine(void)
|
|
|
|
{
|
|
|
|
plugin = name = value = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cSetupLine::cSetupLine(const char *Name, const char *Value, const char *Plugin)
|
|
|
|
{
|
2012-05-11 11:08:38 +02:00
|
|
|
name = strreplace(strdup(Name), '\n', 0);
|
|
|
|
value = strreplace(strdup(Value), '\n', 0);
|
|
|
|
plugin = Plugin ? strreplace(strdup(Plugin), '\n', 0) : NULL;
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cSetupLine::~cSetupLine()
|
|
|
|
{
|
2002-08-11 13:32:23 +02:00
|
|
|
free(plugin);
|
|
|
|
free(name);
|
|
|
|
free(value);
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
|
2004-11-01 10:40:38 +01:00
|
|
|
int cSetupLine::Compare(const cListObject &ListObject) const
|
2002-05-09 16:26:56 +02:00
|
|
|
{
|
|
|
|
const cSetupLine *sl = (cSetupLine *)&ListObject;
|
|
|
|
if (!plugin && !sl->plugin)
|
2004-11-01 10:40:38 +01:00
|
|
|
return strcasecmp(name, sl->name);
|
2002-05-09 16:26:56 +02:00
|
|
|
if (!plugin)
|
2004-11-01 10:40:38 +01:00
|
|
|
return -1;
|
2002-05-09 16:26:56 +02:00
|
|
|
if (!sl->plugin)
|
2004-11-01 10:40:38 +01:00
|
|
|
return 1;
|
2002-05-09 16:26:56 +02:00
|
|
|
int result = strcasecmp(plugin, sl->plugin);
|
|
|
|
if (result == 0)
|
|
|
|
result = strcasecmp(name, sl->name);
|
2004-11-01 10:40:38 +01:00
|
|
|
return result;
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool cSetupLine::Parse(char *s)
|
|
|
|
{
|
|
|
|
char *p = strchr(s, '=');
|
|
|
|
if (p) {
|
|
|
|
*p = 0;
|
|
|
|
char *Name = compactspace(s);
|
|
|
|
char *Value = compactspace(p + 1);
|
2003-08-24 11:01:42 +02:00
|
|
|
if (*Name) { // value may be an empty string
|
2002-05-09 16:26:56 +02:00
|
|
|
p = strchr(Name, '.');
|
|
|
|
if (p) {
|
|
|
|
*p = 0;
|
|
|
|
char *Plugin = compactspace(Name);
|
|
|
|
Name = compactspace(p + 1);
|
|
|
|
if (!(*Plugin && *Name))
|
|
|
|
return false;
|
|
|
|
plugin = strdup(Plugin);
|
|
|
|
}
|
|
|
|
name = strdup(Name);
|
|
|
|
value = strdup(Value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSetupLine::Save(FILE *f)
|
|
|
|
{
|
|
|
|
return fprintf(f, "%s%s%s = %s\n", plugin ? plugin : "", plugin ? "." : "", name, value) > 0;
|
|
|
|
}
|
|
|
|
|
2008-02-10 14:11:47 +01:00
|
|
|
// --- cSetup ----------------------------------------------------------------
|
2000-09-10 10:51:58 +02:00
|
|
|
|
|
|
|
cSetup Setup;
|
|
|
|
|
|
|
|
cSetup::cSetup(void)
|
|
|
|
{
|
2007-08-12 12:18:23 +02:00
|
|
|
strcpy(OSDLanguage, ""); // default is taken from environment
|
2012-06-04 09:07:51 +02:00
|
|
|
strcpy(OSDSkin, "lcars");
|
2004-05-16 10:35:36 +02:00
|
|
|
strcpy(OSDTheme, "default");
|
2000-09-10 10:51:58 +02:00
|
|
|
PrimaryDVB = 1;
|
|
|
|
ShowInfoOnChSwitch = 1;
|
2006-01-04 14:45:23 +01:00
|
|
|
TimeoutRequChInfo = 1;
|
2000-09-10 10:51:58 +02:00
|
|
|
MenuScrollPage = 1;
|
2005-06-18 10:44:30 +02:00
|
|
|
MenuScrollWrap = 0;
|
2007-02-25 11:39:40 +01:00
|
|
|
MenuKeyCloses = 0;
|
2000-10-08 13:08:13 +02:00
|
|
|
MarkInstantRecord = 1;
|
2002-02-10 11:40:29 +01:00
|
|
|
strcpy(NameInstantRecord, "TITLE EPISODE");
|
2002-04-26 13:43:46 +02:00
|
|
|
InstantRecordTime = 180;
|
2001-06-02 10:47:40 +02:00
|
|
|
LnbSLOF = 11700;
|
2000-10-08 16:18:23 +02:00
|
|
|
LnbFrequLo = 9750;
|
|
|
|
LnbFrequHi = 10600;
|
2001-08-11 08:44:48 +02:00
|
|
|
DiSEqC = 0;
|
2000-10-29 13:17:22 +01:00
|
|
|
SetSystemTime = 0;
|
2004-05-16 12:58:04 +02:00
|
|
|
TimeSource = 0;
|
2002-03-17 14:24:11 +01:00
|
|
|
TimeTransponder = 0;
|
2012-04-15 10:52:34 +02:00
|
|
|
StandardCompliance = STANDARD_DVB;
|
2000-10-29 13:17:22 +01:00
|
|
|
MarginStart = 2;
|
|
|
|
MarginStop = 10;
|
2005-01-05 10:48:22 +01:00
|
|
|
AudioLanguages[0] = -1;
|
2007-10-12 14:52:30 +02:00
|
|
|
DisplaySubtitles = 0;
|
|
|
|
SubtitleLanguages[0] = -1;
|
|
|
|
SubtitleOffset = 0;
|
|
|
|
SubtitleFgTransparency = 0;
|
|
|
|
SubtitleBgTransparency = 0;
|
2004-01-09 15:53:59 +01:00
|
|
|
EPGLanguages[0] = -1;
|
2000-11-18 13:57:32 +01:00
|
|
|
EPGScanTimeout = 5;
|
2005-09-09 15:10:11 +02:00
|
|
|
EPGBugfixLevel = 3;
|
2004-02-21 15:30:35 +01:00
|
|
|
EPGLinger = 0;
|
2001-02-18 14:18:13 +01:00
|
|
|
SVDRPTimeout = 300;
|
2003-08-17 08:58:02 +02:00
|
|
|
ZapTimeout = 3;
|
2007-02-25 14:14:06 +01:00
|
|
|
ChannelEntryTimeout = 1000;
|
2001-06-02 10:47:40 +02:00
|
|
|
DefaultPriority = 50;
|
2012-03-02 10:19:00 +01:00
|
|
|
DefaultLifetime = MAXLIFETIME;
|
2009-05-21 11:35:37 +02:00
|
|
|
PauseKeyHandling = 2;
|
2003-05-11 14:10:00 +02:00
|
|
|
PausePriority = 10;
|
|
|
|
PauseLifetime = 1;
|
2001-09-02 15:21:54 +02:00
|
|
|
UseSubtitle = 1;
|
2004-02-29 14:21:22 +01:00
|
|
|
UseVps = 0;
|
|
|
|
VpsMargin = 120;
|
2002-01-20 14:05:28 +01:00
|
|
|
RecordingDirs = 1;
|
2010-03-12 16:46:45 +01:00
|
|
|
FoldersInTimerMenu = 1;
|
2010-06-06 10:56:11 +02:00
|
|
|
NumberKeysForChars = 1;
|
2005-02-20 13:39:49 +01:00
|
|
|
VideoDisplayFormat = 1;
|
2002-08-04 14:57:29 +02:00
|
|
|
VideoFormat = 0;
|
2006-04-15 14:18:25 +02:00
|
|
|
UpdateChannels = 5;
|
2005-01-09 12:36:48 +01:00
|
|
|
UseDolbyDigital = 1;
|
2001-07-27 10:59:50 +02:00
|
|
|
ChannelInfoPos = 0;
|
2005-02-05 11:40:04 +01:00
|
|
|
ChannelInfoTime = 5;
|
2012-06-04 09:18:51 +02:00
|
|
|
OSDLeftP = 0.03;
|
|
|
|
OSDTopP = 0.03;
|
|
|
|
OSDWidthP = 0.93;
|
|
|
|
OSDHeightP = 0.93;
|
2004-05-16 10:35:36 +02:00
|
|
|
OSDLeft = 54;
|
|
|
|
OSDTop = 45;
|
|
|
|
OSDWidth = 624;
|
|
|
|
OSDHeight = 486;
|
2009-05-09 10:42:35 +02:00
|
|
|
OSDAspect = 1.0;
|
2001-09-01 15:23:27 +02:00
|
|
|
OSDMessageTime = 1;
|
2004-05-16 10:35:36 +02:00
|
|
|
UseSmallFont = 1;
|
2007-06-10 13:02:43 +02:00
|
|
|
AntiAlias = 1;
|
2007-06-17 11:54:54 +02:00
|
|
|
strcpy(FontOsd, DefaultFontOsd);
|
|
|
|
strcpy(FontSml, DefaultFontSml);
|
|
|
|
strcpy(FontFix, DefaultFontFix);
|
2012-06-13 09:12:53 +02:00
|
|
|
FontOsdSizeP = 0.031;
|
2012-06-04 09:18:51 +02:00
|
|
|
FontSmlSizeP = 0.028;
|
2012-06-13 09:12:53 +02:00
|
|
|
FontFixSizeP = 0.030;
|
2007-06-10 13:02:43 +02:00
|
|
|
FontOsdSize = 22;
|
|
|
|
FontSmlSize = 18;
|
|
|
|
FontFixSize = 20;
|
2009-01-24 15:24:19 +01:00
|
|
|
MaxVideoFileSize = MAXVIDEOFILESIZEDEFAULT;
|
2001-09-30 11:31:43 +02:00
|
|
|
SplitEditedFiles = 0;
|
2010-03-07 12:43:30 +01:00
|
|
|
DelTimeshiftRec = 0;
|
2001-09-07 15:37:26 +02:00
|
|
|
MinEventTimeout = 30;
|
2005-08-13 13:48:46 +02:00
|
|
|
MinUserInactivity = 300;
|
2007-02-25 10:56:29 +01:00
|
|
|
NextWakeupTime = 0;
|
2001-09-09 12:52:41 +02:00
|
|
|
MultiSpeedMode = 0;
|
2001-09-14 14:06:43 +02:00
|
|
|
ShowReplayMode = 0;
|
2012-01-14 13:20:16 +01:00
|
|
|
ShowRemainingTime = 0;
|
2003-04-12 10:06:21 +02:00
|
|
|
ResumeID = 0;
|
2001-01-14 15:29:51 +01:00
|
|
|
CurrentChannel = -1;
|
2001-09-22 13:41:49 +02:00
|
|
|
CurrentVolume = MAXVOLUME;
|
2005-01-08 13:53:30 +01:00
|
|
|
CurrentDolby = 0;
|
2011-08-20 09:25:48 +02:00
|
|
|
InitialChannel = "";
|
2011-12-04 12:45:26 +01:00
|
|
|
DeviceBondings = "";
|
2006-04-09 13:26:56 +02:00
|
|
|
InitialVolume = -1;
|
2010-01-17 15:21:28 +01:00
|
|
|
ChannelsWrap = 0;
|
2012-06-17 12:27:07 +02:00
|
|
|
ShowChannelNamesWithSource = 0;
|
2007-11-25 14:20:03 +01:00
|
|
|
EmergencyExit = 1;
|
2000-09-10 10:51:58 +02:00
|
|
|
}
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
cSetup& cSetup::operator= (const cSetup &s)
|
|
|
|
{
|
|
|
|
memcpy(&__BeginData__, &s.__BeginData__, (char *)&s.__EndData__ - (char *)&s.__BeginData__);
|
2011-06-13 14:48:41 +02:00
|
|
|
InitialChannel = s.InitialChannel;
|
2011-12-04 12:45:26 +01:00
|
|
|
DeviceBondings = s.DeviceBondings;
|
2002-05-09 16:26:56 +02:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
cSetupLine *cSetup::Get(const char *Name, const char *Plugin)
|
|
|
|
{
|
|
|
|
for (cSetupLine *l = First(); l; l = Next(l)) {
|
|
|
|
if ((l->Plugin() == NULL) == (Plugin == NULL)) {
|
|
|
|
if ((!Plugin || strcasecmp(l->Plugin(), Plugin) == 0) && strcasecmp(l->Name(), Name) == 0)
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-10-19 11:34:48 +02:00
|
|
|
void cSetup::Store(const char *Name, const char *Value, const char *Plugin, bool AllowMultiple)
|
2002-05-09 16:26:56 +02:00
|
|
|
{
|
|
|
|
if (Name && *Name) {
|
|
|
|
cSetupLine *l = Get(Name, Plugin);
|
2002-10-19 11:34:48 +02:00
|
|
|
if (l && !AllowMultiple)
|
2002-05-09 16:26:56 +02:00
|
|
|
Del(l);
|
|
|
|
if (Value)
|
|
|
|
Add(new cSetupLine(Name, Value, Plugin));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void cSetup::Store(const char *Name, int Value, const char *Plugin)
|
|
|
|
{
|
2008-02-15 14:57:48 +01:00
|
|
|
Store(Name, cString::sprintf("%d", Value), Plugin);
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
|
2009-05-03 14:15:21 +02:00
|
|
|
void cSetup::Store(const char *Name, double &Value, const char *Plugin)
|
|
|
|
{
|
|
|
|
Store(Name, cString::sprintf("%f", Value), Plugin);
|
|
|
|
}
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
bool cSetup::Load(const char *FileName)
|
|
|
|
{
|
|
|
|
if (cConfig<cSetupLine>::Load(FileName, true)) {
|
|
|
|
bool result = true;
|
|
|
|
for (cSetupLine *l = First(); l; l = Next(l)) {
|
2002-05-11 13:44:58 +02:00
|
|
|
bool error = false;
|
2002-05-09 16:26:56 +02:00
|
|
|
if (l->Plugin()) {
|
|
|
|
cPlugin *p = cPluginManager::GetPlugin(l->Plugin());
|
|
|
|
if (p && !p->SetupParse(l->Name(), l->Value()))
|
2002-05-11 13:44:58 +02:00
|
|
|
error = true;
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!Parse(l->Name(), l->Value()))
|
2002-05-11 13:44:58 +02:00
|
|
|
error = true;
|
|
|
|
}
|
|
|
|
if (error) {
|
2002-05-13 16:35:49 +02:00
|
|
|
esyslog("ERROR: unknown config parameter: %s%s%s = %s", l->Plugin() ? l->Plugin() : "", l->Plugin() ? "." : "", l->Name(), l->Value());
|
2002-05-11 13:44:58 +02:00
|
|
|
result = false;
|
2002-05-09 16:26:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2004-01-09 15:53:59 +01:00
|
|
|
void cSetup::StoreLanguages(const char *Name, int *Values)
|
|
|
|
{
|
2007-08-11 12:39:06 +02:00
|
|
|
char buffer[I18nLanguages()->Size() * 4];
|
2004-01-09 15:53:59 +01:00
|
|
|
char *q = buffer;
|
2007-08-11 12:39:06 +02:00
|
|
|
for (int i = 0; i < I18nLanguages()->Size(); i++) {
|
2004-01-09 15:53:59 +01:00
|
|
|
if (Values[i] < 0)
|
|
|
|
break;
|
2004-01-25 15:32:08 +01:00
|
|
|
const char *s = I18nLanguageCode(Values[i]);
|
2004-01-09 15:53:59 +01:00
|
|
|
if (s) {
|
|
|
|
if (q > buffer)
|
|
|
|
*q++ = ' ';
|
|
|
|
strncpy(q, s, 3);
|
|
|
|
q += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*q = 0;
|
|
|
|
Store(Name, buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cSetup::ParseLanguages(const char *Value, int *Values)
|
|
|
|
{
|
|
|
|
int n = 0;
|
2007-08-11 12:39:06 +02:00
|
|
|
while (Value && *Value && n < I18nLanguages()->Size()) {
|
2004-02-09 17:04:50 +01:00
|
|
|
char buffer[4];
|
|
|
|
strn0cpy(buffer, Value, sizeof(buffer));
|
|
|
|
int i = I18nLanguageIndex(buffer);
|
2004-01-09 15:53:59 +01:00
|
|
|
if (i >= 0)
|
|
|
|
Values[n++] = i;
|
|
|
|
if ((Value = strchr(Value, ' ')) != NULL)
|
|
|
|
Value++;
|
|
|
|
}
|
|
|
|
Values[n] = -1;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
bool cSetup::Parse(const char *Name, const char *Value)
|
|
|
|
{
|
2007-08-11 12:39:06 +02:00
|
|
|
if (!strcasecmp(Name, "OSDLanguage")) { strn0cpy(OSDLanguage, Value, sizeof(OSDLanguage)); I18nSetLocale(OSDLanguage); }
|
2007-06-16 10:41:21 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDSkin")) Utf8Strn0Cpy(OSDSkin, Value, MaxSkinName);
|
|
|
|
else if (!strcasecmp(Name, "OSDTheme")) Utf8Strn0Cpy(OSDTheme, Value, MaxThemeName);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "PrimaryDVB")) PrimaryDVB = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "ShowInfoOnChSwitch")) ShowInfoOnChSwitch = atoi(Value);
|
2006-01-04 14:45:23 +01:00
|
|
|
else if (!strcasecmp(Name, "TimeoutRequChInfo")) TimeoutRequChInfo = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MenuScrollPage")) MenuScrollPage = atoi(Value);
|
2005-06-18 10:44:30 +02:00
|
|
|
else if (!strcasecmp(Name, "MenuScrollWrap")) MenuScrollWrap = atoi(Value);
|
2007-02-25 11:39:40 +01:00
|
|
|
else if (!strcasecmp(Name, "MenuKeyCloses")) MenuKeyCloses = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MarkInstantRecord")) MarkInstantRecord = atoi(Value);
|
2007-06-16 10:41:21 +02:00
|
|
|
else if (!strcasecmp(Name, "NameInstantRecord")) Utf8Strn0Cpy(NameInstantRecord, Value, MaxFileName);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "InstantRecordTime")) InstantRecordTime = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "LnbSLOF")) LnbSLOF = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "LnbFrequLo")) LnbFrequLo = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "DiSEqC")) DiSEqC = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value);
|
2004-05-16 12:58:04 +02:00
|
|
|
else if (!strcasecmp(Name, "TimeSource")) TimeSource = cSource::FromString(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
|
2012-04-15 10:52:34 +02:00
|
|
|
else if (!strcasecmp(Name, "StandardCompliance")) StandardCompliance = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value);
|
2005-01-05 10:48:22 +01:00
|
|
|
else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages);
|
2007-10-12 14:52:30 +02:00
|
|
|
else if (!strcasecmp(Name, "DisplaySubtitles")) DisplaySubtitles = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "SubtitleLanguages")) return ParseLanguages(Value, SubtitleLanguages);
|
|
|
|
else if (!strcasecmp(Name, "SubtitleOffset")) SubtitleOffset = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "SubtitleFgTransparency")) SubtitleFgTransparency = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "SubtitleBgTransparency")) SubtitleBgTransparency = atoi(Value);
|
2004-01-09 15:53:59 +01:00
|
|
|
else if (!strcasecmp(Name, "EPGLanguages")) return ParseLanguages(Value, EPGLanguages);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value);
|
2004-02-21 15:30:35 +01:00
|
|
|
else if (!strcasecmp(Name, "EPGLinger")) EPGLinger = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "SVDRPTimeout")) SVDRPTimeout = atoi(Value);
|
2003-08-17 08:58:02 +02:00
|
|
|
else if (!strcasecmp(Name, "ZapTimeout")) ZapTimeout = atoi(Value);
|
2007-02-25 14:14:06 +01:00
|
|
|
else if (!strcasecmp(Name, "ChannelEntryTimeout")) ChannelEntryTimeout= atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value);
|
2009-05-21 11:35:37 +02:00
|
|
|
else if (!strcasecmp(Name, "PauseKeyHandling")) PauseKeyHandling = atoi(Value);
|
2003-05-11 14:10:00 +02:00
|
|
|
else if (!strcasecmp(Name, "PausePriority")) PausePriority = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "PauseLifetime")) PauseLifetime = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "UseSubtitle")) UseSubtitle = atoi(Value);
|
2004-02-29 14:21:22 +01:00
|
|
|
else if (!strcasecmp(Name, "UseVps")) UseVps = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "VpsMargin")) VpsMargin = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "RecordingDirs")) RecordingDirs = atoi(Value);
|
2010-03-12 16:46:45 +01:00
|
|
|
else if (!strcasecmp(Name, "FoldersInTimerMenu")) FoldersInTimerMenu = atoi(Value);
|
2010-06-06 10:56:11 +02:00
|
|
|
else if (!strcasecmp(Name, "NumberKeysForChars")) NumberKeysForChars = atoi(Value);
|
2005-02-20 13:39:49 +01:00
|
|
|
else if (!strcasecmp(Name, "VideoDisplayFormat")) VideoDisplayFormat = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "VideoFormat")) VideoFormat = atoi(Value);
|
2004-01-05 12:08:09 +01:00
|
|
|
else if (!strcasecmp(Name, "UpdateChannels")) UpdateChannels = atoi(Value);
|
2005-01-09 12:36:48 +01:00
|
|
|
else if (!strcasecmp(Name, "UseDolbyDigital")) UseDolbyDigital = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "ChannelInfoPos")) ChannelInfoPos = atoi(Value);
|
2005-02-05 11:40:04 +01:00
|
|
|
else if (!strcasecmp(Name, "ChannelInfoTime")) ChannelInfoTime = atoi(Value);
|
2009-05-03 14:15:21 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDLeftP")) OSDLeftP = atof(Value);
|
|
|
|
else if (!strcasecmp(Name, "OSDTopP")) OSDTopP = atof(Value);
|
2009-06-13 10:26:37 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDWidthP")) { OSDWidthP = atof(Value); ChkDoublePlausibility(OSDWidthP, 0.87); }
|
|
|
|
else if (!strcasecmp(Name, "OSDHeightP")) { OSDHeightP = atof(Value); ChkDoublePlausibility(OSDHeightP, 0.84); }
|
2004-05-16 10:35:36 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDLeft")) OSDLeft = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "OSDTop")) OSDTop = atoi(Value);
|
2009-05-03 14:15:21 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDWidth")) { OSDWidth = atoi(Value); OSDWidth &= ~0x07; } // OSD width must be a multiple of 8
|
|
|
|
else if (!strcasecmp(Name, "OSDHeight")) OSDHeight = atoi(Value);
|
2009-05-09 10:42:35 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDAspect")) OSDAspect = atof(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "OSDMessageTime")) OSDMessageTime = atoi(Value);
|
2004-05-16 10:35:36 +02:00
|
|
|
else if (!strcasecmp(Name, "UseSmallFont")) UseSmallFont = atoi(Value);
|
2007-06-10 13:02:43 +02:00
|
|
|
else if (!strcasecmp(Name, "AntiAlias")) AntiAlias = atoi(Value);
|
2007-06-16 10:41:21 +02:00
|
|
|
else if (!strcasecmp(Name, "FontOsd")) Utf8Strn0Cpy(FontOsd, Value, MAXFONTNAME);
|
|
|
|
else if (!strcasecmp(Name, "FontSml")) Utf8Strn0Cpy(FontSml, Value, MAXFONTNAME);
|
|
|
|
else if (!strcasecmp(Name, "FontFix")) Utf8Strn0Cpy(FontFix, Value, MAXFONTNAME);
|
2009-06-13 10:26:37 +02:00
|
|
|
else if (!strcasecmp(Name, "FontOsdSizeP")) { FontOsdSizeP = atof(Value); ChkDoublePlausibility(FontOsdSizeP, 0.038); }
|
|
|
|
else if (!strcasecmp(Name, "FontSmlSizeP")) { FontSmlSizeP = atof(Value); ChkDoublePlausibility(FontSmlSizeP, 0.035); }
|
|
|
|
else if (!strcasecmp(Name, "FontFixSizeP")) { FontFixSizeP = atof(Value); ChkDoublePlausibility(FontFixSizeP, 0.031); }
|
2007-06-10 13:02:43 +02:00
|
|
|
else if (!strcasecmp(Name, "FontOsdSize")) FontOsdSize = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "FontSmlSize")) FontSmlSize = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "FontFixSize")) FontFixSize = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MaxVideoFileSize")) MaxVideoFileSize = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "SplitEditedFiles")) SplitEditedFiles = atoi(Value);
|
2010-03-07 12:43:30 +01:00
|
|
|
else if (!strcasecmp(Name, "DelTimeshiftRec")) DelTimeshiftRec = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MinEventTimeout")) MinEventTimeout = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "MinUserInactivity")) MinUserInactivity = atoi(Value);
|
2007-02-25 10:56:29 +01:00
|
|
|
else if (!strcasecmp(Name, "NextWakeupTime")) NextWakeupTime = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "MultiSpeedMode")) MultiSpeedMode = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value);
|
2012-01-14 13:20:16 +01:00
|
|
|
else if (!strcasecmp(Name, "ShowRemainingTime")) ShowRemainingTime = atoi(Value);
|
2003-04-12 10:06:21 +02:00
|
|
|
else if (!strcasecmp(Name, "ResumeID")) ResumeID = atoi(Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
|
|
|
|
else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
|
2005-01-08 13:53:30 +01:00
|
|
|
else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value);
|
2011-06-13 14:48:41 +02:00
|
|
|
else if (!strcasecmp(Name, "InitialChannel")) InitialChannel = Value;
|
2006-04-09 13:26:56 +02:00
|
|
|
else if (!strcasecmp(Name, "InitialVolume")) InitialVolume = atoi(Value);
|
2011-12-04 12:45:26 +01:00
|
|
|
else if (!strcasecmp(Name, "DeviceBondings")) DeviceBondings = Value;
|
2010-01-17 15:21:28 +01:00
|
|
|
else if (!strcasecmp(Name, "ChannelsWrap")) ChannelsWrap = atoi(Value);
|
2012-06-17 12:27:07 +02:00
|
|
|
else if (!strcasecmp(Name, "ShowChannelNamesWithSource")) ShowChannelNamesWithSource = atoi(Value);
|
2007-11-25 14:20:03 +01:00
|
|
|
else if (!strcasecmp(Name, "EmergencyExit")) EmergencyExit = atoi(Value);
|
2000-09-10 10:51:58 +02:00
|
|
|
else
|
2002-05-09 16:26:56 +02:00
|
|
|
return false;
|
|
|
|
return true;
|
2000-09-10 10:51:58 +02:00
|
|
|
}
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
bool cSetup::Save(void)
|
|
|
|
{
|
|
|
|
Store("OSDLanguage", OSDLanguage);
|
2004-05-16 10:35:36 +02:00
|
|
|
Store("OSDSkin", OSDSkin);
|
|
|
|
Store("OSDTheme", OSDTheme);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("PrimaryDVB", PrimaryDVB);
|
|
|
|
Store("ShowInfoOnChSwitch", ShowInfoOnChSwitch);
|
2006-01-04 14:45:23 +01:00
|
|
|
Store("TimeoutRequChInfo", TimeoutRequChInfo);
|
2005-08-07 09:04:14 +02:00
|
|
|
Store("MenuScrollPage", MenuScrollPage);
|
2005-06-18 10:44:30 +02:00
|
|
|
Store("MenuScrollWrap", MenuScrollWrap);
|
2007-02-25 11:39:40 +01:00
|
|
|
Store("MenuKeyCloses", MenuKeyCloses);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("MarkInstantRecord", MarkInstantRecord);
|
|
|
|
Store("NameInstantRecord", NameInstantRecord);
|
|
|
|
Store("InstantRecordTime", InstantRecordTime);
|
|
|
|
Store("LnbSLOF", LnbSLOF);
|
|
|
|
Store("LnbFrequLo", LnbFrequLo);
|
|
|
|
Store("LnbFrequHi", LnbFrequHi);
|
|
|
|
Store("DiSEqC", DiSEqC);
|
|
|
|
Store("SetSystemTime", SetSystemTime);
|
2004-05-16 12:58:04 +02:00
|
|
|
Store("TimeSource", cSource::ToString(TimeSource));
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("TimeTransponder", TimeTransponder);
|
2012-04-15 10:52:34 +02:00
|
|
|
Store("StandardCompliance", StandardCompliance);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("MarginStart", MarginStart);
|
|
|
|
Store("MarginStop", MarginStop);
|
2005-01-05 10:48:22 +01:00
|
|
|
StoreLanguages("AudioLanguages", AudioLanguages);
|
2007-10-12 14:52:30 +02:00
|
|
|
Store("DisplaySubtitles", DisplaySubtitles);
|
|
|
|
StoreLanguages("SubtitleLanguages", SubtitleLanguages);
|
|
|
|
Store("SubtitleOffset", SubtitleOffset);
|
|
|
|
Store("SubtitleFgTransparency", SubtitleFgTransparency);
|
|
|
|
Store("SubtitleBgTransparency", SubtitleBgTransparency);
|
2004-01-09 15:53:59 +01:00
|
|
|
StoreLanguages("EPGLanguages", EPGLanguages);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("EPGScanTimeout", EPGScanTimeout);
|
|
|
|
Store("EPGBugfixLevel", EPGBugfixLevel);
|
2004-02-21 15:30:35 +01:00
|
|
|
Store("EPGLinger", EPGLinger);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("SVDRPTimeout", SVDRPTimeout);
|
2003-08-17 08:58:02 +02:00
|
|
|
Store("ZapTimeout", ZapTimeout);
|
2007-02-25 14:14:06 +01:00
|
|
|
Store("ChannelEntryTimeout",ChannelEntryTimeout);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("DefaultPriority", DefaultPriority);
|
|
|
|
Store("DefaultLifetime", DefaultLifetime);
|
2009-05-21 11:35:37 +02:00
|
|
|
Store("PauseKeyHandling", PauseKeyHandling);
|
2003-05-11 14:10:00 +02:00
|
|
|
Store("PausePriority", PausePriority);
|
|
|
|
Store("PauseLifetime", PauseLifetime);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("UseSubtitle", UseSubtitle);
|
2004-02-29 14:21:22 +01:00
|
|
|
Store("UseVps", UseVps);
|
|
|
|
Store("VpsMargin", VpsMargin);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("RecordingDirs", RecordingDirs);
|
2010-03-12 16:46:45 +01:00
|
|
|
Store("FoldersInTimerMenu", FoldersInTimerMenu);
|
2010-06-06 10:56:11 +02:00
|
|
|
Store("NumberKeysForChars", NumberKeysForChars);
|
2005-02-20 13:39:49 +01:00
|
|
|
Store("VideoDisplayFormat", VideoDisplayFormat);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("VideoFormat", VideoFormat);
|
2004-01-05 12:08:09 +01:00
|
|
|
Store("UpdateChannels", UpdateChannels);
|
2005-01-09 12:36:48 +01:00
|
|
|
Store("UseDolbyDigital", UseDolbyDigital);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("ChannelInfoPos", ChannelInfoPos);
|
2005-02-05 11:40:04 +01:00
|
|
|
Store("ChannelInfoTime", ChannelInfoTime);
|
2009-05-03 14:15:21 +02:00
|
|
|
Store("OSDLeftP", OSDLeftP);
|
|
|
|
Store("OSDTopP", OSDTopP);
|
|
|
|
Store("OSDWidthP", OSDWidthP);
|
|
|
|
Store("OSDHeightP", OSDHeightP);
|
2004-05-16 10:35:36 +02:00
|
|
|
Store("OSDLeft", OSDLeft);
|
|
|
|
Store("OSDTop", OSDTop);
|
|
|
|
Store("OSDWidth", OSDWidth);
|
|
|
|
Store("OSDHeight", OSDHeight);
|
2009-05-09 10:42:35 +02:00
|
|
|
Store("OSDAspect", OSDAspect);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("OSDMessageTime", OSDMessageTime);
|
2004-05-16 10:35:36 +02:00
|
|
|
Store("UseSmallFont", UseSmallFont);
|
2007-06-10 13:02:43 +02:00
|
|
|
Store("AntiAlias", AntiAlias);
|
|
|
|
Store("FontOsd", FontOsd);
|
|
|
|
Store("FontSml", FontSml);
|
|
|
|
Store("FontFix", FontFix);
|
2009-05-03 14:15:21 +02:00
|
|
|
Store("FontOsdSizeP", FontOsdSizeP);
|
|
|
|
Store("FontSmlSizeP", FontSmlSizeP);
|
|
|
|
Store("FontFixSizeP", FontFixSizeP);
|
2007-06-10 13:02:43 +02:00
|
|
|
Store("FontOsdSize", FontOsdSize);
|
|
|
|
Store("FontSmlSize", FontSmlSize);
|
|
|
|
Store("FontFixSize", FontFixSize);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("MaxVideoFileSize", MaxVideoFileSize);
|
|
|
|
Store("SplitEditedFiles", SplitEditedFiles);
|
2010-03-07 12:43:30 +01:00
|
|
|
Store("DelTimeshiftRec", DelTimeshiftRec);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("MinEventTimeout", MinEventTimeout);
|
|
|
|
Store("MinUserInactivity", MinUserInactivity);
|
2007-02-25 10:56:29 +01:00
|
|
|
Store("NextWakeupTime", NextWakeupTime);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("MultiSpeedMode", MultiSpeedMode);
|
|
|
|
Store("ShowReplayMode", ShowReplayMode);
|
2012-01-14 13:20:16 +01:00
|
|
|
Store("ShowRemainingTime", ShowRemainingTime);
|
2003-04-12 10:06:21 +02:00
|
|
|
Store("ResumeID", ResumeID);
|
2002-05-09 16:26:56 +02:00
|
|
|
Store("CurrentChannel", CurrentChannel);
|
|
|
|
Store("CurrentVolume", CurrentVolume);
|
2005-01-08 13:53:30 +01:00
|
|
|
Store("CurrentDolby", CurrentDolby);
|
2006-04-09 13:26:56 +02:00
|
|
|
Store("InitialChannel", InitialChannel);
|
|
|
|
Store("InitialVolume", InitialVolume);
|
2011-12-04 12:45:26 +01:00
|
|
|
Store("DeviceBondings", DeviceBondings);
|
2010-01-17 15:21:28 +01:00
|
|
|
Store("ChannelsWrap", ChannelsWrap);
|
2012-06-17 12:27:07 +02:00
|
|
|
Store("ShowChannelNamesWithSource", ShowChannelNamesWithSource);
|
2007-11-25 14:20:03 +01:00
|
|
|
Store("EmergencyExit", EmergencyExit);
|
2002-05-09 16:26:56 +02:00
|
|
|
|
|
|
|
Sort();
|
|
|
|
|
|
|
|
if (cConfig<cSetupLine>::Save()) {
|
2002-05-13 16:35:49 +02:00
|
|
|
isyslog("saved setup to %s", FileName());
|
2002-05-09 16:26:56 +02:00
|
|
|
return true;
|
2000-09-10 10:51:58 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|