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, " 99", 1, 0); |
---|
428 | } |
---|
429 | else |
---|
430 | { |
---|
431 | startlcd = createpluginpath("/lcdsamsung/start.sh", 0); |
---|
432 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
433 | } |
---|
434 | |
---|
435 | |
---|
436 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
437 | { |
---|
438 | if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf75h") == 0) |
---|
439 | LCD_Standby = getscreen("LCD_spf75_Standby"); |
---|
440 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf83h") == 0) |
---|
441 | LCD_Standby = getscreen("LCD_spf83_Standby"); |
---|
442 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87h") == 0) |
---|
443 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
444 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf87hold") == 0) |
---|
445 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
446 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf105p") == 0) |
---|
447 | LCD_Standby = getscreen("LCD_spf105_Standby"); |
---|
448 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf107h") == 0) |
---|
449 | LCD_Standby = getscreen("LCD_spf107_Standby"); |
---|
450 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf72h") == 0) |
---|
451 | LCD_Standby = getscreen("LCD_spf72_Standby"); |
---|
452 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85h") == 0) |
---|
453 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
454 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "spf85p") == 0) |
---|
455 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
456 | else if(ostrcmp(getconfig("lcd_samsung_plugin_type", NULL), "d320") == 0) |
---|
457 | LCD_Standby = getscreen("LCD_d320_Standby"); |
---|
458 | else |
---|
459 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
460 | akttime_Standby = getscreennode(LCD_Standby, "akttime"); |
---|
461 | scity = getscreennode(LCD_Standby, "city"); |
---|
462 | swind = getscreennode(LCD_Standby, "wind"); |
---|
463 | sluft = getscreennode(LCD_Standby, "luft"); |
---|
464 | sday0_t = getscreennode(LCD_Standby, "day0_t"); |
---|
465 | sday0_tm = getscreennode(LCD_Standby, "day0_tm"); |
---|
466 | sday0_i = getscreennode(LCD_Standby, "day0_i"); |
---|
467 | sday0_d = getscreennode(LCD_Standby, "day0_d"); |
---|
468 | sday0_dl = getscreennode(LCD_Standby, "day0_dl"); |
---|
469 | sday1_t = getscreennode(LCD_Standby, "day1_t"); |
---|
470 | sday1_tm = getscreennode(LCD_Standby, "day1_tm"); |
---|
471 | sday1_i = getscreennode(LCD_Standby, "day1_i"); |
---|
472 | sday1_d = getscreennode(LCD_Standby, "day1_d"); |
---|
473 | sday1_dl = getscreennode(LCD_Standby, "day1_dl"); |
---|
474 | sday2_t = getscreennode(LCD_Standby, "day2_t"); |
---|
475 | sday2_tm = getscreennode(LCD_Standby, "day2_tm"); |
---|
476 | sday2_i = getscreennode(LCD_Standby, "day2_i"); |
---|
477 | sday2_d = getscreennode(LCD_Standby, "day2_d"); |
---|
478 | sday2_dl = getscreennode(LCD_Standby, "day2_dl"); |
---|
479 | sday3_t = getscreennode(LCD_Standby, "day3_t"); |
---|
480 | sday3_tm = getscreennode(LCD_Standby, "day3_tm"); |
---|
481 | sday3_i = getscreennode(LCD_Standby, "day3_i"); |
---|
482 | sday3_d = getscreennode(LCD_Standby, "day3_d"); |
---|
483 | sday3_dl = getscreennode(LCD_Standby, "day3_dl"); |
---|
484 | |
---|
485 | n_stunde_standby = getscreennode(LCD_Standby, "stunde"); |
---|
486 | if(n_stunde_standby != NULL) |
---|
487 | { |
---|
488 | pichr_standby = ostrcat(n_stunde_standby->pic, "", 0, 0); |
---|
489 | if(ostrstr(pichr_standby, "Digital") != NULL) |
---|
490 | digitaluhr_standby = 1; |
---|
491 | } |
---|
492 | n_minute_standby = getscreennode(LCD_Standby, "minute"); |
---|
493 | if(n_minute_standby != NULL) |
---|
494 | picmin_standby = ostrcat(n_minute_standby->pic, "", 0, 0); |
---|
495 | if(digitaluhr_standby == 1) |
---|
496 | { |
---|
497 | n_stunde2_standby = getscreennode(LCD_Standby, "stunde2"); |
---|
498 | n_minute2_standby = getscreennode(LCD_Standby, "minute2"); |
---|
499 | picmin2_standby = ostrcat(n_minute2_standby->pic, "", 0, 0); |
---|
500 | pichr2_standby = ostrcat(n_stunde2_standby->pic, "", 0, 0); |
---|
501 | } |
---|
502 | } |
---|
503 | |
---|
504 | |
---|
505 | int put = 0, typemerk = 0, type = 0; |
---|
506 | int standby = 0; |
---|
507 | |
---|
508 | unsigned long long int pos = 0, len = 0, reverse = 0; |
---|
509 | int playertype = 0; |
---|
510 | int loopcount = 0; |
---|
511 | |
---|
512 | int hr = 0, min = 0; |
---|
513 | |
---|
514 | if(firststart == 1) |
---|
515 | sleep(8); |
---|
516 | firststart = 0; |
---|
517 | status.write_png = 0; |
---|
518 | //if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) |
---|
519 | // status.write_png = 1; |
---|
520 | |
---|
521 | while (LCD_Samsung1thread->aktion != STOP) { |
---|
522 | |
---|
523 | tmpstr = gettime(NULL, "%H:%M"); |
---|
524 | hr = atoi(gettime(NULL, "%H")); |
---|
525 | min = atoi(gettime(NULL, "%M")); |
---|
526 | |
---|
527 | // TV Programm läuft |
---|
528 | if(status.infobaraktiv == 1) |
---|
529 | { |
---|
530 | if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) { |
---|
531 | //status.write_png = 1; |
---|
532 | if(type == 999) |
---|
533 | system("killall -3 fbread"); |
---|
534 | } |
---|
535 | tmpstr2 = getaktchannelname(NULL); |
---|
536 | tmpstr3 = getrec(NULL, NULL); |
---|
537 | type = 1; |
---|
538 | } |
---|
539 | // Musik wird abgespielt |
---|
540 | else if((status.playspeed != 0 || status.play != 0 || status.pause != 0) && musicdat.act == 1 && LCD_Music != NULL) |
---|
541 | { |
---|
542 | if(type == 999) |
---|
543 | system("killall -3 fbread"); |
---|
544 | //status.write_png = 0; |
---|
545 | loopcount++ ; |
---|
546 | type = 3; |
---|
547 | } |
---|
548 | // Aufzeichnung wird abgespielt |
---|
549 | else if(status.playspeed != 0 || status.play != 0 || status.pause != 0) |
---|
550 | { |
---|
551 | if(type == 999) |
---|
552 | system("killall -3 fbread"); |
---|
553 | //status.write_png = 0; |
---|
554 | loopcount++ ; |
---|
555 | type = 2; |
---|
556 | } |
---|
557 | // Sonstige Anzeigen |
---|
558 | else if(type != 999) |
---|
559 | { |
---|
560 | if(ostrcmp(getconfig("write_fb_to_jpg", NULL), "yes") == 0) { |
---|
561 | //status.write_png = 1; |
---|
562 | system("killall -1 fbread"); |
---|
563 | } |
---|
564 | type = 999; |
---|
565 | } |
---|
566 | else |
---|
567 | type = 999; |
---|
568 | |
---|
569 | if(typemerk != type) |
---|
570 | { |
---|
571 | put = 1; |
---|
572 | typemerk = type; |
---|
573 | free(sendermerk);sendermerk=NULL; |
---|
574 | free(recmerk);recmerk=NULL; |
---|
575 | loopcount = 0; |
---|
576 | } |
---|
577 | else |
---|
578 | put = 0; |
---|
579 | |
---|
580 | if(status.standby > 0 && standby == 0) |
---|
581 | { |
---|
582 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
583 | standby = 2; |
---|
584 | else |
---|
585 | { |
---|
586 | tmpstr = createpluginpath("/lcdsamsung/standby.jpg", 0); |
---|
587 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
588 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
589 | system(tmpstr); |
---|
590 | free(tmpstr); tmpstr=NULL; |
---|
591 | sleep(3); |
---|
592 | |
---|
593 | tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0); |
---|
594 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
595 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
596 | system(tmpstr); |
---|
597 | sleep(2); |
---|
598 | system("killall fbread"); |
---|
599 | standby = 1; |
---|
600 | } |
---|
601 | } |
---|
602 | if(status.standby == 0 && standby > 0) |
---|
603 | { |
---|
604 | if(standby == 1) |
---|
605 | system(startlcd); |
---|
606 | standby = 0; |
---|
607 | put = 1; |
---|
608 | } |
---|
609 | |
---|
610 | if(weatherthread == NULL && weatherwrite == 0) |
---|
611 | { |
---|
612 | if(file_exist("/tmp/lcdweather")) |
---|
613 | put = 1; |
---|
614 | } |
---|
615 | if(ostrcmp(tmpstr, timemerk) != 0) |
---|
616 | { |
---|
617 | free(timemerk);timemerk=NULL; |
---|
618 | timemerk = ostrcat(tmpstr, "", 0, 0); |
---|
619 | put = 1; |
---|
620 | } |
---|
621 | |
---|
622 | if(standby == 0 || standby == 2 ) |
---|
623 | { |
---|
624 | if(type == 1 && standby == 0) |
---|
625 | { |
---|
626 | if(ostrcmp(tmpstr2, sendermerk) != 0) |
---|
627 | { |
---|
628 | free(sendermerk);sendermerk=NULL; |
---|
629 | sendermerk = ostrcat(tmpstr2, "", 0, 0); |
---|
630 | put = 1; |
---|
631 | } |
---|
632 | if(tmpstr3 == NULL && recmerk != NULL) |
---|
633 | { |
---|
634 | put = 1; |
---|
635 | free(recmerk);recmerk=NULL; |
---|
636 | } |
---|
637 | else if(tmpstr3 != NULL && recmerk == NULL) |
---|
638 | { |
---|
639 | free(recmerk);recmerk=NULL; |
---|
640 | recmerk = ostrcat(tmpstr3, "", 0, 0); |
---|
641 | put = 1; |
---|
642 | } |
---|
643 | } |
---|
644 | else if(type == 2) |
---|
645 | { |
---|
646 | if(loopcount >= 15) |
---|
647 | { |
---|
648 | put = 1; |
---|
649 | loopcount = 0; |
---|
650 | } |
---|
651 | } |
---|
652 | else if(type == 3) |
---|
653 | { |
---|
654 | if(loopcount >= 15) |
---|
655 | { |
---|
656 | put = 1; |
---|
657 | loopcount = 0; |
---|
658 | } |
---|
659 | } |
---|
660 | |
---|
661 | if(put == 1) |
---|
662 | { |
---|
663 | if(type == 1) |
---|
664 | { |
---|
665 | // Wettervorhersage |
---|
666 | printf("lcd_samsung wetter = %s\n", getconfig("lcd_samsung_plugin_wetter", NULL)); |
---|
667 | if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) |
---|
668 | { |
---|
669 | if(weatherwrite == 0) |
---|
670 | { |
---|
671 | printf("lcd_samsung weatherwrite=0\n"); |
---|
672 | if(weatherthread == NULL) |
---|
673 | { |
---|
674 | printf("lcd_samsung weatherthread=NULL\n"); |
---|
675 | if(!file_exist("/tmp/lcdweather")) |
---|
676 | weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); |
---|
677 | else |
---|
678 | { |
---|
679 | fileline = malloc(256); |
---|
680 | if(fileline != NULL) |
---|
681 | { |
---|
682 | fd = fopen("/tmp/lcdweather", "r"); |
---|
683 | if(fd != NULL) |
---|
684 | { |
---|
685 | if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) |
---|
686 | { |
---|
687 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
688 | changetext(day0_d, fileline); |
---|
689 | changetext(sday0_d, fileline); |
---|
690 | weather_getline(fd, fileline); |
---|
691 | changetext(day0_tm, fileline); |
---|
692 | changetext(sday0_tm, fileline); |
---|
693 | weather_getline(fd, fileline); |
---|
694 | changetext(day0_t, fileline); |
---|
695 | changetext(sday0_t, fileline); |
---|
696 | weather_getline(fd, fileline); |
---|
697 | weather_getline(fd, fileline); |
---|
698 | changepic(day0_i, fileline); |
---|
699 | changepic(sday0_i, fileline); |
---|
700 | |
---|
701 | weather_getline(fd, fileline); |
---|
702 | changetext(day1_d, fileline); |
---|
703 | changetext(sday1_d, fileline); |
---|
704 | weather_getline(fd, fileline); |
---|
705 | changetext(day1_tm, fileline); |
---|
706 | changetext(sday1_tm, fileline); |
---|
707 | weather_getline(fd, fileline); |
---|
708 | changetext(day1_t, fileline); |
---|
709 | changetext(sday1_t, fileline); |
---|
710 | weather_getline(fd, fileline); |
---|
711 | weather_getline(fd, fileline); |
---|
712 | changepic(day1_i, fileline); |
---|
713 | changepic(sday1_i, fileline); |
---|
714 | |
---|
715 | weather_getline(fd, fileline); |
---|
716 | changetext(day2_d, fileline); |
---|
717 | changetext(sday2_d, fileline); |
---|
718 | weather_getline(fd, fileline); |
---|
719 | changetext(day2_tm, fileline); |
---|
720 | changetext(sday2_tm, fileline); |
---|
721 | weather_getline(fd, fileline); |
---|
722 | changetext(day2_t, fileline); |
---|
723 | changetext(sday2_t, fileline); |
---|
724 | weather_getline(fd, fileline); |
---|
725 | weather_getline(fd, fileline); |
---|
726 | changepic(day2_i, fileline); |
---|
727 | changepic(sday2_i, fileline); |
---|
728 | |
---|
729 | weather_getline(fd, fileline); |
---|
730 | changetext(day3_d, fileline); |
---|
731 | changetext(sday3_d, fileline); |
---|
732 | weather_getline(fd, fileline); |
---|
733 | changetext(day3_tm, fileline); |
---|
734 | changetext(sday3_tm, fileline); |
---|
735 | weather_getline(fd, fileline); |
---|
736 | changetext(day3_t, fileline); |
---|
737 | changetext(sday3_t, fileline); |
---|
738 | weather_getline(fd, fileline); |
---|
739 | weather_getline(fd, fileline); |
---|
740 | changepic(day3_i, fileline); |
---|
741 | changepic(sday3_i, fileline); |
---|
742 | |
---|
743 | weather_getline(fd, fileline); |
---|
744 | changepic(city, fileline); |
---|
745 | changepic(scity, fileline); |
---|
746 | weather_getline(fd, fileline); |
---|
747 | changetext(wind, fileline); |
---|
748 | changetext(swind, fileline); |
---|
749 | weather_getline(fd, fileline); |
---|
750 | changetext(luft, fileline); |
---|
751 | changetext(sluft, fileline); |
---|
752 | weather_getline(fd, fileline); |
---|
753 | changetext(day0_dl, fileline); |
---|
754 | changetext(sday0_dl, fileline); |
---|
755 | weather_getline(fd, fileline); |
---|
756 | changetext(day1_dl, fileline); |
---|
757 | changetext(sday1_dl, fileline); |
---|
758 | weather_getline(fd, fileline); |
---|
759 | changetext(day2_dl, fileline); |
---|
760 | changetext(sday2_dl, fileline); |
---|
761 | weather_getline(fd, fileline); |
---|
762 | changetext(day3_dl, fileline); |
---|
763 | changetext(sday3_dl, fileline); |
---|
764 | |
---|
765 | } |
---|
766 | else |
---|
767 | { |
---|
768 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
769 | changetext(day0_d, fileline); |
---|
770 | weather_getline(fd, fileline); |
---|
771 | changetext(day0_tm, fileline); |
---|
772 | weather_getline(fd, fileline); |
---|
773 | changetext(day0_t, fileline); |
---|
774 | weather_getline(fd, fileline); |
---|
775 | weather_getline(fd, fileline); |
---|
776 | changepic(day0_i, fileline); |
---|
777 | |
---|
778 | weather_getline(fd, fileline); |
---|
779 | changetext(day1_d, fileline); |
---|
780 | weather_getline(fd, fileline); |
---|
781 | changetext(day1_tm, fileline); |
---|
782 | weather_getline(fd, fileline); |
---|
783 | changetext(day1_t, fileline); |
---|
784 | weather_getline(fd, fileline); |
---|
785 | weather_getline(fd, fileline); |
---|
786 | changepic(day1_i, fileline); |
---|
787 | |
---|
788 | weather_getline(fd, fileline); |
---|
789 | changetext(day2_d, fileline); |
---|
790 | weather_getline(fd, fileline); |
---|
791 | changetext(day2_tm, fileline); |
---|
792 | weather_getline(fd, fileline); |
---|
793 | changetext(day2_t, fileline); |
---|
794 | weather_getline(fd, fileline); |
---|
795 | weather_getline(fd, fileline); |
---|
796 | changepic(day2_i, fileline); |
---|
797 | |
---|
798 | weather_getline(fd, fileline); |
---|
799 | changetext(day3_d, fileline); |
---|
800 | weather_getline(fd, fileline); |
---|
801 | changetext(day3_tm, fileline); |
---|
802 | weather_getline(fd, fileline); |
---|
803 | changetext(day3_t, fileline); |
---|
804 | weather_getline(fd, fileline); |
---|
805 | weather_getline(fd, fileline); |
---|
806 | changepic(day3_i, fileline); |
---|
807 | |
---|
808 | weather_getline(fd, fileline); |
---|
809 | changepic(city, fileline); |
---|
810 | weather_getline(fd, fileline); |
---|
811 | changetext(wind, fileline); |
---|
812 | weather_getline(fd, fileline); |
---|
813 | changetext(luft, fileline); |
---|
814 | weather_getline(fd, fileline); |
---|
815 | changetext(day0_dl, fileline); |
---|
816 | weather_getline(fd, fileline); |
---|
817 | changetext(day1_dl, fileline); |
---|
818 | weather_getline(fd, fileline); |
---|
819 | changetext(day2_dl, fileline); |
---|
820 | weather_getline(fd, fileline); |
---|
821 | changetext(day3_dl, fileline); |
---|
822 | } |
---|
823 | fclose(fd); |
---|
824 | } |
---|
825 | free(fileline); fileline=NULL; |
---|
826 | } |
---|
827 | weatherwrite = 1; |
---|
828 | } |
---|
829 | } |
---|
830 | } |
---|
831 | } |
---|
832 | if(standby == 0) |
---|
833 | { |
---|
834 | if(akttime != NULL) |
---|
835 | changetext(akttime, tmpstr); |
---|
836 | if(n_minute != NULL && digitaluhr == 0) |
---|
837 | { |
---|
838 | free(tmpstr);tmpstr=NULL; |
---|
839 | tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); |
---|
840 | free(n_minute->pic); |
---|
841 | n_minute->pic = string_replace("min_mm", tmpstr, picmin, 0); |
---|
842 | free(tmpstr);tmpstr=NULL; |
---|
843 | } |
---|
844 | if(n_stunde != NULL && digitaluhr == 0) |
---|
845 | { |
---|
846 | free(tmpstr);tmpstr=NULL; |
---|
847 | if(hr >= 12) |
---|
848 | hr = hr - 12; |
---|
849 | if(hr < 10) |
---|
850 | tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); |
---|
851 | else |
---|
852 | tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); |
---|
853 | if(min < 12) |
---|
854 | tmpstr = ostrcat(tmpstr,"00", 0, 0); |
---|
855 | else if(min < 24) |
---|
856 | tmpstr = ostrcat(tmpstr,"12", 0, 0); |
---|
857 | else if(min < 36) |
---|
858 | tmpstr = ostrcat(tmpstr,"24", 0, 0); |
---|
859 | else if(min < 48) |
---|
860 | tmpstr = ostrcat(tmpstr,"36", 0, 0); |
---|
861 | else if(min < 60) |
---|
862 | tmpstr = ostrcat(tmpstr,"48", 0, 0); |
---|
863 | free(n_stunde->pic); |
---|
864 | n_stunde->pic = string_replace("hr_hhmm", tmpstr, pichr, 0); |
---|
865 | free(tmpstr);tmpstr=NULL; |
---|
866 | } |
---|
867 | if(digitaluhr == 1) |
---|
868 | { |
---|
869 | free(tmpstr);tmpstr=NULL; |
---|
870 | tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); |
---|
871 | n_stunde->pic = string_replace("wert_w", tmpstr, pichr, 0); |
---|
872 | free(tmpstr);tmpstr=NULL; |
---|
873 | tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); |
---|
874 | n_stunde2->pic = string_replace("wert_w", tmpstr, pichr2, 0); |
---|
875 | free(tmpstr);tmpstr=NULL; |
---|
876 | tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); |
---|
877 | n_minute->pic = string_replace("wert_w", tmpstr, picmin, 0); |
---|
878 | free(tmpstr);tmpstr=NULL; |
---|
879 | tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); |
---|
880 | n_minute2->pic = string_replace("wert_w", tmpstr, picmin2, 0); |
---|
881 | free(tmpstr);tmpstr=NULL; |
---|
882 | } |
---|
883 | |
---|
884 | m_lock(&status.drawingmutex, 0); |
---|
885 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
886 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
887 | m_unlock(&status.drawingmutex, 0); |
---|
888 | } |
---|
889 | else if(standby == 2) |
---|
890 | { |
---|
891 | if(akttime_Standby != NULL) |
---|
892 | changetext(akttime_Standby, tmpstr); |
---|
893 | if(n_minute_standby != NULL && digitaluhr_standby == 0) |
---|
894 | { |
---|
895 | free(tmpstr);tmpstr=NULL; |
---|
896 | tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); |
---|
897 | free(n_minute_standby->pic); |
---|
898 | n_minute_standby->pic = string_replace("min_mm", tmpstr, picmin_standby, 0); |
---|
899 | free(tmpstr);tmpstr=NULL; |
---|
900 | } |
---|
901 | if(n_stunde_standby != NULL && digitaluhr_standby == 0) |
---|
902 | { |
---|
903 | free(tmpstr);tmpstr=NULL; |
---|
904 | if(hr >= 12) |
---|
905 | hr = hr - 12; |
---|
906 | if(hr < 10) |
---|
907 | tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); |
---|
908 | else |
---|
909 | tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); |
---|
910 | if(min < 12) |
---|
911 | tmpstr = ostrcat(tmpstr,"00", 0, 0); |
---|
912 | else if(min < 24) |
---|
913 | tmpstr = ostrcat(tmpstr,"12", 0, 0); |
---|
914 | else if(min < 36) |
---|
915 | tmpstr = ostrcat(tmpstr,"24", 0, 0); |
---|
916 | else if(min < 48) |
---|
917 | tmpstr = ostrcat(tmpstr,"36", 0, 0); |
---|
918 | else if(min < 60) |
---|
919 | tmpstr = ostrcat(tmpstr,"48", 0, 0); |
---|
920 | free(n_stunde_standby->pic); |
---|
921 | n_stunde_standby->pic = string_replace("hr_hhmm", tmpstr, pichr_standby, 0); |
---|
922 | free(tmpstr);tmpstr=NULL; |
---|
923 | } |
---|
924 | if(digitaluhr_standby == 1) |
---|
925 | { |
---|
926 | free(tmpstr);tmpstr=NULL; |
---|
927 | tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); |
---|
928 | n_stunde_standby->pic = string_replace("wert_w", tmpstr, pichr_standby, 0); |
---|
929 | free(tmpstr);tmpstr=NULL; |
---|
930 | tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); |
---|
931 | n_stunde2_standby->pic = string_replace("wert_w", tmpstr, pichr2_standby, 0); |
---|
932 | free(tmpstr);tmpstr=NULL; |
---|
933 | tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); |
---|
934 | n_minute_standby->pic = string_replace("wert_w", tmpstr, picmin_standby, 0); |
---|
935 | free(tmpstr);tmpstr=NULL; |
---|
936 | tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); |
---|
937 | n_minute2_standby->pic = string_replace("wert_w", tmpstr, picmin2_standby, 0); |
---|
938 | free(tmpstr);tmpstr=NULL; |
---|
939 | } |
---|
940 | m_lock(&status.drawingmutex, 0); |
---|
941 | drawscreen(LCD_Standby, 0, 2); |
---|
942 | m_unlock(&status.drawingmutex, 0); |
---|
943 | put = 0; |
---|
944 | } |
---|
945 | } |
---|
946 | else if(type == 2) |
---|
947 | { |
---|
948 | playertype = getconfigint("lastplayertype", NULL); |
---|
949 | //if(status.mcaktiv == 1) |
---|
950 | //playertype = 0; |
---|
951 | //else |
---|
952 | ////playertype = getconfigint("playertype", NULL); |
---|
953 | //playertype = 1; |
---|
954 | |
---|
955 | if(playertype == 1) |
---|
956 | { |
---|
957 | unsigned long long int startpos = 0; |
---|
958 | playergetinfots(&len, &startpos, NULL, &pos, NULL, 0); |
---|
959 | len = len / 90000; |
---|
960 | pos = (pos - startpos) / 90000; |
---|
961 | } |
---|
962 | else |
---|
963 | { |
---|
964 | pos = playergetpts() / 90000; |
---|
965 | len = playergetlength(); |
---|
966 | } |
---|
967 | if(pos < 0) pos = 0; |
---|
968 | reverse = len - pos; |
---|
969 | if(len == 0) |
---|
970 | sprogress->progresssize = 0; |
---|
971 | else |
---|
972 | sprogress->progresssize = pos * 100 / len; |
---|
973 | |
---|
974 | tmpstr2 = convert_timesec(pos); |
---|
975 | changetext(spos, tmpstr2); |
---|
976 | free(tmpstr2); tmpstr2 = NULL; |
---|
977 | |
---|
978 | tmpstr2 = convert_timesec(len); |
---|
979 | changetext(slen, tmpstr2); |
---|
980 | free(tmpstr2); tmpstr2 = NULL; |
---|
981 | |
---|
982 | tmpstr2 = convert_timesec(reverse); |
---|
983 | changetext(sreverse, tmpstr2); |
---|
984 | free(tmpstr2); tmpstr2 = NULL; |
---|
985 | |
---|
986 | changetext(akttimeplay, tmpstr); |
---|
987 | changetext(stitle, basename(status.playfile)); |
---|
988 | m_lock(&status.drawingmutex, 0); |
---|
989 | if(drawscreen(LCD_Play, 0, 2) == -2) |
---|
990 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
991 | m_unlock(&status.drawingmutex, 0); |
---|
992 | } |
---|
993 | else if(type == 3) |
---|
994 | { |
---|
995 | pos = playergetpts() / 90000; |
---|
996 | len = playergetlength(); |
---|
997 | if(pos < 0) pos = 0; |
---|
998 | reverse = len - pos; |
---|
999 | if(len == 0) |
---|
1000 | mprogress->progresssize = 0; |
---|
1001 | else |
---|
1002 | mprogress->progresssize = pos * 100 / len; |
---|
1003 | |
---|
1004 | tmpstr2 = convert_timesec(pos); |
---|
1005 | changetext(mpos, tmpstr2); |
---|
1006 | free(tmpstr2); tmpstr2 = NULL; |
---|
1007 | |
---|
1008 | tmpstr2 = convert_timesec(len); |
---|
1009 | changetext(mlen, tmpstr2); |
---|
1010 | free(tmpstr2); tmpstr2 = NULL; |
---|
1011 | |
---|
1012 | tmpstr2 = convert_timesec(reverse); |
---|
1013 | changetext(mreverse, tmpstr2); |
---|
1014 | free(tmpstr2); tmpstr2 = NULL; |
---|
1015 | |
---|
1016 | changetext(makttimeplay, tmpstr); |
---|
1017 | changetext(mtitle1, basename(status.playfile)); |
---|
1018 | |
---|
1019 | changetext(mtitle, musicdat.title); |
---|
1020 | changetext(malbum, musicdat.album); |
---|
1021 | changetext(mrealname, musicdat.realname); |
---|
1022 | changetext(mgenre, musicdat.genre); |
---|
1023 | changetext(myear, musicdat.year); |
---|
1024 | changetext(mactors, musicdat.actors); |
---|
1025 | |
---|
1026 | //if(file_exist(musicdat.thumb)) |
---|
1027 | if(file_exist("/tmp/mccover.jpg")) |
---|
1028 | { |
---|
1029 | mthumb->hidden = NO; |
---|
1030 | changepic(mthumb, musicdat.thumb); |
---|
1031 | } |
---|
1032 | else |
---|
1033 | mthumb->hidden = YES; |
---|
1034 | |
---|
1035 | m_lock(&status.drawingmutex, 0); |
---|
1036 | if(drawscreen(LCD_Music, 0, 2) == -2) |
---|
1037 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
1038 | m_unlock(&status.drawingmutex, 0); |
---|
1039 | } |
---|
1040 | } |
---|
1041 | } |
---|
1042 | else |
---|
1043 | { |
---|
1044 | if(standby == 2) |
---|
1045 | { |
---|
1046 | if(put == 1) |
---|
1047 | { |
---|
1048 | changetext(akttime_Standby, tmpstr); |
---|
1049 | m_lock(&status.drawingmutex, 0); |
---|
1050 | drawscreen(LCD_Standby, 0, 2); |
---|
1051 | m_unlock(&status.drawingmutex, 0); |
---|
1052 | put = 0; |
---|
1053 | } |
---|
1054 | } |
---|
1055 | } |
---|
1056 | |
---|
1057 | free(tmpstr); tmpstr = NULL; |
---|
1058 | free(tmpstr2); tmpstr2 = NULL; |
---|
1059 | free(tmpstr3); tmpstr3 = NULL; |
---|
1060 | //sleep(1); |
---|
1061 | usleep(500000); |
---|
1062 | |
---|
1063 | if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) |
---|
1064 | { |
---|
1065 | weatherref = weatherref + 1; |
---|
1066 | if(weatherref == 7200) |
---|
1067 | { |
---|
1068 | weatherwrite = 0; |
---|
1069 | system("rm /tmp/lcdweather"); |
---|
1070 | weatherref = 0; |
---|
1071 | } |
---|
1072 | } |
---|
1073 | } |
---|
1074 | free(timemerk);timemerk=NULL; |
---|
1075 | free(sendermerk);sendermerk=NULL; |
---|
1076 | free(recmerk);recmerk=NULL; |
---|
1077 | free(startlcd);startlcd=NULL; |
---|
1078 | free(pichr);pichr=NULL; |
---|
1079 | free(picmin);picmin=NULL; |
---|
1080 | free(pichr_standby);pichr=NULL; |
---|
1081 | free(picmin_standby);picmin=NULL; |
---|
1082 | free(pichr2);pichr2=NULL; |
---|
1083 | free(picmin2);picmin2=NULL; |
---|
1084 | free(pichr2_standby);pichr2_standby=NULL; |
---|
1085 | free(picmin2_standby);picmin2_standby=NULL; |
---|
1086 | addconfig("lcd_samsung_plugin_running", "no"); |
---|
1087 | LCD_Samsung1thread = NULL; |
---|
1088 | m_lock(&status.drawingmutex, 0); |
---|
1089 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
1090 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
1091 | m_unlock(&status.drawingmutex, 0); |
---|
1092 | //status.write_png = 0; |
---|
1093 | return; |
---|
1094 | } |
---|
1095 | |
---|
1096 | void LCD_Samsung1_main() |
---|
1097 | { |
---|
1098 | if(LCD_Samsung1thread == NULL) |
---|
1099 | { |
---|
1100 | char* tmpstr = NULL; |
---|
1101 | |
---|
1102 | tmpstr = createpluginpath("/lcdsamsung/start.png", 0); |
---|
1103 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
1104 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
1105 | system(tmpstr); |
---|
1106 | free(tmpstr); tmpstr=NULL; |
---|
1107 | addconfig("lcd_samsung_plugin_running", "yes"); |
---|
1108 | LCD_Samsung1thread = addtimer(&LCD_Samsung1_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
1109 | addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL); |
---|
1110 | sleep(1); |
---|
1111 | } |
---|
1112 | else |
---|
1113 | { |
---|
1114 | LCD_Samsung1thread->aktion = STOP; |
---|
1115 | system("echo ende > /tmp/titanlcd.jpg"); |
---|
1116 | sleep(1); |
---|
1117 | system("killall fbread"); |
---|
1118 | } |
---|
1119 | } |
---|
1120 | |
---|
1121 | //wird beim laden ausgefuehrt |
---|
1122 | void init(void) |
---|
1123 | { |
---|
1124 | char* tmpstr = NULL; |
---|
1125 | pluginaktiv = 1; |
---|
1126 | firststart = 1; |
---|
1127 | |
---|
1128 | tmpstr = ostrcat("/var/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1129 | if(!file_exist(tmpstr)) |
---|
1130 | { |
---|
1131 | free(tmpstr); tmpstr = NULL; |
---|
1132 | tmpstr = ostrcat("/var/swap/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1133 | } |
---|
1134 | if(!file_exist(tmpstr)) |
---|
1135 | { |
---|
1136 | free(tmpstr); tmpstr = NULL; |
---|
1137 | tmpstr = ostrcat("/mnt/swapextensions/usr/local/share/titan/plugins/lcdsamsung/skin2.xml", NULL, 0, 0); |
---|
1138 | } |
---|
1139 | if(!file_exist(tmpstr)) |
---|
1140 | { |
---|
1141 | free(tmpstr); tmpstr = NULL; |
---|
1142 | tmpstr = createpluginpath("/lcdsamsung/skin.xml", 0); |
---|
1143 | } |
---|
1144 | |
---|
1145 | printf("use skin: %s\n", tmpstr); |
---|
1146 | |
---|
1147 | readscreen(tmpstr, 119, 1); |
---|
1148 | free(tmpstr); tmpstr = NULL; |
---|
1149 | |
---|
1150 | tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0); |
---|
1151 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
1152 | tmpstr = ostrcat(tmpstr, " /tmp/fbreadstop.jpg", 1, 0); |
---|
1153 | |
---|
1154 | system(tmpstr); |
---|
1155 | free(tmpstr); tmpstr = NULL; |
---|
1156 | system("killall fbread"); |
---|
1157 | debug(10, "LCD Samsung SPF.. loadet !!!"); |
---|
1158 | tmpstr = getconfig("lcd_samsung_plugin_running", NULL); |
---|
1159 | if(ostrcmp(tmpstr, "yes") == 0) |
---|
1160 | LCD_Samsung1_main(); |
---|
1161 | tmpstr = NULL; |
---|
1162 | } |
---|
1163 | |
---|
1164 | //wird beim entladen ausgefuehrt |
---|
1165 | void deinit(void) |
---|
1166 | { |
---|
1167 | delmarkedscreen(119); |
---|
1168 | pluginaktiv = 0; |
---|
1169 | system("echo ende > /tmp/titanlcd.png"); |
---|
1170 | sleep(1); |
---|
1171 | system("killall fbread"); |
---|
1172 | debug(10, "LCD Samsung unloadet !!!"); |
---|
1173 | } |
---|
1174 | |
---|
1175 | |
---|
1176 | //wird in der Pluginverwaltung bzw Menue ausfeguehrt |
---|
1177 | void start(void) |
---|
1178 | { |
---|
1179 | struct skin* samsung1_main = getscreen("samsung1_main"); |
---|
1180 | struct skin* listbox = getscreennode(samsung1_main, "listbox"); |
---|
1181 | struct skin* lcdtype = getscreennode(samsung1_main, "lcdtype"); |
---|
1182 | struct skin* allmenu = getscreennode(samsung1_main, "allmenu"); |
---|
1183 | struct skin* aktstandby = getscreennode(samsung1_main, "aktstandby"); |
---|
1184 | struct skin* wettervor = getscreennode(samsung1_main, "wettervor"); |
---|
1185 | struct skin* wettervorort = getscreennode(samsung1_main, "wettervorort"); |
---|
1186 | //struct skin* wettervorplz = getscreennode(samsung1_main, "wettervorplz"); |
---|
1187 | //struct skin* wettervorland = getscreennode(samsung1_main, "wettervorland"); |
---|
1188 | struct skin* b3 = getscreennode(samsung1_main, "b3"); |
---|
1189 | struct skin* tmp = NULL; |
---|
1190 | |
---|
1191 | int rcret = 0; |
---|
1192 | int startstop = 0; |
---|
1193 | int restart = 0; |
---|
1194 | |
---|
1195 | if(getconfig("lcd_samsung_plugin_wetter", NULL) == NULL || ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "no") == 0) |
---|
1196 | { |
---|
1197 | //wettervorplz->hidden = YES; |
---|
1198 | //wettervorland->hidden = YES; |
---|
1199 | wettervorort->hidden = YES; |
---|
1200 | } |
---|
1201 | |
---|
1202 | addchoicebox(lcdtype, "spf72h", _("SPF-72H")); |
---|
1203 | addchoicebox(lcdtype, "spf75h", _("SPF-75H")); |
---|
1204 | addchoicebox(lcdtype, "spf83h", _("SPF-83H")); |
---|
1205 | addchoicebox(lcdtype, "spf85h", _("SPF-85H")); |
---|
1206 | addchoicebox(lcdtype, "spf85p", _("SPF-85P")); |
---|
1207 | addchoicebox(lcdtype, "spf87h", _("SPF-87H")); |
---|
1208 | addchoicebox(lcdtype, "spf87hold", _("SPF-87H-old")); |
---|
1209 | addchoicebox(lcdtype, "spf105p", _("SPF-105P")); |
---|
1210 | addchoicebox(lcdtype, "spf107h", _("SPF-107H")); |
---|
1211 | addchoicebox(lcdtype, "none", _("tiMote")); |
---|
1212 | addchoicebox(lcdtype, "d320", _("Dummy-320")); |
---|
1213 | setchoiceboxselection(lcdtype, getconfig("lcd_samsung_plugin_type", NULL)); |
---|
1214 | |
---|
1215 | addchoicebox(allmenu, "no", _("nein")); |
---|
1216 | addchoicebox(allmenu, "yes", _("ja")); |
---|
1217 | setchoiceboxselection(allmenu, getconfig("write_fb_to_jpg", NULL)); |
---|
1218 | |
---|
1219 | addchoicebox(aktstandby, "no", _("nein")); |
---|
1220 | addchoicebox(aktstandby, "yes", _("ja")); |
---|
1221 | setchoiceboxselection(aktstandby, getconfig("lcd_samsung_plugin_standby", NULL)); |
---|
1222 | |
---|
1223 | addchoicebox(wettervor, "no", _("nein")); |
---|
1224 | addchoicebox(wettervor, "yes", _("ja")); |
---|
1225 | setchoiceboxselection(wettervor, getconfig("lcd_samsung_plugin_wetter", NULL)); |
---|
1226 | |
---|
1227 | //changemask(wettervorplz, "0000"); |
---|
1228 | //if(getconfig("lcd_samsung_plugin_wetterplz", NULL) == NULL) |
---|
1229 | // changeinput(wettervorplz, "10407"); |
---|
1230 | //else |
---|
1231 | // changeinput(wettervorplz, getconfig("lcd_samsung_plugin_wetterplz", NULL)); |
---|
1232 | |
---|
1233 | //changemask(wettervorland, "abcdefghijklmnopqrstuvwxyz"); |
---|
1234 | //if(getconfig("lcd_samsung_plugin_wetterland", NULL) == NULL) |
---|
1235 | // changeinput(wettervorland, "Germany"); |
---|
1236 | //else |
---|
1237 | // changeinput(wettervorland, getconfig("lcd_samsung_plugin_wetterland", NULL)); |
---|
1238 | |
---|
1239 | changemask(wettervorort, "abcdefghijklmnopqrstuvwxyz"); |
---|
1240 | if(getconfig("lcd_samsung_plugin_wetterort", NULL) == NULL) |
---|
1241 | changeinput(wettervorort, "Berlin "); |
---|
1242 | else |
---|
1243 | changeinput(wettervorort, getconfig("lcd_samsung_plugin_wetterort", NULL)); |
---|
1244 | |
---|
1245 | if(LCD_Samsung1thread != NULL) |
---|
1246 | changetext(b3, "STOP"); |
---|
1247 | else |
---|
1248 | changetext(b3, "START"); |
---|
1249 | |
---|
1250 | drawscreen(samsung1_main, 0, 0); |
---|
1251 | addscreenrc(samsung1_main, listbox); |
---|
1252 | tmp = listbox->select; |
---|
1253 | |
---|
1254 | while(1) |
---|
1255 | { |
---|
1256 | addscreenrc(samsung1_main, tmp); |
---|
1257 | rcret = waitrc(samsung1_main, 0, 0); |
---|
1258 | tmp = listbox->select; |
---|
1259 | |
---|
1260 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "wettervor") == 0) |
---|
1261 | { |
---|
1262 | if(ostrcmp(wettervor->ret, "yes") == 0) |
---|
1263 | { |
---|
1264 | //wettervorplz->hidden = NO; |
---|
1265 | //wettervorland->hidden = NO; |
---|
1266 | wettervorort->hidden = NO; |
---|
1267 | } else { |
---|
1268 | //wettervorplz->hidden = YES; |
---|
1269 | //wettervorland->hidden = YES; |
---|
1270 | wettervorort->hidden = YES; |
---|
1271 | } |
---|
1272 | |
---|
1273 | drawscreen(samsung1_main, 0, 0); |
---|
1274 | } |
---|
1275 | |
---|
1276 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
1277 | break; |
---|
1278 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
1279 | { |
---|
1280 | addconfig("lcd_samsung_plugin_type", lcdtype->ret); |
---|
1281 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
1282 | addconfig("lcd_samsung_plugin_standby", aktstandby->ret); |
---|
1283 | addconfig("lcd_samsung_plugin_wetter", wettervor->ret); |
---|
1284 | addconfig("lcd_samsung_plugin_wetterort", wettervorort->ret); |
---|
1285 | //addconfig("lcd_samsung_plugin_wetterplz", wettervorplz->ret); |
---|
1286 | //addconfig("lcd_samsung_plugin_wetterland", wettervorland->ret); |
---|
1287 | restart = 1; |
---|
1288 | break; |
---|
1289 | } |
---|
1290 | |
---|
1291 | if(rcret == getrcconfigint("rcblue", NULL)) |
---|
1292 | { |
---|
1293 | addconfig("lcd_samsung_plugin_type", lcdtype->ret); |
---|
1294 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
1295 | addconfig("lcd_samsung_plugin_standby", aktstandby->ret); |
---|
1296 | addconfig("lcd_samsung_plugin_wetter", wettervor->ret); |
---|
1297 | addconfig("lcd_samsung_plugin_wetterort", wettervorort->ret); |
---|
1298 | //addconfig("lcd_samsung_plugin_wetterplz", wettervorplz->ret); |
---|
1299 | //addconfig("lcd_samsung_plugin_wetterland", wettervorland->ret); |
---|
1300 | startstop = 1; |
---|
1301 | break; |
---|
1302 | } |
---|
1303 | } |
---|
1304 | delownerrc(samsung1_main); |
---|
1305 | clearscreen(samsung1_main); |
---|
1306 | |
---|
1307 | if(LCD_Samsung1thread != NULL && restart == 1) |
---|
1308 | { |
---|
1309 | LCD_Samsung1thread->aktion = STOP; |
---|
1310 | system("killall fbread"); |
---|
1311 | sleep(2); |
---|
1312 | addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL); |
---|
1313 | LCD_Samsung1thread = addtimer(&LCD_Samsung1_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
1314 | sleep(1); |
---|
1315 | return; |
---|
1316 | } |
---|
1317 | if(startstop == 1) |
---|
1318 | { |
---|
1319 | if(LCD_Samsung1thread != NULL) |
---|
1320 | { |
---|
1321 | addconfig("lcd_samsung_plugin_running", "no"); |
---|
1322 | LCD_Samsung1thread->aktion = STOP; |
---|
1323 | sleep(1); |
---|
1324 | system("killall fbread"); |
---|
1325 | debug(10, "LCD Samsung unloadet !!!"); |
---|
1326 | sleep(1); |
---|
1327 | } |
---|
1328 | else { |
---|
1329 | addconfig("lcd_samsung_plugin_running", "yes"); |
---|
1330 | firststart = 1; |
---|
1331 | LCD_Samsung1_main(); |
---|
1332 | } |
---|
1333 | } |
---|
1334 | } |
---|