1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
/*
* config.c
*
* See the README file for copyright information and how to reach the author.
*
*/
#include "config.h"
#include "magazine.h"
#include <getopt.h>
#include <unistd.h>
#include <vdr/menuitems.h>
tvonscreenConfig tvonscreenCfg;
tvonscreenConfig::tvonscreenConfig(void)
{
showLogos=false;
noInfoLine=false;
showChannels=true;
bwlogos=false;
usertime1=1700;
usertime2=2000;
usertime3=2300;
thenshownextday=true;
showsearchinitiator=true;
fontdsize=0;
transparency=100;
memset(logos,0,sizeof(logos));
memset(vdradminfile,0,sizeof(vdradminfile));
}
bool tvonscreenConfig::SetupParse(const char *Name, const char *Value)
{
if (strcmp(Name,"showLogos")==0) showLogos = atoi(Value);
else if (strcmp(Name,"noInfoLine")==0) noInfoLine = atoi(Value);
else if (strcmp(Name,"showChannels")==0) showChannels = atoi(Value);
else if (strcmp(Name,"bwlogos")==0) bwlogos = atoi(Value);
else if (strcmp(Name,"usertime1")==0) usertime1 = atoi(Value);
else if (strcmp(Name,"usertime2")==0) usertime2 = atoi(Value);
else if (strcmp(Name,"usertime3")==0) usertime3 = atoi(Value);
else if (strcmp(Name,"thenshownextday")==0) thenshownextday = atoi(Value);
else if (strcmp(Name,"showsearchinitiator")==0) showsearchinitiator = atoi(Value);
else if (strcmp(Name,"fontdsize")==0) fontdsize = atoi(Value);
else if (strcmp(Name,"transparency")==0) transparency = atoi(Value);
else
return false;
return true;
}
const char *tvonscreenConfig::CommandLineHelp(void)
{
// Return a string that describes all known command line options.
return " -l PathToLogos\n --logos=PathToLogos\n -v vdradmind.at\n --vdradminfile=vdradmind.at\n";
}
bool tvonscreenConfig::ProcessArgs(int argc, char *argv[])
{
static struct option long_options[] =
{
{ "logos", required_argument, NULL, 'l'
},
{ "vdradminfile",required_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
};
bool retval=true;
int c;
while ((c = getopt_long(argc, argv, "l:v:", long_options, NULL)) != -1)
{
switch (c)
{
case 'l':
strncpy(logos,optarg,sizeof(logos)-1);
logos[sizeof(logos)-1]=0;
retval=true;
break;
case 'v':
strncpy(vdradminfile,optarg,sizeof(vdradminfile)-1);
vdradminfile[sizeof(vdradminfile)-1]=0;
retval=true;
break;
default:
break;
}
}
return retval;
}
// ----------------------------------------------------------------------
tvonscreenConfigPage::tvonscreenConfigPage(void) : cMenuSetupPage()
{
m_NewConfig = tvonscreenCfg;
Add(new cMenuEditIntItem(tr("font size"),
&m_NewConfig.fontdsize,-5,5));
Add(new cMenuEditIntItem(tr("transparency"),
&m_NewConfig.transparency,0,100));
Add(new cMenuEditBoolItem(tr("show channel logos"),
&m_NewConfig.showLogos));
Add(new cMenuEditBoolItem(tr("show channel names"),
&m_NewConfig.showChannels));
Add(new cMenuEditBoolItem(tr("show logos in black&white"),
&m_NewConfig.bwlogos));
Add(new cMenuEditBoolItem(tr("hide info line"),
&m_NewConfig.noInfoLine));
Add(new cMenuEditTimeItem(tr("user point in time 1 (Key 4)"),
&m_NewConfig.usertime1));
Add(new cMenuEditTimeItem(tr("user point in time 2 (Key 5)"),
&m_NewConfig.usertime2));
Add(new cMenuEditTimeItem(tr("user point in time 3 (Key 6)"),
&m_NewConfig.usertime3));
Add(new cMenuEditBoolItem(tr("jump to next day point if ago"),
&m_NewConfig.thenshownextday));
Add(new cMenuEditBoolItem(tr("Show search item itself"),
&m_NewConfig.showsearchinitiator));
}
tvonscreenConfigPage::~tvonscreenConfigPage()
{
}
void tvonscreenConfigPage::Store(void)
{
SetupStore("showLogos", m_NewConfig.showLogos);
SetupStore("noInfoLine", m_NewConfig.noInfoLine);
SetupStore("showChannels", m_NewConfig.showChannels);
SetupStore("bwlogos", m_NewConfig.bwlogos);
SetupStore("usertime1", m_NewConfig.usertime1);
SetupStore("usertime2", m_NewConfig.usertime2);
SetupStore("usertime3", m_NewConfig.usertime3);
SetupStore("thenshownextday", m_NewConfig.thenshownextday);
SetupStore("showsearchinitiator", m_NewConfig.showsearchinitiator);
SetupStore("fontdsize", m_NewConfig.fontdsize);
SetupStore("transparency", m_NewConfig.transparency);
tvonscreenCfg = m_NewConfig;
}
|