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