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