1 | #include "../../titan/struct.h" |
---|
2 | #include "../../titan/debug.h" |
---|
3 | #include "../../titan/header.h" |
---|
4 | |
---|
5 | #include "lcd_weather.h" |
---|
6 | |
---|
7 | char pluginname[] = "LCD Samsung SPF.."; |
---|
8 | char plugindesc[] = "Extensions"; |
---|
9 | char pluginpic[] = "%pluginpath%/lcdsamsung/lcdsamsung.png"; |
---|
10 | |
---|
11 | int pluginaktiv = 0; |
---|
12 | //int pluginversion = PLUGINVERSION; |
---|
13 | int pluginversion = 999999; |
---|
14 | |
---|
15 | struct stimerthread* LCD_Samsung1thread = NULL; |
---|
16 | |
---|
17 | int firststart = 0; |
---|
18 | |
---|
19 | void weather_getline(FILE* fd, char* fileline) |
---|
20 | { |
---|
21 | fgets(fileline, 256, fd); |
---|
22 | if(fileline[0] == '#' || fileline[0] == '\n') |
---|
23 | return; |
---|
24 | if(fileline[strlen(fileline) - 1] == '\n') |
---|
25 | fileline[strlen(fileline) - 1] = '\0'; |
---|
26 | if(fileline[strlen(fileline) - 1] == '\r') |
---|
27 | fileline[strlen(fileline) - 1] = '\0'; |
---|
28 | } |
---|
29 | |
---|
30 | void LCD_start_lcd4linux() |
---|
31 | { |
---|
32 | int count = 0; |
---|
33 | char* startlcd = NULL; |
---|
34 | |
---|
35 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
36 | { |
---|
37 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
38 | startlcd = ostrcat(startlcd, " 1", 1, 0); |
---|
39 | } |
---|
40 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
41 | { |
---|
42 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
43 | startlcd = ostrcat(startlcd, " 6", 1, 0); |
---|
44 | } |
---|
45 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
46 | { |
---|
47 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
48 | startlcd = ostrcat(startlcd, " 3", 1, 0); |
---|
49 | } |
---|
50 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
51 | { |
---|
52 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
53 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
54 | } |
---|
55 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
56 | { |
---|
57 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
58 | startlcd = ostrcat(startlcd, " 5", 1, 0); |
---|
59 | } |
---|
60 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
61 | { |
---|
62 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
63 | startlcd = ostrcat(startlcd, " 4", 1, 0); |
---|
64 | } |
---|
65 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
66 | { |
---|
67 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
68 | startlcd = ostrcat(startlcd, " 7", 1, 0); |
---|
69 | } |
---|
70 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
71 | { |
---|
72 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
73 | startlcd = ostrcat(startlcd, " 8", 1, 0); |
---|
74 | } |
---|
75 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
76 | { |
---|
77 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
78 | startlcd = ostrcat(startlcd, " 9", 1, 0); |
---|
79 | } |
---|
80 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "none") == 0) |
---|
81 | { |
---|
82 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
83 | startlcd = ostrcat(startlcd, " 99", 1, 0); |
---|
84 | } |
---|
85 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
86 | { |
---|
87 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
88 | startlcd = ostrcat(startlcd, " 99", 1, 0); |
---|
89 | } |
---|
90 | else |
---|
91 | { |
---|
92 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
93 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
94 | } |
---|
95 | |
---|
96 | |
---|
97 | if(LCD_Samsung1thread == NULL) |
---|
98 | return; |
---|
99 | while (LCD_Samsung1thread->aktion != STOP && system("ps | grep -v grep | grep fbread") != 0) { |
---|
100 | system(startlcd); |
---|
101 | sleep(6); |
---|
102 | count ++; |
---|
103 | if(LCD_Samsung1thread == NULL) |
---|
104 | break; |
---|
105 | if(count == 101) { |
---|
106 | textbox(_("Message"), _("ERROR cant start LCD driver"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 5, 0); |
---|
107 | LCD_Samsung1thread->aktion = STOP; |
---|
108 | } |
---|
109 | } |
---|
110 | free(startlcd);startlcd=NULL; |
---|
111 | } |
---|
112 | |
---|
113 | void LCD_Samsung1_thread() |
---|
114 | { |
---|
115 | |
---|
116 | struct skin* LCD_Samsung1 = NULL; |
---|
117 | struct skin* LCD_Standby = NULL; |
---|
118 | struct skin* LCD_Play = NULL; |
---|
119 | struct skin* LCD_Music = NULL; |
---|
120 | |
---|
121 | |
---|
122 | struct skin* city = NULL; |
---|
123 | struct skin* wind = NULL; |
---|
124 | struct skin* luft = NULL; |
---|
125 | struct skin* day0_t = NULL; |
---|
126 | struct skin* day0_tm = NULL; |
---|
127 | struct skin* day0_i = NULL; |
---|
128 | struct skin* day0_d = NULL; |
---|
129 | struct skin* day0_dl = NULL; |
---|
130 | struct skin* day1_t = NULL; |
---|
131 | struct skin* day1_tm = NULL; |
---|
132 | struct skin* day1_i = NULL; |
---|
133 | struct skin* day1_d = NULL; |
---|
134 | struct skin* day1_dl = NULL; |
---|
135 | struct skin* day2_t = NULL; |
---|
136 | struct skin* day2_tm = NULL; |
---|
137 | struct skin* day2_i = NULL; |
---|
138 | struct skin* day2_d = NULL; |
---|
139 | struct skin* day2_dl = NULL; |
---|
140 | struct skin* day3_t = NULL; |
---|
141 | struct skin* day3_tm = NULL; |
---|
142 | struct skin* day3_i = NULL; |
---|
143 | struct skin* day3_d = NULL; |
---|
144 | struct skin* day3_dl = NULL; |
---|
145 | struct skin* akttime = NULL; |
---|
146 | struct skin* akttime_Standby = NULL; |
---|
147 | |
---|
148 | struct skin* n_stunde = NULL; |
---|
149 | struct skin* n_minute = NULL; |
---|
150 | struct skin* n_stunde_standby = NULL; |
---|
151 | struct skin* n_minute_standby = NULL; |
---|
152 | |
---|
153 | struct skin* n_stunde2 = NULL; |
---|
154 | struct skin* n_minute2 = NULL; |
---|
155 | struct skin* n_stunde2_standby = NULL; |
---|
156 | struct skin* n_minute2_standby = NULL; |
---|
157 | |
---|
158 | struct skin* scity = NULL; |
---|
159 | struct skin* swind = NULL; |
---|
160 | struct skin* sluft = NULL; |
---|
161 | struct skin* sday0_t = NULL; |
---|
162 | struct skin* sday0_tm = NULL; |
---|
163 | struct skin* sday0_i = NULL; |
---|
164 | struct skin* sday0_d = NULL; |
---|
165 | struct skin* sday0_dl = NULL; |
---|
166 | struct skin* sday1_t = NULL; |
---|
167 | struct skin* sday1_tm = NULL; |
---|
168 | struct skin* sday1_i = NULL; |
---|
169 | struct skin* sday1_d = NULL; |
---|
170 | struct skin* sday1_dl = NULL; |
---|
171 | struct skin* sday2_t = NULL; |
---|
172 | struct skin* sday2_tm = NULL; |
---|
173 | struct skin* sday2_i = NULL; |
---|
174 | struct skin* sday2_d = NULL; |
---|
175 | struct skin* sday2_dl = NULL; |
---|
176 | struct skin* sday3_t = NULL; |
---|
177 | struct skin* sday3_tm = NULL; |
---|
178 | struct skin* sday3_i = NULL; |
---|
179 | struct skin* sday3_d = NULL; |
---|
180 | struct skin* sday3_dl = NULL; |
---|
181 | |
---|
182 | char* tmpstr = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *timemerk = NULL, *sendermerk = NULL, *recmerk = NULL; |
---|
183 | char* pichr = NULL, *picmin = NULL, *pichr_standby = NULL, *picmin_standby = NULL; |
---|
184 | char* pichr2 = NULL, *picmin2 = NULL, *pichr2_standby = NULL, *picmin2_standby = NULL; |
---|
185 | int digitaluhr = 0, digitaluhr_standby = 0; |
---|
186 | FILE *fd = NULL; |
---|
187 | char *fileline = NULL; |
---|
188 | int weatherwrite = 999; |
---|
189 | int weatherref = 0; |
---|
190 | char* startlcd = NULL; |
---|
191 | char* bild = NULL; |
---|
192 | |
---|
193 | printf("lcd_samsung thread started\n"); |
---|
194 | |
---|
195 | if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) |
---|
196 | { |
---|
197 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
198 | LCD_Samsung1 = getscreen("LCD_spf75_Wetter"); |
---|
199 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
200 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
201 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
202 | LCD_Samsung1 = getscreen("LCD_spf83_Wetter"); |
---|
203 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
204 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
205 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
206 | LCD_Samsung1 = getscreen("LCD_spf105_Wetter"); |
---|
207 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
208 | LCD_Samsung1 = getscreen("LCD_spf107_Wetter"); |
---|
209 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
210 | LCD_Samsung1 = getscreen("LCD_spf72_Wetter"); |
---|
211 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
212 | LCD_Samsung1 = getscreen("LCD_spf85_Wetter"); |
---|
213 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
214 | LCD_Samsung1 = getscreen("LCD_spf85_Wetter"); |
---|
215 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
216 | LCD_Samsung1 = getscreen("LCD_d320_Wetter"); |
---|
217 | else |
---|
218 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
219 | city = getscreennode(LCD_Samsung1, "city"); |
---|
220 | wind = getscreennode(LCD_Samsung1, "wind"); |
---|
221 | luft = getscreennode(LCD_Samsung1, "luft"); |
---|
222 | day0_t = getscreennode(LCD_Samsung1, "day0_t"); |
---|
223 | day0_tm = getscreennode(LCD_Samsung1, "day0_tm"); |
---|
224 | day0_i = getscreennode(LCD_Samsung1, "day0_i"); |
---|
225 | day0_d = getscreennode(LCD_Samsung1, "day0_d"); |
---|
226 | day0_dl = getscreennode(LCD_Samsung1, "day0_dl"); |
---|
227 | day1_t = getscreennode(LCD_Samsung1, "day1_t"); |
---|
228 | day1_tm = getscreennode(LCD_Samsung1, "day1_tm"); |
---|
229 | day1_i = getscreennode(LCD_Samsung1, "day1_i"); |
---|
230 | day1_d = getscreennode(LCD_Samsung1, "day1_d"); |
---|
231 | day1_dl = getscreennode(LCD_Samsung1, "day1_dl"); |
---|
232 | day2_t = getscreennode(LCD_Samsung1, "day2_t"); |
---|
233 | day2_tm = getscreennode(LCD_Samsung1, "day2_tm"); |
---|
234 | day2_i = getscreennode(LCD_Samsung1, "day2_i"); |
---|
235 | day2_d = getscreennode(LCD_Samsung1, "day2_d"); |
---|
236 | day2_dl = getscreennode(LCD_Samsung1, "day2_dl"); |
---|
237 | day3_t = getscreennode(LCD_Samsung1, "day3_t"); |
---|
238 | day3_tm = getscreennode(LCD_Samsung1, "day3_tm"); |
---|
239 | day3_i = getscreennode(LCD_Samsung1, "day3_i"); |
---|
240 | day3_d = getscreennode(LCD_Samsung1, "day3_d"); |
---|
241 | day3_dl = getscreennode(LCD_Samsung1, "day3_dl"); |
---|
242 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
243 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
244 | n_stunde = getscreennode(LCD_Samsung1, "stunde"); |
---|
245 | if(n_stunde != NULL) |
---|
246 | { |
---|
247 | pichr = ostrcat(n_stunde->pic, "", 0, 0); |
---|
248 | if(ostrstr(pichr, "Digital") != NULL) |
---|
249 | digitaluhr = 1; |
---|
250 | } |
---|
251 | n_minute = getscreennode(LCD_Samsung1, "minute"); |
---|
252 | if(n_minute != NULL) |
---|
253 | picmin = ostrcat(n_minute->pic, "", 0, 0); |
---|
254 | if(digitaluhr == 1) |
---|
255 | { |
---|
256 | n_stunde2 = getscreennode(LCD_Samsung1, "stunde2"); |
---|
257 | n_minute2 = getscreennode(LCD_Samsung1, "minute2"); |
---|
258 | picmin2 = ostrcat(n_minute2->pic, "", 0, 0); |
---|
259 | pichr2 = ostrcat(n_stunde2->pic, "", 0, 0); |
---|
260 | } |
---|
261 | if(file_exist("/tmp/lcdweather")) |
---|
262 | system("rm /tmp/lcdweather"); |
---|
263 | weatherwrite = 0; |
---|
264 | } |
---|
265 | else { |
---|
266 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
267 | LCD_Samsung1 = getscreen("LCD_spf75"); |
---|
268 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
269 | LCD_Samsung1 = getscreen("LCD_spf83"); |
---|
270 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
271 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
272 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
273 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
274 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
275 | LCD_Samsung1 = getscreen("LCD_spf105"); |
---|
276 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
277 | LCD_Samsung1 = getscreen("LCD_spf107"); |
---|
278 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
279 | LCD_Samsung1 = getscreen("LCD_spf72"); |
---|
280 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
281 | LCD_Samsung1 = getscreen("LCD_spf85"); |
---|
282 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
283 | LCD_Samsung1 = getscreen("LCD_spf85"); |
---|
284 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
285 | LCD_Samsung1 = getscreen("LCD_d320"); |
---|
286 | else |
---|
287 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
288 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
289 | n_stunde = getscreennode(LCD_Samsung1, "stunde"); |
---|
290 | if(n_stunde != NULL) |
---|
291 | { |
---|
292 | pichr = ostrcat(n_stunde->pic, "", 0, 0); |
---|
293 | if(ostrstr(pichr, "Digital") != NULL) |
---|
294 | digitaluhr = 1; |
---|
295 | } |
---|
296 | n_minute = getscreennode(LCD_Samsung1, "minute"); |
---|
297 | if(n_minute != NULL) |
---|
298 | picmin = ostrcat(n_minute->pic, "", 0, 0); |
---|
299 | if(digitaluhr == 1) |
---|
300 | { |
---|
301 | n_stunde2 = getscreennode(LCD_Samsung1, "stunde2"); |
---|
302 | n_minute2 = getscreennode(LCD_Samsung1, "minute2"); |
---|
303 | picmin2 = ostrcat(n_minute2->pic, "", 0, 0); |
---|
304 | pichr2 = ostrcat(n_stunde2->pic, "", 0, 0); |
---|
305 | } |
---|
306 | } |
---|
307 | |
---|
308 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
309 | LCD_Play = getscreen("LCD_spf75_Play"); |
---|
310 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
311 | LCD_Play = getscreen("LCD_spf83_Play"); |
---|
312 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
313 | LCD_Play = getscreen("LCD_spf87_Play"); |
---|
314 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
315 | LCD_Play = getscreen("LCD_spf87_Play"); |
---|
316 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
317 | LCD_Play = getscreen("LCD_spf105_Play"); |
---|
318 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
319 | LCD_Play = getscreen("LCD_spf107_Play"); |
---|
320 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
321 | LCD_Play = getscreen("LCD_spf72_Play"); |
---|
322 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
323 | LCD_Play = getscreen("LCD_spf85_Play"); |
---|
324 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
325 | LCD_Play = getscreen("LCD_spf85_Play"); |
---|
326 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
327 | LCD_Play = getscreen("LCD_d320_Play"); |
---|
328 | else |
---|
329 | LCD_Play = getscreen("LCD_spf87_Play"); |
---|
330 | struct skin* akttimeplay = getscreennode(LCD_Play, "akttime"); |
---|
331 | struct skin* sprogress = getscreennode(LCD_Play, "progress"); |
---|
332 | struct skin* stitle = getscreennode(LCD_Play, "title1"); |
---|
333 | struct skin* spos = getscreennode(LCD_Play, "pos"); |
---|
334 | struct skin* slen = getscreennode(LCD_Play, "len"); |
---|
335 | struct skin* sreverse = getscreennode(LCD_Play, "reverse"); |
---|
336 | |
---|
337 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
338 | LCD_Music = getscreen("LCD_spf75_Music"); |
---|
339 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
340 | LCD_Music = getscreen("LCD_spf83_Music"); |
---|
341 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
342 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
343 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
344 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
345 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
346 | LCD_Music = getscreen("LCD_spf105_Music"); |
---|
347 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
348 | LCD_Music = getscreen("LCD_spf107_Music"); |
---|
349 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
350 | LCD_Music = getscreen("LCD_spf72_Music"); |
---|
351 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
352 | LCD_Music = getscreen("LCD_spf85_Music"); |
---|
353 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
354 | LCD_Music = getscreen("LCD_spf85_Music"); |
---|
355 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
356 | LCD_Music = getscreen("LCD_d320_Music"); |
---|
357 | else |
---|
358 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
359 | |
---|
360 | struct skin* mthumb = getscreennode(LCD_Music, "lthumb"); |
---|
361 | struct skin* mtitle = getscreennode(LCD_Music, "ltitle"); |
---|
362 | struct skin* malbum = getscreennode(LCD_Music, "lalbum"); |
---|
363 | struct skin* mactors = getscreennode(LCD_Music, "lactors"); |
---|
364 | struct skin* mrealname = getscreennode(LCD_Music, "lrealname"); |
---|
365 | struct skin* mgenre = getscreennode(LCD_Music, "lgenre"); |
---|
366 | struct skin* myear = getscreennode(LCD_Music, "lyear"); |
---|
367 | struct skin* makttimeplay = getscreennode(LCD_Music, "akttime"); |
---|
368 | struct skin* mprogress = getscreennode(LCD_Music, "progress"); |
---|
369 | struct skin* mtitle1 = getscreennode(LCD_Music, "title1"); |
---|
370 | struct skin* mpos = getscreennode(LCD_Music, "pos"); |
---|
371 | struct skin* mlen = getscreennode(LCD_Music, "len"); |
---|
372 | struct skin* mreverse = getscreennode(LCD_Music, "reverse"); |
---|
373 | |
---|
374 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
375 | { |
---|
376 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
377 | startlcd = ostrcat(startlcd, " 1", 1, 0); |
---|
378 | } |
---|
379 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
380 | { |
---|
381 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
382 | startlcd = ostrcat(startlcd, " 6", 1, 0); |
---|
383 | } |
---|
384 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
385 | { |
---|
386 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
387 | startlcd = ostrcat(startlcd, " 3", 1, 0); |
---|
388 | } |
---|
389 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
390 | { |
---|
391 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
392 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
393 | } |
---|
394 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
395 | { |
---|
396 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
397 | startlcd = ostrcat(startlcd, " 5", 1, 0); |
---|
398 | } |
---|
399 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
400 | { |
---|
401 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
402 | startlcd = ostrcat(startlcd, " 4", 1, 0); |
---|
403 | } |
---|
404 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
405 | { |
---|
406 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
407 | startlcd = ostrcat(startlcd, " 7", 1, 0); |
---|
408 | } |
---|
409 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
410 | { |
---|
411 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
412 | startlcd = ostrcat(startlcd, " 8", 1, 0); |
---|
413 | } |
---|
414 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
415 | { |
---|
416 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
417 | startlcd = ostrcat(startlcd, " 9", 1, 0); |
---|
418 | } |
---|
419 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "none") == 0) |
---|
420 | { |
---|
421 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
422 | startlcd = ostrcat(startlcd, " 99", 1, 0); |
---|
423 | } |
---|
424 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
425 | { |
---|
426 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
427 | startlcd = ostrcat(startlcd, " 98 ", 1, 0); |
---|
428 | startlcd = ostrcat(startlcd, getconfig("lcd_samsung_ip", NULL), 1, 0); |
---|
429 | } |
---|
430 | else |
---|
431 | { |
---|
432 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
433 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
434 | } |
---|
435 | |
---|
436 | |
---|
437 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
438 | { |
---|
439 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
440 | LCD_Standby = getscreen("LCD_spf75_Standby"); |
---|
441 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
442 | LCD_Standby = getscreen("LCD_spf83_Standby"); |
---|
443 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
444 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
445 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
446 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
447 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
448 | LCD_Standby = getscreen("LCD_spf105_Standby"); |
---|
449 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
450 | LCD_Standby = getscreen("LCD_spf107_Standby"); |
---|
451 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
452 | LCD_Standby = getscreen("LCD_spf72_Standby"); |
---|
453 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
454 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
455 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
456 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
457 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
458 | LCD_Standby = getscreen("LCD_d320_Standby"); |
---|
459 | else |
---|
460 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
461 | akttime_Standby = getscreennode(LCD_Standby, "akttime"); |
---|
462 | scity = getscreennode(LCD_Standby, "city"); |
---|
463 | swind = getscreennode(LCD_Standby, "wind"); |
---|
464 | sluft = getscreennode(LCD_Standby, "luft"); |
---|
465 | sday0_t = getscreennode(LCD_Standby, "day0_t"); |
---|
466 | sday0_tm = getscreennode(LCD_Standby, "day0_tm"); |
---|
467 | sday0_i = getscreennode(LCD_Standby, "day0_i"); |
---|
468 | sday0_d = getscreennode(LCD_Standby, "day0_d"); |
---|
469 | sday0_dl = getscreennode(LCD_Standby, "day0_dl"); |
---|
470 | sday1_t = getscreennode(LCD_Standby, "day1_t"); |
---|
471 | sday1_tm = getscreennode(LCD_Standby, "day1_tm"); |
---|
472 | sday1_i = getscreennode(LCD_Standby, "day1_i"); |
---|
473 | sday1_d = getscreennode(LCD_Standby, "day1_d"); |
---|
474 | sday1_dl = getscreennode(LCD_Standby, "day1_dl"); |
---|
475 | sday2_t = getscreennode(LCD_Standby, "day2_t"); |
---|
476 | sday2_tm = getscreennode(LCD_Standby, "day2_tm"); |
---|
477 | sday2_i = getscreennode(LCD_Standby, "day2_i"); |
---|
478 | sday2_d = getscreennode(LCD_Standby, "day2_d"); |
---|
479 | sday2_dl = getscreennode(LCD_Standby, "day2_dl"); |
---|
480 | sday3_t = getscreennode(LCD_Standby, "day3_t"); |
---|
481 | sday3_tm = getscreennode(LCD_Standby, "day3_tm"); |
---|
482 | sday3_i = getscreennode(LCD_Standby, "day3_i"); |
---|
483 | sday3_d = getscreennode(LCD_Standby, "day3_d"); |
---|
484 | sday3_dl = getscreennode(LCD_Standby, "day3_dl"); |
---|
485 | |
---|
486 | n_stunde_standby = getscreennode(LCD_Standby, "stunde"); |
---|
487 | if(n_stunde_standby != NULL) |
---|
488 | { |
---|
489 | pichr_standby = ostrcat(n_stunde_standby->pic, "", 0, 0); |
---|
490 | if(ostrstr(pichr_standby, "Digital") != NULL) |
---|
491 | digitaluhr_standby = 1; |
---|
492 | } |
---|
493 | n_minute_standby = getscreennode(LCD_Standby, "minute"); |
---|
494 | if(n_minute_standby != NULL) |
---|
495 | picmin_standby = ostrcat(n_minute_standby->pic, "", 0, 0); |
---|
496 | if(digitaluhr_standby == 1) |
---|
497 | { |
---|
498 | n_stunde2_standby = getscreennode(LCD_Standby, "stunde2"); |
---|
499 | n_minute2_standby = getscreennode(LCD_Standby, "minute2"); |
---|
500 | picmin2_standby = ostrcat(n_minute2_standby->pic, "", 0, 0); |
---|
501 | pichr2_standby = ostrcat(n_stunde2_standby->pic, "", 0, 0); |
---|
502 | } |
---|
503 | } |
---|
504 | |
---|
505 | |
---|
506 | int put = 0, typemerk = 0, type = 0; |
---|
507 | int standby = 0; |
---|
508 | |
---|
509 | unsigned long long int pos = 0, len = 0, reverse = 0; |
---|
510 | int playertype = 0; |
---|
511 | int loopcount = 0; |
---|
512 | |
---|
513 | int hr = 0, min = 0; |
---|
514 | |
---|
515 | if(firststart == 1) |
---|
516 | sleep(8); |
---|
517 | firststart = 0; |
---|
518 | status.write_png = 0; |
---|
519 | //if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) |
---|
520 | // status.write_png = 1; |
---|
521 | |
---|
522 | while (LCD_Samsung1thread->aktion != STOP) { |
---|
523 | |
---|
524 | tmpstr = gettime(NULL, "%H:%M"); |
---|
525 | hr = atoi(gettime(NULL, "%H")); |
---|
526 | min = atoi(gettime(NULL, "%M")); |
---|
527 | |
---|
528 | // TV Programm läuft |
---|
529 | if(status.infobaraktiv == 1) |
---|
530 | { |
---|
531 | if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) { |
---|
532 | //status.write_png = 1; |
---|
533 | if(type == 999) |
---|
534 | system("killall -3 fbread"); |
---|
535 | } |
---|
536 | tmpstr2 = getaktchannelname(NULL); |
---|
537 | tmpstr3 = getrec(NULL, NULL); |
---|
538 | type = 1; |
---|
539 | } |
---|
540 | // Musik wird abgespielt |
---|
541 | else if((status.playspeed != 0 || status.play != 0 || status.pause != 0) && musicdat.act == 1 && LCD_Music != NULL) |
---|
542 | { |
---|
543 | if(type == 999) |
---|
544 | system("killall -3 fbread"); |
---|
545 | //status.write_png = 0; |
---|
546 | loopcount++ ; |
---|
547 | type = 3; |
---|
548 | } |
---|
549 | // Aufzeichnung wird abgespielt |
---|
550 | else if(status.playspeed != 0 || status.play != 0 || status.pause != 0) |
---|
551 | { |
---|
552 | if(type == 999) |
---|
553 | system("killall -3 fbread"); |
---|
554 | //status.write_png = 0; |
---|
555 | loopcount++ ; |
---|
556 | type = 2; |
---|
557 | } |
---|
558 | // Sonstige Anzeigen |
---|
559 | else if(type != 999) |
---|
560 | { |
---|
561 | if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) { |
---|
562 | //status.write_png = 1; |
---|
563 | system("killall -1 fbread"); |
---|
564 | } |
---|
565 | type = 999; |
---|
566 | } |
---|
567 | else |
---|
568 | type = 999; |
---|
569 | |
---|
570 | if(typemerk != type) |
---|
571 | { |
---|
572 | put = 1; |
---|
573 | typemerk = type; |
---|
574 | free(sendermerk);sendermerk=NULL; |
---|
575 | free(recmerk);recmerk=NULL; |
---|
576 | loopcount = 0; |
---|
577 | } |
---|
578 | else |
---|
579 | put = 0; |
---|
580 | |
---|
581 | if(status.standby > 0 && standby == 0) |
---|
582 | { |
---|
583 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
584 | standby = 2; |
---|
585 | else |
---|
586 | { |
---|
587 | tmpstr = createpluginpath("/lcdsamsung/standby.jpg", 0); |
---|
588 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
589 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
590 | system(tmpstr); |
---|
591 | free(tmpstr); tmpstr=NULL; |
---|
592 | sleep(3); |
---|
593 | |
---|
594 | tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0); |
---|
595 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
596 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
597 | system(tmpstr); |
---|
598 | sleep(2); |
---|
599 | system("killall fbread"); |
---|
600 | standby = 1; |
---|
601 | } |
---|
602 | } |
---|
603 | if(status.standby == 0 && standby > 0) |
---|
604 | { |
---|
605 | if(standby == 1) |
---|
606 | system(startlcd); |
---|
607 | standby = 0; |
---|
608 | put = 1; |
---|
609 | } |
---|
610 | |
---|
611 | if(weatherthread == NULL && weatherwrite == 0) |
---|
612 | { |
---|
613 | if(file_exist("/tmp/lcdweather")) |
---|
614 | put = 1; |
---|
615 | } |
---|
616 | if(ostrcmp(tmpstr, timemerk) != 0) |
---|
617 | { |
---|
618 | free(timemerk);timemerk=NULL; |
---|
619 | timemerk = ostrcat(tmpstr, "", 0, 0); |
---|
620 | put = 1; |
---|
621 | } |
---|
622 | |
---|
623 | if(standby == 0 || standby == 2 ) |
---|
624 | { |
---|
625 | if(type == 1 && standby == 0) |
---|
626 | { |
---|
627 | if(ostrcmp(tmpstr2, sendermerk) != 0) |
---|
628 | { |
---|
629 | free(sendermerk);sendermerk=NULL; |
---|
630 | sendermerk = ostrcat(tmpstr2, "", 0, 0); |
---|
631 | put = 1; |
---|
632 | } |
---|
633 | if(tmpstr3 == NULL && recmerk != NULL) |
---|
634 | { |
---|
635 | put = 1; |
---|
636 | free(recmerk);recmerk=NULL; |
---|
637 | } |
---|
638 | else if(tmpstr3 != NULL && recmerk == NULL) |
---|
639 | { |
---|
640 | free(recmerk);recmerk=NULL; |
---|
641 | recmerk = ostrcat(tmpstr3, "", 0, 0); |
---|
642 | put = 1; |
---|
643 | } |
---|
644 | } |
---|
645 | else if(type == 2) |
---|
646 | { |
---|
647 | if(loopcount >= 15) |
---|
648 | { |
---|
649 | put = 1; |
---|
650 | loopcount = 0; |
---|
651 | } |
---|
652 | } |
---|
653 | else if(type == 3) |
---|
654 | { |
---|
655 | if(loopcount >= 15) |
---|
656 | { |
---|
657 | put = 1; |
---|
658 | loopcount = 0; |
---|
659 | } |
---|
660 | } |
---|
661 | |
---|
662 | if(put == 1) |
---|
663 | { |
---|
664 | if(type == 1) |
---|
665 | { |
---|
666 | // Wettervorhersage |
---|
667 | printf("lcd_samsung wetter = %s\n", getconfig("lcd_samsung_plugin_wetter", NULL)); |
---|
668 | if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) |
---|
669 | { |
---|
670 | if(weatherwrite == 0) |
---|
671 | { |
---|
672 | printf("lcd_samsung weatherwrite=0\n"); |
---|
673 | if(weatherthread == NULL) |
---|
674 | { |
---|
675 | printf("lcd_samsung weatherthread=NULL\n"); |
---|
676 | if(!file_exist("/tmp/lcdweather")) |
---|
677 | weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); |
---|
678 | else |
---|
679 | { |
---|
680 | fileline = malloc(256); |
---|
681 | if(fileline != NULL) |
---|
682 | { |
---|
683 | fd = fopen("/tmp/lcdweather", "r"); |
---|
684 | if(fd != NULL) |
---|
685 | { |
---|
686 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
687 | { |
---|
688 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
689 | changetext(day0_d, fileline); |
---|
690 | changetext(sday0_d, fileline); |
---|
691 | weather_getline(fd, fileline); |
---|
692 | changetext(day0_tm, fileline); |
---|
693 | changetext(sday0_tm, fileline); |
---|
694 | weather_getline(fd, fileline); |
---|
695 | changetext(day0_t, fileline); |
---|
696 | changetext(sday0_t, fileline); |
---|
697 | weather_getline(fd, fileline); |
---|
698 | weather_getline(fd, fileline); |
---|
699 | changepic(day0_i, fileline); |
---|
700 | changepic(sday0_i, fileline); |
---|
701 | |
---|
702 | weather_getline(fd, fileline); |
---|
703 | changetext(day1_d, fileline); |
---|
704 | changetext(sday1_d, fileline); |
---|
705 | weather_getline(fd, fileline); |
---|
706 | changetext(day1_tm, fileline); |
---|
707 | changetext(sday1_tm, fileline); |
---|
708 | weather_getline(fd, fileline); |
---|
709 | changetext(day1_t, fileline); |
---|
710 | changetext(sday1_t, fileline); |
---|
711 | weather_getline(fd, fileline); |
---|
712 | weather_getline(fd, fileline); |
---|
713 | changepic(day1_i, fileline); |
---|
714 | changepic(sday1_i, fileline); |
---|
715 | |
---|
716 | weather_getline(fd, fileline); |
---|
717 | changetext(day2_d, fileline); |
---|
718 | changetext(sday2_d, fileline); |
---|
719 | weather_getline(fd, fileline); |
---|
720 | changetext(day2_tm, fileline); |
---|
721 | changetext(sday2_tm, fileline); |
---|
722 | weather_getline(fd, fileline); |
---|
723 | changetext(day2_t, fileline); |
---|
724 | changetext(sday2_t, fileline); |
---|
725 | weather_getline(fd, fileline); |
---|
726 | weather_getline(fd, fileline); |
---|
727 | changepic(day2_i, fileline); |
---|
728 | changepic(sday2_i, fileline); |
---|
729 | |
---|
730 | weather_getline(fd, fileline); |
---|
731 | changetext(day3_d, fileline); |
---|
732 | changetext(sday3_d, fileline); |
---|
733 | weather_getline(fd, fileline); |
---|
734 | changetext(day3_tm, fileline); |
---|
735 | changetext(sday3_tm, fileline); |
---|
736 | weather_getline(fd, fileline); |
---|
737 | changetext(day3_t, fileline); |
---|
738 | changetext(sday3_t, fileline); |
---|
739 | weather_getline(fd, fileline); |
---|
740 | weather_getline(fd, fileline); |
---|
741 | changepic(day3_i, fileline); |
---|
742 | changepic(sday3_i, fileline); |
---|
743 | |
---|
744 | weather_getline(fd, fileline); |
---|
745 | changepic(city, fileline); |
---|
746 | changepic(scity, fileline); |
---|
747 | weather_getline(fd, fileline); |
---|
748 | changetext(wind, fileline); |
---|
749 | changetext(swind, fileline); |
---|
750 | weather_getline(fd, fileline); |
---|
751 | changetext(luft, fileline); |
---|
752 | changetext(sluft, fileline); |
---|
753 | weather_getline(fd, fileline); |
---|
754 | changetext(day0_dl, fileline); |
---|
755 | changetext(sday0_dl, fileline); |
---|
756 | weather_getline(fd, fileline); |
---|
757 | changetext(day1_dl, fileline); |
---|
758 | changetext(sday1_dl, fileline); |
---|
759 | weather_getline(fd, fileline); |
---|
760 | changetext(day2_dl, fileline); |
---|
761 | changetext(sday2_dl, fileline); |
---|
762 | weather_getline(fd, fileline); |
---|
763 | changetext(day3_dl, fileline); |
---|
764 | changetext(sday3_dl, fileline); |
---|
765 | |
---|
766 | } |
---|
767 | else |
---|
768 | { |
---|
769 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
770 | changetext(day0_d, fileline); |
---|
771 | weather_getline(fd, fileline); |
---|
772 | changetext(day0_tm, fileline); |
---|
773 | weather_getline(fd, fileline); |
---|
774 | changetext(day0_t, fileline); |
---|
775 | weather_getline(fd, fileline); |
---|
776 | weather_getline(fd, fileline); |
---|
777 | changepic(day0_i, fileline); |
---|
778 | |
---|
779 | weather_getline(fd, fileline); |
---|
780 | changetext(day1_d, fileline); |
---|
781 | weather_getline(fd, fileline); |
---|
782 | changetext(day1_tm, fileline); |
---|
783 | weather_getline(fd, fileline); |
---|
784 | changetext(day1_t, fileline); |
---|
785 | weather_getline(fd, fileline); |
---|
786 | weather_getline(fd, fileline); |
---|
787 | changepic(day1_i, fileline); |
---|
788 | |
---|
789 | weather_getline(fd, fileline); |
---|
790 | changetext(day2_d, fileline); |
---|
791 | weather_getline(fd, fileline); |
---|
792 | changetext(day2_tm, fileline); |
---|
793 | weather_getline(fd, fileline); |
---|
794 | changetext(day2_t, fileline); |
---|
795 | weather_getline(fd, fileline); |
---|
796 | weather_getline(fd, fileline); |
---|
797 | changepic(day2_i, fileline); |
---|
798 | |
---|
799 | weather_getline(fd, fileline); |
---|
800 | changetext(day3_d, fileline); |
---|
801 | weather_getline(fd, fileline); |
---|
802 | changetext(day3_tm, fileline); |
---|
803 | weather_getline(fd, fileline); |
---|
804 | changetext(day3_t, fileline); |
---|
805 | weather_getline(fd, fileline); |
---|
806 | weather_getline(fd, fileline); |
---|
807 | changepic(day3_i, fileline); |
---|
808 | |
---|
809 | weather_getline(fd, fileline); |
---|
810 | changepic(city, fileline); |
---|
811 | weather_getline(fd, fileline); |
---|
812 | changetext(wind, fileline); |
---|
813 | weather_getline(fd, fileline); |
---|
814 | changetext(luft, fileline); |
---|
815 | weather_getline(fd, fileline); |
---|
816 | changetext(day0_dl, fileline); |
---|
817 | weather_getline(fd, fileline); |
---|
818 | changetext(day1_dl, fileline); |
---|
819 | weather_getline(fd, fileline); |
---|
820 | changetext(day2_dl, fileline); |
---|
821 | weather_getline(fd, fileline); |
---|
822 | changetext(day3_dl, fileline); |
---|
823 | } |
---|
824 | fclose(fd); |
---|
825 | } |
---|
826 | free(fileline); fileline=NULL; |
---|
827 | } |
---|
828 | weatherwrite = 1; |
---|
829 | } |
---|
830 | } |
---|
831 | } |
---|
832 | } |
---|
833 | if(standby == 0) |
---|
834 | { |
---|
835 | if(akttime != NULL) |
---|
836 | changetext(akttime, tmpstr); |
---|
837 | if(n_minute != NULL && digitaluhr == 0) |
---|
838 | { |
---|
839 | free(tmpstr);tmpstr=NULL; |
---|
840 | tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); |
---|
841 | free(n_minute->pic); |
---|
842 | n_minute->pic = string_replace("min_mm", tmpstr, picmin, 0); |
---|
843 | free(tmpstr);tmpstr=NULL; |
---|
844 | } |
---|
845 | if(n_stunde != NULL && digitaluhr == 0) |
---|
846 | { |
---|
847 | free(tmpstr);tmpstr=NULL; |
---|
848 | if(hr >= 12) |
---|
849 | hr = hr - 12; |
---|
850 | if(hr < 10) |
---|
851 | tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); |
---|
852 | else |
---|
853 | tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); |
---|
854 | if(min < 12) |
---|
855 | tmpstr = ostrcat(tmpstr,"00", 0, 0); |
---|
856 | else if(min < 24) |
---|
857 | tmpstr = ostrcat(tmpstr,"12", 0, 0); |
---|
858 | else if(min < 36) |
---|
859 | tmpstr = ostrcat(tmpstr,"24", 0, 0); |
---|
860 | else if(min < 48) |
---|
861 | tmpstr = ostrcat(tmpstr,"36", 0, 0); |
---|
862 | else if(min < 60) |
---|
863 | tmpstr = ostrcat(tmpstr,"48", 0, 0); |
---|
864 | free(n_stunde->pic); |
---|
865 | n_stunde->pic = string_replace("hr_hhmm", tmpstr, pichr, 0); |
---|
866 | free(tmpstr);tmpstr=NULL; |
---|
867 | } |
---|
868 | if(digitaluhr == 1) |
---|
869 | { |
---|
870 | free(tmpstr);tmpstr=NULL; |
---|
871 | tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); |
---|
872 | n_stunde->pic = string_replace("wert_w", tmpstr, pichr, 0); |
---|
873 | free(tmpstr);tmpstr=NULL; |
---|
874 | tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); |
---|
875 | n_stunde2->pic = string_replace("wert_w", tmpstr, pichr2, 0); |
---|
876 | free(tmpstr);tmpstr=NULL; |
---|
877 | tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); |
---|
878 | n_minute->pic = string_replace("wert_w", tmpstr, picmin, 0); |
---|
879 | free(tmpstr);tmpstr=NULL; |
---|
880 | tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); |
---|
881 | n_minute2->pic = string_replace("wert_w", tmpstr, picmin2, 0); |
---|
882 | free(tmpstr);tmpstr=NULL; |
---|
883 | } |
---|
884 | |
---|
885 | m_lock(&status.drawingmutex, 0); |
---|
886 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
887 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
888 | m_unlock(&status.drawingmutex, 0); |
---|
889 | } |
---|
890 | else if(standby == 2) |
---|
891 | { |
---|
892 | if(akttime_Standby != NULL) |
---|
893 | changetext(akttime_Standby, tmpstr); |
---|
894 | if(n_minute_standby != NULL && digitaluhr_standby == 0) |
---|
895 | { |
---|
896 | free(tmpstr);tmpstr=NULL; |
---|
897 | tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); |
---|
898 | free(n_minute_standby->pic); |
---|
899 | n_minute_standby->pic = string_replace("min_mm", tmpstr, picmin_standby, 0); |
---|
900 | free(tmpstr);tmpstr=NULL; |
---|
901 | } |
---|
902 | if(n_stunde_standby != NULL && digitaluhr_standby == 0) |
---|
903 | { |
---|
904 | free(tmpstr);tmpstr=NULL; |
---|
905 | if(hr >= 12) |
---|
906 | hr = hr - 12; |
---|
907 | if(hr < 10) |
---|
908 | tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); |
---|
909 | else |
---|
910 | tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); |
---|
911 | if(min < 12) |
---|
912 | tmpstr = ostrcat(tmpstr,"00", 0, 0); |
---|
913 | else if(min < 24) |
---|
914 | tmpstr = ostrcat(tmpstr,"12", 0, 0); |
---|
915 | else if(min < 36) |
---|
916 | tmpstr = ostrcat(tmpstr,"24", 0, 0); |
---|
917 | else if(min < 48) |
---|
918 | tmpstr = ostrcat(tmpstr,"36", 0, 0); |
---|
919 | else if(min < 60) |
---|
920 | tmpstr = ostrcat(tmpstr,"48", 0, 0); |
---|
921 | free(n_stunde_standby->pic); |
---|
922 | n_stunde_standby->pic = string_replace("hr_hhmm", tmpstr, pichr_standby, 0); |
---|
923 | free(tmpstr);tmpstr=NULL; |
---|
924 | } |
---|
925 | if(digitaluhr_standby == 1) |
---|
926 | { |
---|
927 | free(tmpstr);tmpstr=NULL; |
---|
928 | tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); |
---|
929 | n_stunde_standby->pic = string_replace("wert_w", tmpstr, pichr_standby, 0); |
---|
930 | free(tmpstr);tmpstr=NULL; |
---|
931 | tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); |
---|
932 | n_stunde2_standby->pic = string_replace("wert_w", tmpstr, pichr2_standby, 0); |
---|
933 | free(tmpstr);tmpstr=NULL; |
---|
934 | tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); |
---|
935 | n_minute_standby->pic = string_replace("wert_w", tmpstr, picmin_standby, 0); |
---|
936 | free(tmpstr);tmpstr=NULL; |
---|
937 | tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); |
---|
938 | n_minute2_standby->pic = string_replace("wert_w", tmpstr, picmin2_standby, 0); |
---|
939 | free(tmpstr);tmpstr=NULL; |
---|
940 | } |
---|
941 | m_lock(&status.drawingmutex, 0); |
---|
942 | drawscreen(LCD_Standby, 0, 2); |
---|
943 | m_unlock(&status.drawingmutex, 0); |
---|
944 | put = 0; |
---|
945 | } |
---|
946 | } |
---|
947 | else if(type == 2) |
---|
948 | { |
---|
949 | playertype = getconfigint("lastplayertype", NULL); |
---|
950 | //if(status.mcaktiv == 1) |
---|
951 | //playertype = 0; |
---|
952 | //else |
---|
953 | ////playertype = getconfigint("playertype", NULL); |
---|
954 | //playertype = 1; |
---|
955 | |
---|
956 | if(playertype == 1) |
---|
957 | { |
---|
958 | unsigned long long int startpos = 0; |
---|
959 | playergetinfots(&len, &startpos, NULL, &pos, NULL, 0); |
---|
960 | len = len / 90000; |
---|
961 | pos = (pos - startpos) / 90000; |
---|
962 | } |
---|
963 | else |
---|
964 | { |
---|
965 | pos = playergetpts() / 90000; |
---|
966 | len = playergetlength(); |
---|
967 | } |
---|
968 | if(pos < 0) pos = 0; |
---|
969 | reverse = len - pos; |
---|
970 | if(len == 0) |
---|
971 | sprogress->progresssize = 0; |
---|
972 | else |
---|
973 | sprogress->progresssize = pos * 100 / len; |
---|
974 | |
---|
975 | tmpstr2 = convert_timesec(pos); |
---|
976 | changetext(spos, tmpstr2); |
---|
977 | free(tmpstr2); tmpstr2 = NULL; |
---|
978 | |
---|
979 | tmpstr2 = convert_timesec(len); |
---|
980 | changetext(slen, tmpstr2); |
---|
981 | free(tmpstr2); tmpstr2 = NULL; |
---|
982 | |
---|
983 | tmpstr2 = convert_timesec(reverse); |
---|
984 | changetext(sreverse, tmpstr2); |
---|
985 | free(tmpstr2); tmpstr2 = NULL; |
---|
986 | |
---|
987 | changetext(akttimeplay, tmpstr); |
---|
988 | changetext(stitle, basename(status.playfile)); |
---|
989 | m_lock(&status.drawingmutex, 0); |
---|
990 | if(drawscreen(LCD_Play, 0, 2) == -2) |
---|
991 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
992 | m_unlock(&status.drawingmutex, 0); |
---|
993 | } |
---|
994 | else if(type == 3) |
---|
995 | { |
---|
996 | pos = playergetpts() / 90000; |
---|
997 | len = playergetlength(); |
---|
998 | if(pos < 0) pos = 0; |
---|
999 | reverse = len - pos; |
---|
1000 | if(len == 0) |
---|
1001 | mprogress->progresssize = 0; |
---|
1002 | else |
---|
1003 | mprogress->progresssize = pos * 100 / len; |
---|
1004 | |
---|
1005 | tmpstr2 = convert_timesec(pos); |
---|
1006 | changetext(mpos, tmpstr2); |
---|
1007 | free(tmpstr2); tmpstr2 = NULL; |
---|
1008 | |
---|
1009 | tmpstr2 = convert_timesec(len); |
---|
1010 | changetext(mlen, tmpstr2); |
---|
1011 | free(tmpstr2); tmpstr2 = NULL; |
---|
1012 | |
---|
1013 | tmpstr2 = convert_timesec(reverse); |
---|
1014 | changetext(mreverse, tmpstr2); |
---|
1015 | free(tmpstr2); tmpstr2 = NULL; |
---|
1016 | |
---|
1017 | changetext(makttimeplay, tmpstr); |
---|
1018 | changetext(mtitle1, basename(status.playfile)); |
---|
1019 | |
---|
1020 | changetext(mtitle, musicdat.title); |
---|
1021 | changetext(malbum, musicdat.album); |
---|
1022 | changetext(mrealname, musicdat.realname); |
---|
1023 | changetext(mgenre, musicdat.genre); |
---|
1024 | changetext(myear, musicdat.year); |
---|
1025 | changetext(mactors, musicdat.actors); |
---|
1026 | |
---|
1027 | //if(file_exist(musicdat.thumb)) |
---|
1028 | if(file_exist("/tmp/mccover.jpg")) |
---|
1029 | { |
---|
1030 | mthumb->hidden = NO; |
---|
1031 | changepic(mthumb, musicdat.thumb); |
---|
1032 | } |
---|
1033 | else |
---|
1034 | mthumb->hidden = YES; |
---|
1035 | |
---|
1036 | m_lock(&status.drawingmutex, 0); |
---|
1037 | if(drawscreen(LCD_Music, 0, 2) == -2) |
---|
1038 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
1039 | m_unlock(&status.drawingmutex, 0); |
---|
1040 | } |
---|
1041 | } |
---|
1042 | } |
---|
1043 | else |
---|
1044 | { |
---|
1045 | if(standby == 2) |
---|
1046 | { |
---|
1047 | if(put == 1) |
---|
1048 | { |
---|
1049 | changetext(akttime_Standby, tmpstr); |
---|
1050 | m_lock(&status.drawingmutex, 0); |
---|
1051 | drawscreen(LCD_Standby, 0, 2); |
---|
1052 | m_unlock(&status.drawingmutex, 0); |
---|
1053 | put = 0; |
---|
1054 | } |
---|
1055 | } |
---|
1056 | } |
---|
1057 | |
---|
1058 | free(tmpstr); tmpstr = NULL; |
---|
1059 | free(tmpstr2); tmpstr2 = NULL; |
---|
1060 | free(tmpstr3); tmpstr3 = NULL; |
---|
1061 | //sleep(1); |
---|
1062 | usleep(500000); |
---|
1063 | |
---|
1064 | if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) |
---|
1065 | { |
---|
1066 | weatherref = weatherref + 1; |
---|
1067 | if(weatherref == 7200) |
---|
1068 | { |
---|
1069 | weatherwrite = 0; |
---|
1070 | system("rm /tmp/lcdweather"); |
---|
1071 | weatherref = 0; |
---|
1072 | } |
---|
1073 | } |
---|
1074 | } |
---|
1075 | free(timemerk);timemerk=NULL; |
---|
1076 | free(sendermerk);sendermerk=NULL; |
---|
1077 | free(recmerk);recmerk=NULL; |
---|
1078 | free(startlcd);startlcd=NULL; |
---|
1079 | free(pichr);pichr=NULL; |
---|
1080 | free(picmin);picmin=NULL; |
---|
1081 | free(pichr_standby);pichr=NULL; |
---|
1082 | free(picmin_standby);picmin=NULL; |
---|
1083 | free(pichr2);pichr2=NULL; |
---|
1084 | free(picmin2);picmin2=NULL; |
---|
1085 | free(pichr2_standby);pichr2_standby=NULL; |
---|
1086 | free(picmin2_standby);picmin2_standby=NULL; |
---|
1087 | addconfig("lcd_samsung_plugin_running", "no"); |
---|
1088 | LCD_Samsung1thread = NULL; |
---|
1089 | m_lock(&status.drawingmutex, 0); |
---|
1090 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
1091 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
1092 | m_unlock(&status.drawingmutex, 0); |
---|
1093 | //status.write_png = 0; |
---|
1094 | return; |
---|
1095 | } |
---|
1096 | |
---|
1097 | void LCD_Samsung1_main() |
---|
1098 | { |
---|
1099 | if(LCD_Samsung1thread == NULL) |
---|
1100 | { |
---|
1101 | char* tmpstr = NULL; |
---|
1102 | |
---|
1103 | tmpstr = createpluginpath("/lcdsamsung/start.png", 0); |
---|
1104 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
1105 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
1106 | system(tmpstr); |
---|
1107 | free(tmpstr); tmpstr=NULL; |
---|
1108 | addconfig("lcd_samsung_plugin_running", "yes"); |
---|
1109 | LCD_Samsung1thread = addtimer(&LCD_Samsung1_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
1110 | addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL); |
---|
1111 | sleep(1); |
---|
1112 | } |
---|
1113 | else |
---|
1114 | { |
---|
1115 | LCD_Samsung1thread->aktion = STOP; |
---|
1116 | system("echo ende > /tmp/titanlcd.jpg"); |
---|
1117 | sleep(1); |
---|
1118 | system("killall fbread"); |
---|
1119 | } |
---|
1120 | } |
---|
1121 | |
---|
1122 | //wird beim laden ausgefuehrt |
---|
1123 | void init(void) |
---|
1124 | { |
---|
1125 | char* tmpstr = NULL; |
---|
1126 | pluginaktiv = 1; |
---|
1127 | firststart = 1; |
---|
1128 | |
---|
1129 | tmpstr = ostrcat("/var/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1130 | if(!file_exist(tmpstr)) |
---|
1131 | { |
---|
1132 | free(tmpstr); tmpstr = NULL; |
---|
1133 | tmpstr = ostrcat("/var/swap/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1134 | } |
---|
1135 | if(!file_exist(tmpstr)) |
---|
1136 | { |
---|
1137 | free(tmpstr); tmpstr = NULL; |
---|
1138 | tmpstr = ostrcat("/mnt/swapextensions/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1139 | } |
---|
1140 | if(!file_exist(tmpstr)) |
---|
1141 | { |
---|
1142 | free(tmpstr); tmpstr = NULL; |
---|
1143 | tmpstr = createpluginpath("/lcdsamsung/skin.xml", 0); |
---|
1144 | } |
---|
1145 | |
---|
1146 | printf("use skin: %s\n", tmpstr); |
---|
1147 | |
---|
1148 | readscreen(tmpstr, 119, 1); |
---|
1149 | free(tmpstr); tmpstr = NULL; |
---|
1150 | |
---|
1151 | tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0); |
---|
1152 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
1153 | tmpstr = ostrcat(tmpstr, " /tmp/fbreadstop.jpg", 1, 0); |
---|
1154 | |
---|
1155 | system(tmpstr); |
---|
1156 | free(tmpstr); tmpstr = NULL; |
---|
1157 | system("killall fbread"); |
---|
1158 | debug(10, "LCD Samsung SPF.. loadet !!!"); |
---|
1159 | tmpstr = getconfig("lcd_samsung_plugin_running", NULL); |
---|
1160 | if(ostrcmp(tmpstr, "yes") == 0) |
---|
1161 | LCD_Samsung1_main(); |
---|
1162 | tmpstr = NULL; |
---|
1163 | } |
---|
1164 | |
---|
1165 | //wird beim entladen ausgefuehrt |
---|
1166 | void deinit(void) |
---|
1167 | { |
---|
1168 | delmarkedscreen(119); |
---|
1169 | pluginaktiv = 0; |
---|
1170 | system("echo ende > /tmp/titanlcd.png"); |
---|
1171 | sleep(1); |
---|
1172 | system("killall fbread"); |
---|
1173 | debug(10, "LCD Samsung unloadet !!!"); |
---|
1174 | } |
---|
1175 | |
---|
1176 | |
---|
1177 | //wird in der Pluginverwaltung bzw Menue ausfeguehrt |
---|
1178 | void start(void) |
---|
1179 | { |
---|
1180 | struct skin* samsung1_main = getscreen("samsung1_main"); |
---|
1181 | struct skin* listbox = getscreennode(samsung1_main, "listbox"); |
---|
1182 | struct skin* lcdtype = getscreennode(samsung1_main, "lcdtype"); |
---|
1183 | struct skin* lcdip = getscreennode(samsung1_main, "lcdip"); |
---|
1184 | struct skin* allmenu = getscreennode(samsung1_main, "allmenu"); |
---|
1185 | struct skin* aktstandby = getscreennode(samsung1_main, "aktstandby"); |
---|
1186 | struct skin* wettervor = getscreennode(samsung1_main, "wettervor"); |
---|
1187 | struct skin* wettervorort = getscreennode(samsung1_main, "wettervorort"); |
---|
1188 | //struct skin* wettervorplz = getscreennode(samsung1_main, "wettervorplz"); |
---|
1189 | //struct skin* wettervorland = getscreennode(samsung1_main, "wettervorland"); |
---|
1190 | struct skin* b3 = getscreennode(samsung1_main, "b3"); |
---|
1191 | struct skin* tmp = NULL; |
---|
1192 | |
---|
1193 | int rcret = 0; |
---|
1194 | int startstop = 0; |
---|
1195 | int restart = 0; |
---|
1196 | |
---|
1197 | if(getconfig("lcd_samsung_plugin_wetter", NULL) == NULL || ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "no") == 0) |
---|
1198 | { |
---|
1199 | //wettervorplz->hidden = YES; |
---|
1200 | //wettervorland->hidden = YES; |
---|
1201 | wettervorort->hidden = YES; |
---|
1202 | } |
---|
1203 | changeinput(lcdip, getconfig("lcd_samsung_ip", NULL)); |
---|
1204 | if(getconfig("lcd_samsung_plugin_type", NULL) == NULL || ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") != 0) |
---|
1205 | { |
---|
1206 | lcdip->hidden = YES; |
---|
1207 | } |
---|
1208 | |
---|
1209 | addchoicebox(lcdtype, "spf72h", _("SPF-72H")); |
---|
1210 | addchoicebox(lcdtype, "spf75h", _("SPF-75H")); |
---|
1211 | addchoicebox(lcdtype, "spf83h", _("SPF-83H")); |
---|
1212 | addchoicebox(lcdtype, "spf85h", _("SPF-85H")); |
---|
1213 | addchoicebox(lcdtype, "spf85p", _("SPF-85P")); |
---|
1214 | addchoicebox(lcdtype, "spf87h", _("SPF-87H")); |
---|
1215 | addchoicebox(lcdtype, "spf87hold", _("SPF-87H-old")); |
---|
1216 | addchoicebox(lcdtype, "spf105p", _("SPF-105P")); |
---|
1217 | addchoicebox(lcdtype, "spf107h", _("SPF-107H")); |
---|
1218 | addchoicebox(lcdtype, "none", _("tiMote")); |
---|
1219 | addchoicebox(lcdtype, "d320", _("Dummy-320")); |
---|
1220 | setchoiceboxselection(lcdtype, getconfig("lcd_samsung_plugin_type", NULL)); |
---|
1221 | |
---|
1222 | addchoicebox(allmenu, "no", _("nein")); |
---|
1223 | addchoicebox(allmenu, "yes", _("ja")); |
---|
1224 | setchoiceboxselection(allmenu, getconfig("write_fb_to_jpg", NULL)); |
---|
1225 | |
---|
1226 | addchoicebox(aktstandby, "no", _("nein")); |
---|
1227 | addchoicebox(aktstandby, "yes", _("ja")); |
---|
1228 | setchoiceboxselection(aktstandby, getconfig("lcd_samsung_plugin_standby", NULL)); |
---|
1229 | |
---|
1230 | addchoicebox(wettervor, "no", _("nein")); |
---|
1231 | addchoicebox(wettervor, "yes", _("ja")); |
---|
1232 | setchoiceboxselection(wettervor, getconfig("lcd_samsung_plugin_wetter", NULL)); |
---|
1233 | |
---|
1234 | //changemask(wettervorplz, "0000"); |
---|
1235 | //if(getconfig("lcd_samsung_plugin_wetterplz", NULL) == NULL) |
---|
1236 | // changeinput(wettervorplz, "10407"); |
---|
1237 | //else |
---|
1238 | // changeinput(wettervorplz, getconfig("lcd_samsung_plugin_wetterplz", NULL)); |
---|
1239 | |
---|
1240 | //changemask(wettervorland, "abcdefghijklmnopqrstuvwxyz"); |
---|
1241 | //if(getconfig("lcd_samsung_plugin_wetterland", NULL) == NULL) |
---|
1242 | // changeinput(wettervorland, "Germany"); |
---|
1243 | //else |
---|
1244 | // changeinput(wettervorland, getconfig("lcd_samsung_plugin_wetterland", NULL)); |
---|
1245 | |
---|
1246 | changemask(wettervorort, "abcdefghijklmnopqrstuvwxyz"); |
---|
1247 | if(getconfig("lcd_samsung_plugin_wetterort", NULL) == NULL) |
---|
1248 | changeinput(wettervorort, "Berlin "); |
---|
1249 | else |
---|
1250 | changeinput(wettervorort, getconfig("lcd_samsung_plugin_wetterort", NULL)); |
---|
1251 | |
---|
1252 | if(LCD_Samsung1thread != NULL) |
---|
1253 | changetext(b3, "STOP"); |
---|
1254 | else |
---|
1255 | changetext(b3, "START"); |
---|
1256 | |
---|
1257 | drawscreen(samsung1_main, 0, 0); |
---|
1258 | addscreenrc(samsung1_main, listbox); |
---|
1259 | tmp = listbox->select; |
---|
1260 | |
---|
1261 | while(1) |
---|
1262 | { |
---|
1263 | addscreenrc(samsung1_main, tmp); |
---|
1264 | rcret = waitrc(samsung1_main, 0, 0); |
---|
1265 | tmp = listbox->select; |
---|
1266 | |
---|
1267 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "wettervor") == 0) |
---|
1268 | { |
---|
1269 | if(ostrcmp(wettervor->ret, "yes") == 0) |
---|
1270 | { |
---|
1271 | //wettervorplz->hidden = NO; |
---|
1272 | //wettervorland->hidden = NO; |
---|
1273 | wettervorort->hidden = NO; |
---|
1274 | } else { |
---|
1275 | //wettervorplz->hidden = YES; |
---|
1276 | //wettervorland->hidden = YES; |
---|
1277 | wettervorort->hidden = YES; |
---|
1278 | } |
---|
1279 | |
---|
1280 | drawscreen(samsung1_main, 0, 0); |
---|
1281 | } |
---|
1282 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "lcdtype") == 0) |
---|
1283 | { |
---|
1284 | if(ostrcmp(lcdtype->ret, "d320") == 0) |
---|
1285 | { |
---|
1286 | lcdip->hidden = NO; |
---|
1287 | } else { |
---|
1288 | lcdip->hidden = YES; |
---|
1289 | } |
---|
1290 | |
---|
1291 | drawscreen(samsung1_main, 0, 0); |
---|
1292 | } |
---|
1293 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
1294 | break; |
---|
1295 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
1296 | { |
---|
1297 | addconfig("lcd_samsung_plugin_type", lcdtype->ret); |
---|
1298 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
1299 | addconfig("lcd_samsung_plugin_standby", aktstandby->ret); |
---|
1300 | addconfig("lcd_samsung_plugin_wetter", wettervor->ret); |
---|
1301 | addconfig("lcd_samsung_plugin_wetterort", wettervorort->ret); |
---|
1302 | addconfig("lcd_samsung_ip", lcdip->ret); |
---|
1303 | //addconfig("lcd_samsung_plugin_wetterplz", wettervorplz->ret); |
---|
1304 | //addconfig("lcd_samsung_plugin_wetterland", wettervorland->ret); |
---|
1305 | restart = 1; |
---|
1306 | break; |
---|
1307 | } |
---|
1308 | |
---|
1309 | if(rcret == getrcconfigint("rcblue", NULL)) |
---|
1310 | { |
---|
1311 | addconfig("lcd_samsung_plugin_type", lcdtype->ret); |
---|
1312 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
1313 | addconfig("lcd_samsung_plugin_standby", aktstandby->ret); |
---|
1314 | addconfig("lcd_samsung_plugin_wetter", wettervor->ret); |
---|
1315 | addconfig("lcd_samsung_plugin_wetterort", wettervorort->ret); |
---|
1316 | addconfig("lcd_samsung_ip", lcdip->ret); |
---|
1317 | //addconfig("lcd_samsung_plugin_wetterplz", wettervorplz->ret); |
---|
1318 | //addconfig("lcd_samsung_plugin_wetterland", wettervorland->ret); |
---|
1319 | startstop = 1; |
---|
1320 | break; |
---|
1321 | } |
---|
1322 | } |
---|
1323 | delownerrc(samsung1_main); |
---|
1324 | clearscreen(samsung1_main); |
---|
1325 | |
---|
1326 | if(LCD_Samsung1thread != NULL && restart == 1) |
---|
1327 | { |
---|
1328 | LCD_Samsung1thread->aktion = STOP; |
---|
1329 | system("killall fbread"); |
---|
1330 | sleep(2); |
---|
1331 | addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL); |
---|
1332 | LCD_Samsung1thread = addtimer(&LCD_Samsung1_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
1333 | sleep(1); |
---|
1334 | return; |
---|
1335 | } |
---|
1336 | if(startstop == 1) |
---|
1337 | { |
---|
1338 | if(LCD_Samsung1thread != NULL) |
---|
1339 | { |
---|
1340 | addconfig("lcd_samsung_plugin_running", "no"); |
---|
1341 | LCD_Samsung1thread->aktion = STOP; |
---|
1342 | sleep(1); |
---|
1343 | system("killall fbread"); |
---|
1344 | debug(10, "LCD Samsung unloadet !!!"); |
---|
1345 | sleep(1); |
---|
1346 | } |
---|
1347 | else { |
---|
1348 | addconfig("lcd_samsung_plugin_running", "yes"); |
---|
1349 | firststart = 1; |
---|
1350 | LCD_Samsung1_main(); |
---|
1351 | } |
---|
1352 | } |
---|
1353 | } |
---|