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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
/*
* See the README file for copyright information and how to reach the author.
*/
#include "neutrinoepg.h"
#include "menuevent.h"
// setup values
int bookmark = 2015;
int Step = 30;
int keeposd = 0;
int showchannelnumbers = 1;
int hideencryptedchannels = 0;
int hideradiochannels = 0;
int switchwithok = 1;
int hidemainmenu = false;
int percentprogress = false;
int middlemenuentry = false;
int switchgroupkey = 0;
int ChannelNameWidth = 15;
int HideGroupsAt = 0;
// --- myMenuSetup ------------------------------------------------------------
class myMenuSetup : public cMenuSetupPage
{
private:
const char *SwitchGroupKeyTexts[2];
const char *SitchWithOKTexts[2];
const char **HideGroupsAtTexts;
int GroupCount;
protected:
virtual void Store()
{
SetupStore("hidemainmenu", hidemainmenu);
SetupStore("bookmark", bookmark);
SetupStore("step", Step);
SetupStore("keeposd", keeposd);
SetupStore("hideencryptedchannels", hideencryptedchannels);
SetupStore("hideradiochannels", hideradiochannels);
SetupStore("showchannelnumbers", showchannelnumbers);
SetupStore("switchwithok", switchwithok);
SetupStore("percentprogress", percentprogress);
SetupStore("middlemenuentry", middlemenuentry);
SetupStore("switchgroupkey", switchgroupkey);
SetupStore("ChannelNameWidth", ChannelNameWidth);
SetupStore("HideGroupsAt", HideGroupsAt);
}
public:
~myMenuSetup()
{
for(int i = 0; i < GroupCount; i++)
delete[] HideGroupsAtTexts[i];
delete[] HideGroupsAtTexts;
}
myMenuSetup()
{
GroupCount = 0;
int index = 0;
bool HideFirst = true;
for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel))
{
if( Channel->GroupSep() )
GroupCount++;
}
// add one group if the first is not one
if( !Channels.First()->GroupSep() )
{
GroupCount++;
HideFirst = false;
HideGroupsAtTexts[index] = tr("no filter");
index++;
}
HideGroupsAtTexts = new const char*[GroupCount];
for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel))
{
if( Channel->GroupSep() )
{
if( HideFirst )
{
HideFirst = false;
HideGroupsAtTexts[index] = new char( strlen(tr("no filter")) + 1 );
strcpy((char *)HideGroupsAtTexts[index], (char *)tr("no filter"));
index++;
continue;
}
HideGroupsAtTexts[index] = new char( strlen(Channel->Name()) + 1 );
strcpy((char *)HideGroupsAtTexts[index], (char *)Channel->Name());
index++;
}
}
SwitchGroupKeyTexts[0] = tr("left/right");
SwitchGroupKeyTexts[1] = tr("prev/next");
SitchWithOKTexts[0] = tr("Blue");
SitchWithOKTexts[1] = tr("Ok");
Add(new cOsdItem(tr("Behavior"), osUnknown, false));
Add(new cMenuEditIntItem(tr("Step width (min)"), &Step));
Add(new cMenuEditTimeItem(tr("Favorite time"), &bookmark));
Add(new cMenuEditStraItem(tr("Key to switch channel"), &switchwithok, 2, SitchWithOKTexts));
Add(new cMenuEditBoolItem(tr("Selected item centered"), &middlemenuentry));
Add(new cMenuEditStraItem(tr("Keys to switch channel group"), &switchgroupkey, 2, SwitchGroupKeyTexts));
Add(new cOsdItem(tr("Appearance"), osUnknown, false));
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &hidemainmenu));
Add(new cMenuEditIntItem(tr("Channel name width"), &ChannelNameWidth));
Add(new cMenuEditBoolItem(tr("Keep display after switching"), &keeposd));
Add(new cMenuEditBoolItem(tr("Show channel numbers"), &showchannelnumbers));
Add(new cMenuEditStraItem(tr("Hide Groups at"), &HideGroupsAt, GroupCount, HideGroupsAtTexts));
Add(new cMenuEditBoolItem(tr("Hide encrypted channels"), &hideencryptedchannels));
Add(new cMenuEditBoolItem(tr("Hide radio channels"), &hideradiochannels));
Add(new cMenuEditBoolItem(tr("Progress as percent"), &percentprogress));
}
};
cPluginNeutrinoEpg::cPluginNeutrinoEpg(void)
{
}
cPluginNeutrinoEpg::~cPluginNeutrinoEpg()
{
}
const char *cPluginNeutrinoEpg::CommandLineHelp(void)
{
return NULL;
}
bool cPluginNeutrinoEpg::ProcessArgs(int argc, char *argv[])
{
return true;
}
bool cPluginNeutrinoEpg::Initialize(void)
{
return true;
}
bool cPluginNeutrinoEpg::Start(void)
{
Icons::InitCharSet();
GroupIndex = NULL;
CurrentGroupChannel = NULL;
FirstGroupChannel = NULL;
LastGroupChannel = NULL;
return true;
}
void cPluginNeutrinoEpg::Stop(void)
{
if( GroupIndex != NULL )
delete[] GroupIndex;
if( CurrentGroupChannel != NULL )
delete[] CurrentGroupChannel;
if( FirstGroupChannel != NULL )
delete[] FirstGroupChannel;
if( LastGroupChannel != NULL )
delete[] LastGroupChannel;
}
void cPluginNeutrinoEpg::Housekeeping(void)
{
}
cOsdObject *cPluginNeutrinoEpg::MainMenuAction(void)
{
syslog(LOG_ERR, "neutrinoepg MainMenuAction");
return new myOsdMenu;
}
cMenuSetupPage *cPluginNeutrinoEpg::SetupMenu(void)
{
return new myMenuSetup;
}
bool cPluginNeutrinoEpg::SetupParse(const char *Name, const char *Value)
{
if(!strcmp("hidemainmenu", Name))
hidemainmenu = atoi(Value);
else if(!strcmp("bookmark", Name))
bookmark = atoi(Value);
else if(!strcmp("step", Name))
Step = atoi(Value);
else if(!strcmp("keeposd", Name))
keeposd = atoi(Value);
else if(!strcmp("hideencryptedchannels", Name))
hideencryptedchannels = atoi(Value);
else if(!strcmp("showchannelnumbers", Name))
showchannelnumbers = atoi(Value);
else if(!strcmp("hideradiochannels", Name))
hideradiochannels = atoi(Value);
else if(!strcmp("switchwithok", Name))
switchwithok = atoi(Value);
else if(!strcmp("percentprogress", Name))
percentprogress = atoi(Value);
else if(!strcmp("middlemenuentry", Name))
middlemenuentry = atoi(Value);
else if(!strcmp("ChannelNameWidth", Name))
ChannelNameWidth = atoi(Value);
else if(!strcmp("switchgroupkey", Name))
switchgroupkey = atoi(Value);
else if(!strcmp("HideGroupsAt", Name))
HideGroupsAt = atoi(Value);
else
return false;
return true;
}
VDRPLUGINCREATOR(cPluginNeutrinoEpg); // Don't touch this!
|