1 | #ifndef EPGSETTINGS_H |
---|
2 | #define EPGSETTINGS_H |
---|
3 | |
---|
4 | void createepgscanlist(struct skin* scanlist, struct skin* listbox) |
---|
5 | { |
---|
6 | struct epgscanlist *node = epgscanlist; |
---|
7 | struct skin* tmp = NULL; |
---|
8 | |
---|
9 | while(node != NULL) |
---|
10 | { |
---|
11 | struct channel* chnode = getchannel(node->serviceid, node->transponderid); |
---|
12 | if(chnode != NULL) |
---|
13 | { |
---|
14 | tmp = addlistbox(scanlist, listbox, tmp, 1); |
---|
15 | if(tmp != NULL) |
---|
16 | { |
---|
17 | changetext(tmp, chnode->name); |
---|
18 | tmp->handle = (char*)node; |
---|
19 | } |
---|
20 | } |
---|
21 | node = node->next; |
---|
22 | } |
---|
23 | } |
---|
24 | |
---|
25 | void screenepgscanlist() |
---|
26 | { |
---|
27 | int rcret = 0; |
---|
28 | struct skin* scanlist = getscreen("epgscanlist"); |
---|
29 | struct skin* listbox = getscreennode(scanlist, "listbox"); |
---|
30 | char* tmpstr = NULL, *tmpchannellist = NULL; |
---|
31 | |
---|
32 | if(status.servicetype == 0) |
---|
33 | tmpchannellist = ostrcat(getconfig("channellist", NULL), NULL, 0, 0); |
---|
34 | else |
---|
35 | tmpchannellist = ostrcat(getconfig("rchannellist", NULL), NULL, 0, 0); |
---|
36 | |
---|
37 | scanlist->aktline = 1; |
---|
38 | scanlist->aktpage = -1; |
---|
39 | |
---|
40 | createepgscanlist(scanlist, listbox); |
---|
41 | |
---|
42 | drawscreen(scanlist, 0, 0); |
---|
43 | addscreenrc(scanlist, listbox); |
---|
44 | |
---|
45 | while(1) |
---|
46 | { |
---|
47 | rcret = waitrc(scanlist, 0, 0); |
---|
48 | |
---|
49 | if(rcret == getrcconfigint("rcok", NULL)) break; |
---|
50 | if(rcret == getrcconfigint("rcred", NULL) && listbox->select != NULL && listbox->select->handle != NULL) |
---|
51 | { |
---|
52 | if(delepgscanlist(((struct epgscanlist*)listbox->select->handle)->serviceid, ((struct epgscanlist*)listbox->select->handle)->transponderid) == 0) |
---|
53 | { |
---|
54 | listbox->aktline--; |
---|
55 | listbox->aktpage = -1; |
---|
56 | delmarkedscreennodes(scanlist, 1); |
---|
57 | createepgscanlist(scanlist, listbox); |
---|
58 | drawscreen(scanlist, 0, 0); |
---|
59 | } |
---|
60 | } |
---|
61 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
62 | { |
---|
63 | clearscreen(scanlist); |
---|
64 | int saveservicetype = status.servicetype; |
---|
65 | struct channel* tmpchnode = NULL; |
---|
66 | |
---|
67 | screenchannellist(&tmpchnode, &tmpchannellist, 1); |
---|
68 | status.servicetype = saveservicetype; |
---|
69 | |
---|
70 | if(tmpchnode != NULL && getepgscanlist(tmpchnode->serviceid, tmpchnode->transponderid) == NULL) |
---|
71 | { |
---|
72 | tmpstr = ostrcat(oitoa(tmpchnode->serviceid), "#", 1, 0); |
---|
73 | tmpstr = ostrcat(tmpstr, ollutoa(tmpchnode->transponderid), 1, 1); |
---|
74 | if(addepgscanlist(tmpstr, 1, NULL) != NULL) |
---|
75 | { |
---|
76 | delmarkedscreennodes(scanlist, 1); |
---|
77 | createepgscanlist(scanlist, listbox); |
---|
78 | } |
---|
79 | free(tmpstr); tmpstr = NULL; |
---|
80 | } |
---|
81 | |
---|
82 | drawscreen(scanlist, 0, 0); |
---|
83 | } |
---|
84 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
85 | { |
---|
86 | clearscreen(scanlist); |
---|
87 | struct mainbouquet* mbouquet = screenmainbouquet(); |
---|
88 | |
---|
89 | mainbouquet2epgscanlist(mbouquet); |
---|
90 | delmarkedscreennodes(scanlist, 1); |
---|
91 | createepgscanlist(scanlist, listbox); |
---|
92 | |
---|
93 | drawscreen(scanlist, 0, 0); |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | delmarkedscreennodes(scanlist, 1); |
---|
98 | delownerrc(scanlist); |
---|
99 | clearscreen(scanlist); |
---|
100 | } |
---|
101 | |
---|
102 | void screenepgsettings() |
---|
103 | { |
---|
104 | int rcret = 0; |
---|
105 | char* ret = NULL; |
---|
106 | struct skin* epgsettings = getscreen("epgsettings"); |
---|
107 | struct skin* listbox = getscreennode(epgsettings, "listbox"); |
---|
108 | struct skin* epgpath = getscreennode(epgsettings, "epgpath"); |
---|
109 | struct skin* epgdays = getscreennode(epgsettings, "epgdays"); |
---|
110 | struct skin* epgdel = getscreennode(epgsettings, "epgdel"); |
---|
111 | struct skin* epgscreen = getscreennode(epgsettings, "epgscreen"); |
---|
112 | struct skin* epgfreespace = getscreennode(epgsettings, "epgfreespace"); |
---|
113 | struct skin* epglistmode = getscreennode(epgsettings, "epglistmode"); |
---|
114 | struct skin* epgrefresh = getscreennode(epgsettings, "epgrefresh"); |
---|
115 | struct skin* epgbutton = getscreennode(epgsettings, "epgbutton"); |
---|
116 | struct skin* epgzoom = getscreennode(epgsettings, "epgzoom"); |
---|
117 | struct skin* epgpicon = getscreennode(epgsettings, "epgpicon"); |
---|
118 | struct skin* epgsave = getscreennode(epgsettings, "epgsave"); |
---|
119 | struct skin* delepgbeforescan = getscreennode(epgsettings, "delepgbeforescan"); |
---|
120 | struct skin* mhwepg = getscreennode(epgsettings, "mhwepg"); |
---|
121 | struct skin* mhw2epg = getscreennode(epgsettings, "mhw2epg"); |
---|
122 | struct skin* opentv = getscreennode(epgsettings, "opentv"); |
---|
123 | struct skin* epg_afterevent = getscreennode(epgsettings, "epg_afterevent"); |
---|
124 | struct skin* load = getscreen("loading"); |
---|
125 | struct skin* tmp = NULL; |
---|
126 | |
---|
127 | changeinput(epgpath, getconfig("epg_path", NULL)); |
---|
128 | |
---|
129 | changeinput(epgdays, "0\n2\n4\n6\n8\n10\n12\n14\n16\n18\n20"); |
---|
130 | setchoiceboxselection(epgdays, getconfig("epg_days", NULL)); |
---|
131 | |
---|
132 | addchoicebox(epgdel, "0", _("no")); |
---|
133 | addchoicebox(epgdel, "1", _("yes")); |
---|
134 | setchoiceboxselection(epgdel, getconfig("epg_del", NULL)); |
---|
135 | |
---|
136 | addchoicebox(epgscreen, "0", _("Channel EPG")); |
---|
137 | addchoicebox(epgscreen, "1", _("Single EPG")); |
---|
138 | addchoicebox(epgscreen, "2", _("Multi EPG")); |
---|
139 | addchoicebox(epgscreen, "3", _("Graphic Multi EPG")); |
---|
140 | setchoiceboxselection(epgscreen, getconfig("epg_screen", NULL)); |
---|
141 | |
---|
142 | changeinput(epgfreespace, "50\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000"); |
---|
143 | setchoiceboxselection(epgfreespace, getconfig("epgfreespace", NULL)); |
---|
144 | |
---|
145 | addchoicebox(epglistmode, "0", _("deaktiv")); |
---|
146 | addchoicebox(epglistmode, "1", _("scan")); |
---|
147 | addchoicebox(epglistmode, "2", _("whitelist")); |
---|
148 | addchoicebox(epglistmode, "3", _("scan and whitelist")); |
---|
149 | setchoiceboxselection(epglistmode, getconfig("epg_listmode", NULL)); |
---|
150 | |
---|
151 | addchoicebox(epgrefresh, "0", _("deaktiv")); |
---|
152 | addchoicebox(epgrefresh, "01:00", "01:00"); |
---|
153 | addchoicebox(epgrefresh, "02:00", "02:00"); |
---|
154 | addchoicebox(epgrefresh, "03:00", "03:00"); |
---|
155 | addchoicebox(epgrefresh, "04:00", "04:00"); |
---|
156 | addchoicebox(epgrefresh, "05:00", "05:00"); |
---|
157 | addchoicebox(epgrefresh, "06:00", "06:00"); |
---|
158 | addchoicebox(epgrefresh, "07:00", "07:00"); |
---|
159 | addchoicebox(epgrefresh, "08:00", "08:00"); |
---|
160 | addchoicebox(epgrefresh, "09:00", "09:00"); |
---|
161 | addchoicebox(epgrefresh, "10:00", "10:00"); |
---|
162 | addchoicebox(epgrefresh, "11:00", "11:00"); |
---|
163 | addchoicebox(epgrefresh, "12:00", "12:00"); |
---|
164 | addchoicebox(epgrefresh, "13:00", "13:00"); |
---|
165 | addchoicebox(epgrefresh, "14:00", "14:00"); |
---|
166 | addchoicebox(epgrefresh, "15:00", "15:00"); |
---|
167 | addchoicebox(epgrefresh, "16:00", "16:00"); |
---|
168 | addchoicebox(epgrefresh, "17:00", "17:00"); |
---|
169 | addchoicebox(epgrefresh, "18:00", "18:00"); |
---|
170 | addchoicebox(epgrefresh, "19:00", "19:00"); |
---|
171 | addchoicebox(epgrefresh, "20:00", "20:00"); |
---|
172 | addchoicebox(epgrefresh, "21:00", "21:00"); |
---|
173 | addchoicebox(epgrefresh, "22:00", "22:00"); |
---|
174 | addchoicebox(epgrefresh, "23:00", "23:00"); |
---|
175 | addchoicebox(epgrefresh, "23:59", "24:00"); |
---|
176 | setchoiceboxselection(epgrefresh, getconfig("epg_refreshtime", NULL)); |
---|
177 | |
---|
178 | addchoicebox(epgbutton, "0", _("Single EPG")); |
---|
179 | addchoicebox(epgbutton, "1", _("Multi EPG")); |
---|
180 | setchoiceboxselection(epgbutton, getconfig("epgbutton", NULL)); |
---|
181 | |
---|
182 | changeinput(epgzoom, "1\n2\n3\n4\n5\n6\n7"); |
---|
183 | setchoiceboxselection(epgzoom, getconfig("gmultiepgzoom", NULL)); |
---|
184 | |
---|
185 | addchoicebox(epgpicon, "0", _("no")); |
---|
186 | addchoicebox(epgpicon, "1", _("yes")); |
---|
187 | setchoiceboxselection(epgpicon, getconfig("epgpicon", NULL)); |
---|
188 | |
---|
189 | addchoicebox(epgsave, "0", _("always")); |
---|
190 | addchoicebox(epgsave, "1", _("only on power off / restart")); |
---|
191 | addchoicebox(epgsave, "2", _("never")); |
---|
192 | setchoiceboxselection(epgsave, getconfig("epgsave", NULL)); |
---|
193 | |
---|
194 | addchoicebox(delepgbeforescan, "0", _("no")); |
---|
195 | addchoicebox(delepgbeforescan, "1", _("yes")); |
---|
196 | setchoiceboxselection(delepgbeforescan, getconfig("delepgbeforescan", NULL)); |
---|
197 | |
---|
198 | addchoicebox(mhwepg, "0", _("no")); |
---|
199 | addchoicebox(mhwepg, "1", _("only for scan")); |
---|
200 | addchoicebox(mhwepg, "2", _("always")); |
---|
201 | setchoiceboxselection(mhwepg, getconfig("mhwepg", NULL)); |
---|
202 | |
---|
203 | addchoicebox(mhw2epg, "0", _("no")); |
---|
204 | addchoicebox(mhw2epg, "1", _("only for scan")); |
---|
205 | addchoicebox(mhw2epg, "2", _("always")); |
---|
206 | setchoiceboxselection(mhw2epg, getconfig("mhw2epg", NULL)); |
---|
207 | |
---|
208 | addchoicebox(opentv, "0", _("no")); |
---|
209 | addchoicebox(opentv, "1", _("only for scan")); |
---|
210 | addchoicebox(opentv, "2", _("always")); |
---|
211 | setchoiceboxselection(opentv, getconfig("opentv", NULL)); |
---|
212 | |
---|
213 | addchoicebox(epg_afterevent, "0", _("nothing")); |
---|
214 | addchoicebox(epg_afterevent, "1", _("poweroff")); |
---|
215 | setchoiceboxselection(epg_afterevent, getconfig("epg_afterevent", NULL)); |
---|
216 | |
---|
217 | drawscreen(epgsettings, 0, 0); |
---|
218 | addscreenrc(epgsettings, listbox); |
---|
219 | |
---|
220 | tmp = listbox->select; |
---|
221 | while(1) |
---|
222 | { |
---|
223 | addscreenrc(epgsettings, tmp); |
---|
224 | rcret = waitrc(epgsettings, 0, 0); |
---|
225 | tmp = listbox->select; |
---|
226 | |
---|
227 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
228 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
229 | { |
---|
230 | addconfigscreen("epg_path", epgpath); |
---|
231 | addconfigscreen("epg_days", epgdays); |
---|
232 | status.epgdays = getconfigint("epg_days", NULL); |
---|
233 | addconfigscreen("epg_del", epgdel); |
---|
234 | addconfigscreen("epg_screen", epgscreen); |
---|
235 | addconfigscreen("epgfreespace", epgfreespace); |
---|
236 | addconfigscreencheck("epg_listmode", epglistmode, "0"); |
---|
237 | status.epglistmode = getconfigint("epg_listmode", NULL); |
---|
238 | addconfigscreencheck("epg_refreshtime", epgrefresh, "0"); |
---|
239 | addconfigscreencheck("epgbutton", epgbutton, "0"); |
---|
240 | addconfigscreen("gmultiepgzoom", epgzoom); |
---|
241 | addconfigscreencheck("epgpicon", epgpicon, "0"); |
---|
242 | addconfigscreencheck("epgsave", epgsave, "0"); |
---|
243 | addconfigscreencheck("delepgbeforescan", delepgbeforescan, "0"); |
---|
244 | addconfigscreencheck("mhwepg", mhwepg, "0"); |
---|
245 | addconfigscreencheck("mhw2epg", mhw2epg, "0"); |
---|
246 | addconfigscreencheck("opentv", opentv, "0"); |
---|
247 | addconfigscreencheck("epg_afterevent", epg_afterevent, "0"); |
---|
248 | |
---|
249 | if(getconfig("epg_refreshtime", NULL) == NULL || ostrcmp(getconfig("epg_refreshtime", NULL), "0") == 0) |
---|
250 | epgscandeltimer(); |
---|
251 | else |
---|
252 | epgscancreatetimer(); |
---|
253 | |
---|
254 | if(getconfig("epg_refreshtime", NULL) != NULL || getconfigint("epg_afterevent", NULL) != 0) |
---|
255 | { |
---|
256 | if(getconfigint("epg_listmode", NULL) == 1 || getconfigint("epg_listmode", NULL) == 3) |
---|
257 | { |
---|
258 | textbox(_("Message"), _("Deavtivate Refresh Time and After EPG in scan-mode"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 15, 0); |
---|
259 | delconfig("epg_refreshtime"); |
---|
260 | delconfig("epg_afterevent"); |
---|
261 | } |
---|
262 | } |
---|
263 | |
---|
264 | break; |
---|
265 | } |
---|
266 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
267 | { |
---|
268 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "epgpath") == 0) |
---|
269 | { |
---|
270 | clearscreen(epgsettings); |
---|
271 | ret = screendir(listbox->select->ret, "", NULL, NULL, NULL, NULL, 0, "SELECT", 0, NULL, 0, NULL, 0, 750, 0, 650, 0, 0); |
---|
272 | if(ret != NULL) |
---|
273 | changeinput(listbox->select, ret); |
---|
274 | free(ret); |
---|
275 | |
---|
276 | drawscreen(epgsettings, 0, 0); |
---|
277 | } |
---|
278 | } |
---|
279 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
280 | { |
---|
281 | drawscreen(load, 0, 0); |
---|
282 | resetepg(0); |
---|
283 | clearscreen(load); |
---|
284 | textbox(_("Message"), _("EPG resetet and now clear."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
285 | drawscreen(epgsettings, 0, 0); |
---|
286 | } |
---|
287 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
288 | { |
---|
289 | clearscreen(epgsettings); |
---|
290 | screenepgscanlist(); |
---|
291 | drawscreen(epgsettings, 0, 0); |
---|
292 | } |
---|
293 | if(rcret == getrcconfigint("rcblue", NULL)) |
---|
294 | { |
---|
295 | clearscreen(epgsettings); |
---|
296 | char* log = readfiletomem(EPGSCANLOG, 0); |
---|
297 | if(log == NULL) log = ostrcat("No log infos available.", NULL, 0, 0); |
---|
298 | textbox(_("EPG Scan Log"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); |
---|
299 | free(log); log = NULL; |
---|
300 | drawscreen(epgsettings, 0, 0); |
---|
301 | } |
---|
302 | } |
---|
303 | |
---|
304 | delownerrc(epgsettings); |
---|
305 | clearscreen(epgsettings); |
---|
306 | } |
---|
307 | |
---|
308 | #endif |
---|