summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/config.c b/config.c
index d3f2db7..6caf587 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.117 2003/10/17 14:11:27 kls Exp $
+ * $Id: config.c 1.120 2004/01/11 15:38:11 kls Exp $
*/
#include "config.h"
@@ -259,6 +259,7 @@ cSetup::cSetup(void)
TimeTransponder = 0;
MarginStart = 2;
MarginStop = 10;
+ EPGLanguages[0] = -1;
EPGScanTimeout = 5;
EPGBugfixLevel = 2;
SVDRPTimeout = 300;
@@ -272,6 +273,7 @@ cSetup::cSetup(void)
UseSubtitle = 1;
RecordingDirs = 1;
VideoFormat = 0;
+ UpdateChannels = 4;
RecordDolbyDigital = 1;
ChannelInfoPos = 0;
OSDwidth = 52;
@@ -394,6 +396,39 @@ bool cSetup::ParseCaCaps(const char *Value)
return false;
}
+void cSetup::StoreLanguages(const char *Name, int *Values)
+{
+ char buffer[I18nNumLanguages * 4];
+ char *q = buffer;
+ for (int i = 0; i < I18nNumLanguages; i++) {
+ if (Values[i] < 0)
+ break;
+ const char *s = I18nLanguageAbbreviation(Values[i]);
+ 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;
+ while (Value && *Value && n < I18nNumLanguages) {
+ int i = I18nLanguageIndex(Value);
+ if (i >= 0)
+ Values[n++] = i;
+ if ((Value = strchr(Value, ' ')) != NULL)
+ Value++;
+ }
+ Values[n] = -1;
+ return true;
+}
+
bool cSetup::Parse(const char *Name, const char *Value)
{
if (!strcasecmp(Name, "OSDLanguage")) OSDLanguage = atoi(Value);
@@ -411,6 +446,7 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value);
else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value);
+ else if (!strcasecmp(Name, "EPGLanguages")) return ParseLanguages(Value, EPGLanguages);
else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value);
else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value);
else if (!strcasecmp(Name, "SVDRPTimeout")) SVDRPTimeout = atoi(Value);
@@ -424,6 +460,7 @@ bool cSetup::Parse(const char *Name, const char *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);
+ else if (!strcasecmp(Name, "UpdateChannels")) UpdateChannels = atoi(Value);
else if (!strcasecmp(Name, "RecordDolbyDigital")) RecordDolbyDigital = atoi(Value);
else if (!strcasecmp(Name, "ChannelInfoPos")) ChannelInfoPos = atoi(Value);
else if (!strcasecmp(Name, "OSDwidth")) OSDwidth = atoi(Value);
@@ -461,6 +498,7 @@ bool cSetup::Save(void)
Store("TimeTransponder", TimeTransponder);
Store("MarginStart", MarginStart);
Store("MarginStop", MarginStop);
+ StoreLanguages("EPGLanguages", EPGLanguages);
Store("EPGScanTimeout", EPGScanTimeout);
Store("EPGBugfixLevel", EPGBugfixLevel);
Store("SVDRPTimeout", SVDRPTimeout);
@@ -474,6 +512,7 @@ bool cSetup::Save(void)
Store("UseSubtitle", UseSubtitle);
Store("RecordingDirs", RecordingDirs);
Store("VideoFormat", VideoFormat);
+ Store("UpdateChannels", UpdateChannels);
Store("RecordDolbyDigital", RecordDolbyDigital);
Store("ChannelInfoPos", ChannelInfoPos);
Store("OSDwidth", OSDwidth);