[42633] | 1 | #include "../../titan/struct.h" |
---|
| 2 | #include "../../titan/debug.h" |
---|
| 3 | #include "../../titan/header.h" |
---|
| 4 | |
---|
| 5 | #include "lcd_weather.h" |
---|
| 6 | |
---|
[42814] | 7 | char pluginname[] = "WLAN Display"; |
---|
[42633] | 8 | char plugindesc[] = "Extensions"; |
---|
| 9 | char pluginpic[] = "%pluginpath%/wlandisplay/wlandisplay.png"; |
---|
| 10 | |
---|
| 11 | int pluginaktiv = 0; |
---|
| 12 | //int pluginversion = PLUGINVERSION; |
---|
| 13 | int pluginversion = 999999; |
---|
| 14 | |
---|
| 15 | struct stimerthread* LCD_Samsung1thread = NULL; |
---|
| 16 | |
---|
| 17 | int firststart = 0; |
---|
| 18 | |
---|
| 19 | void weather_getline(FILE* fd, char* fileline) |
---|
| 20 | { |
---|
| 21 | fgets(fileline, 256, fd); |
---|
| 22 | if(fileline[0] == '#' || fileline[0] == '\n') |
---|
| 23 | return; |
---|
| 24 | if(fileline[strlen(fileline) - 1] == '\n') |
---|
| 25 | fileline[strlen(fileline) - 1] = '\0'; |
---|
| 26 | if(fileline[strlen(fileline) - 1] == '\r') |
---|
| 27 | fileline[strlen(fileline) - 1] = '\0'; |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | void LCD_start_lcd4linux() |
---|
| 31 | { |
---|
| 32 | int count = 0; |
---|
| 33 | char* startlcd = NULL; |
---|
| 34 | |
---|
[42804] | 35 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 36 | { |
---|
| 37 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 38 | startlcd = ostrcat(startlcd, " 1", 1, 0); |
---|
| 39 | } |
---|
[42804] | 40 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 41 | { |
---|
| 42 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 43 | startlcd = ostrcat(startlcd, " 6", 1, 0); |
---|
| 44 | } |
---|
[42804] | 45 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 46 | { |
---|
| 47 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 48 | startlcd = ostrcat(startlcd, " 3", 1, 0); |
---|
| 49 | } |
---|
[42804] | 50 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 51 | { |
---|
| 52 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 53 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
| 54 | } |
---|
[42804] | 55 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 56 | { |
---|
| 57 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 58 | startlcd = ostrcat(startlcd, " 5", 1, 0); |
---|
| 59 | } |
---|
[42804] | 60 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 61 | { |
---|
| 62 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 63 | startlcd = ostrcat(startlcd, " 4", 1, 0); |
---|
| 64 | } |
---|
[42804] | 65 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 66 | { |
---|
| 67 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 68 | startlcd = ostrcat(startlcd, " 7", 1, 0); |
---|
| 69 | } |
---|
[42804] | 70 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 71 | { |
---|
| 72 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 73 | startlcd = ostrcat(startlcd, " 8", 1, 0); |
---|
| 74 | } |
---|
[42804] | 75 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 76 | { |
---|
| 77 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 78 | startlcd = ostrcat(startlcd, " 9", 1, 0); |
---|
| 79 | } |
---|
[42804] | 80 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "none") == 0) |
---|
[42633] | 81 | { |
---|
| 82 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 83 | startlcd = ostrcat(startlcd, " 99", 1, 0); |
---|
| 84 | } |
---|
[42804] | 85 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 86 | { |
---|
| 87 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 88 | startlcd = ostrcat(startlcd, " 98 ", 1, 0); |
---|
[42810] | 89 | startlcd = ostrcat(startlcd, getconfig("lcd_wlan_ip", NULL), 1, 0); |
---|
[42633] | 90 | } |
---|
| 91 | else |
---|
| 92 | { |
---|
| 93 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 94 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
| 95 | } |
---|
| 96 | printf("cmd2: %s\n", startlcd); |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | if(LCD_Samsung1thread == NULL) |
---|
| 100 | return; |
---|
| 101 | while (LCD_Samsung1thread->aktion != STOP && (system("ps | grep -v grep | grep fbread") != 0 && system("ps -A | grep -v grep | grep fbread") != 0)) { |
---|
| 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; |
---|
| 119 | struct skin* LCD_Standby = NULL; |
---|
| 120 | struct skin* LCD_Play = NULL; |
---|
| 121 | struct skin* LCD_Music = NULL; |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | struct skin* city = NULL; |
---|
| 125 | struct skin* wind = NULL; |
---|
| 126 | struct skin* luft = NULL; |
---|
| 127 | struct skin* day0_t = NULL; |
---|
| 128 | struct skin* day0_tm = NULL; |
---|
| 129 | struct skin* day0_i = NULL; |
---|
| 130 | struct skin* day0_d = NULL; |
---|
| 131 | struct skin* day0_dl = NULL; |
---|
| 132 | struct skin* day1_t = NULL; |
---|
| 133 | struct skin* day1_tm = NULL; |
---|
| 134 | struct skin* day1_i = NULL; |
---|
| 135 | struct skin* day1_d = NULL; |
---|
| 136 | struct skin* day1_dl = NULL; |
---|
| 137 | struct skin* day2_t = NULL; |
---|
| 138 | struct skin* day2_tm = NULL; |
---|
| 139 | struct skin* day2_i = NULL; |
---|
| 140 | struct skin* day2_d = NULL; |
---|
| 141 | struct skin* day2_dl = NULL; |
---|
| 142 | struct skin* day3_t = NULL; |
---|
| 143 | struct skin* day3_tm = NULL; |
---|
| 144 | struct skin* day3_i = NULL; |
---|
| 145 | struct skin* day3_d = NULL; |
---|
| 146 | struct skin* day3_dl = NULL; |
---|
| 147 | struct skin* akttime = NULL; |
---|
| 148 | struct skin* akttime_Standby = NULL; |
---|
| 149 | |
---|
| 150 | struct skin* n_stunde = NULL; |
---|
| 151 | struct skin* n_minute = NULL; |
---|
| 152 | struct skin* n_stunde_standby = NULL; |
---|
| 153 | struct skin* n_minute_standby = NULL; |
---|
| 154 | |
---|
| 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 | |
---|
| 160 | struct skin* scity = NULL; |
---|
| 161 | struct skin* swind = NULL; |
---|
| 162 | struct skin* sluft = NULL; |
---|
| 163 | struct skin* sday0_t = NULL; |
---|
| 164 | struct skin* sday0_tm = NULL; |
---|
| 165 | struct skin* sday0_i = NULL; |
---|
| 166 | struct skin* sday0_d = NULL; |
---|
| 167 | struct skin* sday0_dl = NULL; |
---|
| 168 | struct skin* sday1_t = NULL; |
---|
| 169 | struct skin* sday1_tm = NULL; |
---|
| 170 | struct skin* sday1_i = NULL; |
---|
| 171 | struct skin* sday1_d = NULL; |
---|
| 172 | struct skin* sday1_dl = NULL; |
---|
| 173 | struct skin* sday2_t = NULL; |
---|
| 174 | struct skin* sday2_tm = NULL; |
---|
| 175 | struct skin* sday2_i = NULL; |
---|
| 176 | struct skin* sday2_d = NULL; |
---|
| 177 | struct skin* sday2_dl = NULL; |
---|
| 178 | struct skin* sday3_t = NULL; |
---|
| 179 | struct skin* sday3_tm = NULL; |
---|
| 180 | struct skin* sday3_i = NULL; |
---|
| 181 | struct skin* sday3_d = NULL; |
---|
| 182 | struct skin* sday3_dl = NULL; |
---|
| 183 | |
---|
| 184 | char* tmpstr = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *timemerk = NULL, *sendermerk = NULL, *recmerk = NULL; |
---|
| 185 | char* pichr = NULL, *picmin = NULL, *pichr_standby = NULL, *picmin_standby = NULL; |
---|
| 186 | char* pichr2 = NULL, *picmin2 = NULL, *pichr2_standby = NULL, *picmin2_standby = NULL; |
---|
| 187 | int digitaluhr = 0, digitaluhr_standby = 0; |
---|
| 188 | FILE *fd = NULL; |
---|
| 189 | char *fileline = NULL; |
---|
| 190 | int weatherwrite = 999; |
---|
| 191 | int weatherref = 0; |
---|
| 192 | char* startlcd = NULL; |
---|
| 193 | char* bild = NULL; |
---|
| 194 | |
---|
| 195 | printf("lcd_samsung thread started\n"); |
---|
| 196 | |
---|
[42804] | 197 | if(ostrcmp(getconfig("lcd_wlan_plugin_wetter", NULL), "yes") == 0) |
---|
[42633] | 198 | { |
---|
[42804] | 199 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 200 | LCD_Samsung1 = getscreen("LCD_spf75_Wetter"); |
---|
[42804] | 201 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 202 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
[42804] | 203 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 204 | LCD_Samsung1 = getscreen("LCD_spf83_Wetter"); |
---|
[42804] | 205 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 206 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
[42804] | 207 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 208 | LCD_Samsung1 = getscreen("LCD_spf105_Wetter"); |
---|
[42804] | 209 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 210 | LCD_Samsung1 = getscreen("LCD_spf107_Wetter"); |
---|
[42804] | 211 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 212 | LCD_Samsung1 = getscreen("LCD_spf72_Wetter"); |
---|
[42804] | 213 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 214 | LCD_Samsung1 = getscreen("LCD_spf85_Wetter"); |
---|
[42804] | 215 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 216 | LCD_Samsung1 = getscreen("LCD_spf85_Wetter"); |
---|
[42804] | 217 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 218 | LCD_Samsung1 = getscreen("LCD_spf_d320_Wetter"); |
---|
| 219 | else |
---|
| 220 | LCD_Samsung1 = getscreen("LCD_spf87_Wetter"); |
---|
| 221 | city = getscreennode(LCD_Samsung1, "city"); |
---|
| 222 | wind = getscreennode(LCD_Samsung1, "wind"); |
---|
| 223 | luft = getscreennode(LCD_Samsung1, "luft"); |
---|
| 224 | day0_t = getscreennode(LCD_Samsung1, "day0_t"); |
---|
| 225 | day0_tm = getscreennode(LCD_Samsung1, "day0_tm"); |
---|
| 226 | day0_i = getscreennode(LCD_Samsung1, "day0_i"); |
---|
| 227 | day0_d = getscreennode(LCD_Samsung1, "day0_d"); |
---|
| 228 | day0_dl = getscreennode(LCD_Samsung1, "day0_dl"); |
---|
| 229 | day1_t = getscreennode(LCD_Samsung1, "day1_t"); |
---|
| 230 | day1_tm = getscreennode(LCD_Samsung1, "day1_tm"); |
---|
| 231 | day1_i = getscreennode(LCD_Samsung1, "day1_i"); |
---|
| 232 | day1_d = getscreennode(LCD_Samsung1, "day1_d"); |
---|
| 233 | day1_dl = getscreennode(LCD_Samsung1, "day1_dl"); |
---|
| 234 | day2_t = getscreennode(LCD_Samsung1, "day2_t"); |
---|
| 235 | day2_tm = getscreennode(LCD_Samsung1, "day2_tm"); |
---|
| 236 | day2_i = getscreennode(LCD_Samsung1, "day2_i"); |
---|
| 237 | day2_d = getscreennode(LCD_Samsung1, "day2_d"); |
---|
| 238 | day2_dl = getscreennode(LCD_Samsung1, "day2_dl"); |
---|
| 239 | day3_t = getscreennode(LCD_Samsung1, "day3_t"); |
---|
| 240 | day3_tm = getscreennode(LCD_Samsung1, "day3_tm"); |
---|
| 241 | day3_i = getscreennode(LCD_Samsung1, "day3_i"); |
---|
| 242 | day3_d = getscreennode(LCD_Samsung1, "day3_d"); |
---|
| 243 | day3_dl = getscreennode(LCD_Samsung1, "day3_dl"); |
---|
| 244 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
| 245 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
| 246 | n_stunde = getscreennode(LCD_Samsung1, "stunde"); |
---|
| 247 | if(n_stunde != NULL) |
---|
| 248 | { |
---|
| 249 | pichr = ostrcat(n_stunde->pic, "", 0, 0); |
---|
| 250 | if(ostrstr(pichr, "Digital") != NULL) |
---|
| 251 | digitaluhr = 1; |
---|
| 252 | } |
---|
| 253 | n_minute = getscreennode(LCD_Samsung1, "minute"); |
---|
| 254 | if(n_minute != NULL) |
---|
| 255 | picmin = ostrcat(n_minute->pic, "", 0, 0); |
---|
| 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 | } |
---|
| 263 | if(file_exist("/tmp/lcdweather")) |
---|
| 264 | system("rm /tmp/lcdweather"); |
---|
| 265 | weatherwrite = 0; |
---|
| 266 | } |
---|
| 267 | else { |
---|
[42804] | 268 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 269 | LCD_Samsung1 = getscreen("LCD_spf75"); |
---|
[42804] | 270 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 271 | LCD_Samsung1 = getscreen("LCD_spf83"); |
---|
[42804] | 272 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 273 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
[42804] | 274 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 275 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
[42804] | 276 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 277 | LCD_Samsung1 = getscreen("LCD_spf105"); |
---|
[42804] | 278 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 279 | LCD_Samsung1 = getscreen("LCD_spf107"); |
---|
[42804] | 280 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 281 | LCD_Samsung1 = getscreen("LCD_spf72"); |
---|
[42804] | 282 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 283 | LCD_Samsung1 = getscreen("LCD_spf85"); |
---|
[42804] | 284 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 285 | LCD_Samsung1 = getscreen("LCD_spf85"); |
---|
[42804] | 286 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 287 | LCD_Samsung1 = getscreen("LCD_spf_d320"); |
---|
| 288 | else |
---|
| 289 | LCD_Samsung1 = getscreen("LCD_spf87"); |
---|
| 290 | akttime = getscreennode(LCD_Samsung1, "akttime"); |
---|
| 291 | n_stunde = getscreennode(LCD_Samsung1, "stunde"); |
---|
| 292 | if(n_stunde != NULL) |
---|
| 293 | { |
---|
| 294 | pichr = ostrcat(n_stunde->pic, "", 0, 0); |
---|
| 295 | if(ostrstr(pichr, "Digital") != NULL) |
---|
| 296 | digitaluhr = 1; |
---|
| 297 | } |
---|
| 298 | n_minute = getscreennode(LCD_Samsung1, "minute"); |
---|
| 299 | if(n_minute != NULL) |
---|
| 300 | picmin = ostrcat(n_minute->pic, "", 0, 0); |
---|
| 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 | } |
---|
| 308 | } |
---|
| 309 | |
---|
[42804] | 310 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 311 | LCD_Play = getscreen("LCD_spf75_Play"); |
---|
[42804] | 312 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 313 | LCD_Play = getscreen("LCD_spf83_Play"); |
---|
[42804] | 314 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 315 | LCD_Play = getscreen("LCD_spf87_Play"); |
---|
[42804] | 316 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 317 | LCD_Play = getscreen("LCD_spf87_Play"); |
---|
[42804] | 318 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 319 | LCD_Play = getscreen("LCD_spf105_Play"); |
---|
[42804] | 320 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 321 | LCD_Play = getscreen("LCD_spf107_Play"); |
---|
[42804] | 322 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 323 | LCD_Play = getscreen("LCD_spf72_Play"); |
---|
[42804] | 324 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 325 | LCD_Play = getscreen("LCD_spf85_Play"); |
---|
[42804] | 326 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 327 | LCD_Play = getscreen("LCD_spf85_Play"); |
---|
[42804] | 328 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 329 | LCD_Play = getscreen("LCD_spf_d320_Play"); |
---|
| 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"); |
---|
| 338 | |
---|
[42804] | 339 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 340 | LCD_Music = getscreen("LCD_spf75_Music"); |
---|
[42804] | 341 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 342 | LCD_Music = getscreen("LCD_spf83_Music"); |
---|
[42804] | 343 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 344 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
[42804] | 345 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 346 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
[42804] | 347 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 348 | LCD_Music = getscreen("LCD_spf105_Music"); |
---|
[42804] | 349 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 350 | LCD_Music = getscreen("LCD_spf107_Music"); |
---|
[42804] | 351 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 352 | LCD_Music = getscreen("LCD_spf72_Music"); |
---|
[42804] | 353 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 354 | LCD_Music = getscreen("LCD_spf85_Music"); |
---|
[42804] | 355 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 356 | LCD_Music = getscreen("LCD_spf85_Music"); |
---|
[42804] | 357 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 358 | LCD_Music = getscreen("LCD_spf_d320_Music"); |
---|
| 359 | else |
---|
| 360 | LCD_Music = getscreen("LCD_spf87_Music"); |
---|
| 361 | |
---|
| 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"); |
---|
| 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 | |
---|
[42804] | 376 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 377 | { |
---|
| 378 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 379 | startlcd = ostrcat(startlcd, " 1", 1, 0); |
---|
| 380 | } |
---|
[42804] | 381 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 382 | { |
---|
| 383 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 384 | startlcd = ostrcat(startlcd, " 6", 1, 0); |
---|
| 385 | } |
---|
[42804] | 386 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 387 | { |
---|
| 388 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 389 | startlcd = ostrcat(startlcd, " 3", 1, 0); |
---|
| 390 | } |
---|
[42804] | 391 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 392 | { |
---|
| 393 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 394 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
| 395 | } |
---|
[42804] | 396 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 397 | { |
---|
| 398 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 399 | startlcd = ostrcat(startlcd, " 5", 1, 0); |
---|
| 400 | } |
---|
[42804] | 401 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 402 | { |
---|
| 403 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 404 | startlcd = ostrcat(startlcd, " 4", 1, 0); |
---|
| 405 | } |
---|
[42804] | 406 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 407 | { |
---|
| 408 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 409 | startlcd = ostrcat(startlcd, " 7", 1, 0); |
---|
| 410 | } |
---|
[42804] | 411 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 412 | { |
---|
| 413 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 414 | startlcd = ostrcat(startlcd, " 8", 1, 0); |
---|
| 415 | } |
---|
[42804] | 416 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 417 | { |
---|
| 418 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 419 | startlcd = ostrcat(startlcd, " 9", 1, 0); |
---|
| 420 | } |
---|
[42804] | 421 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "none") == 0) |
---|
[42633] | 422 | { |
---|
| 423 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 424 | startlcd = ostrcat(startlcd, " 99", 1, 0); |
---|
| 425 | } |
---|
[42804] | 426 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 427 | { |
---|
| 428 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 429 | startlcd = ostrcat(startlcd, " 98 ", 1, 0); |
---|
[42810] | 430 | startlcd = ostrcat(startlcd, getconfig("lcd_wlan_ip", NULL), 1, 0); |
---|
[42633] | 431 | } |
---|
| 432 | else |
---|
| 433 | { |
---|
| 434 | startlcd = createpluginpath("/wlandisplay/start.sh", 0); |
---|
| 435 | startlcd = ostrcat(startlcd, " 2", 1, 0); |
---|
| 436 | } |
---|
| 437 | printf("cmd1: %s\n", startlcd); |
---|
| 438 | |
---|
| 439 | |
---|
[42804] | 440 | if(ostrcmp(getconfig("lcd_wlan_plugin_standby", NULL), "yes") == 0) |
---|
[42633] | 441 | { |
---|
[42804] | 442 | if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf75h") == 0) |
---|
[42633] | 443 | LCD_Standby = getscreen("LCD_spf75_Standby"); |
---|
[42804] | 444 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf83h") == 0) |
---|
[42633] | 445 | LCD_Standby = getscreen("LCD_spf83_Standby"); |
---|
[42804] | 446 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87h") == 0) |
---|
[42633] | 447 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
[42804] | 448 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf87hold") == 0) |
---|
[42633] | 449 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
[42804] | 450 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf105p") == 0) |
---|
[42633] | 451 | LCD_Standby = getscreen("LCD_spf105_Standby"); |
---|
[42804] | 452 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf107h") == 0) |
---|
[42633] | 453 | LCD_Standby = getscreen("LCD_spf107_Standby"); |
---|
[42804] | 454 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf72h") == 0) |
---|
[42633] | 455 | LCD_Standby = getscreen("LCD_spf72_Standby"); |
---|
[42804] | 456 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85h") == 0) |
---|
[42633] | 457 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
[42804] | 458 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "spf85p") == 0) |
---|
[42633] | 459 | LCD_Standby = getscreen("LCD_spf85_Standby"); |
---|
[42804] | 460 | else if(ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") == 0) |
---|
[42633] | 461 | LCD_Standby = getscreen("LCD_spf_d320_Standby"); |
---|
| 462 | else |
---|
| 463 | LCD_Standby = getscreen("LCD_spf87_Standby"); |
---|
| 464 | akttime_Standby = getscreennode(LCD_Standby, "akttime"); |
---|
| 465 | scity = getscreennode(LCD_Standby, "city"); |
---|
| 466 | swind = getscreennode(LCD_Standby, "wind"); |
---|
| 467 | sluft = getscreennode(LCD_Standby, "luft"); |
---|
| 468 | sday0_t = getscreennode(LCD_Standby, "day0_t"); |
---|
| 469 | sday0_tm = getscreennode(LCD_Standby, "day0_tm"); |
---|
| 470 | sday0_i = getscreennode(LCD_Standby, "day0_i"); |
---|
| 471 | sday0_d = getscreennode(LCD_Standby, "day0_d"); |
---|
| 472 | sday0_dl = getscreennode(LCD_Standby, "day0_dl"); |
---|
| 473 | sday1_t = getscreennode(LCD_Standby, "day1_t"); |
---|
| 474 | sday1_tm = getscreennode(LCD_Standby, "day1_tm"); |
---|
| 475 | sday1_i = getscreennode(LCD_Standby, "day1_i"); |
---|
| 476 | sday1_d = getscreennode(LCD_Standby, "day1_d"); |
---|
| 477 | sday1_dl = getscreennode(LCD_Standby, "day1_dl"); |
---|
| 478 | sday2_t = getscreennode(LCD_Standby, "day2_t"); |
---|
| 479 | sday2_tm = getscreennode(LCD_Standby, "day2_tm"); |
---|
| 480 | sday2_i = getscreennode(LCD_Standby, "day2_i"); |
---|
| 481 | sday2_d = getscreennode(LCD_Standby, "day2_d"); |
---|
| 482 | sday2_dl = getscreennode(LCD_Standby, "day2_dl"); |
---|
| 483 | sday3_t = getscreennode(LCD_Standby, "day3_t"); |
---|
| 484 | sday3_tm = getscreennode(LCD_Standby, "day3_tm"); |
---|
| 485 | sday3_i = getscreennode(LCD_Standby, "day3_i"); |
---|
| 486 | sday3_d = getscreennode(LCD_Standby, "day3_d"); |
---|
| 487 | sday3_dl = getscreennode(LCD_Standby, "day3_dl"); |
---|
| 488 | |
---|
| 489 | n_stunde_standby = getscreennode(LCD_Standby, "stunde"); |
---|
| 490 | if(n_stunde_standby != NULL) |
---|
| 491 | { |
---|
| 492 | pichr_standby = ostrcat(n_stunde_standby->pic, "", 0, 0); |
---|
| 493 | if(ostrstr(pichr_standby, "Digital") != NULL) |
---|
| 494 | digitaluhr_standby = 1; |
---|
| 495 | } |
---|
| 496 | n_minute_standby = getscreennode(LCD_Standby, "minute"); |
---|
| 497 | if(n_minute_standby != NULL) |
---|
| 498 | picmin_standby = ostrcat(n_minute_standby->pic, "", 0, 0); |
---|
| 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 | } |
---|
| 506 | } |
---|
| 507 | |
---|
| 508 | |
---|
| 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 | |
---|
| 516 | int hr = 0, min = 0; |
---|
| 517 | |
---|
| 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"); |
---|
| 528 | hr = atoi(gettime(NULL, "%H")); |
---|
| 529 | min = atoi(gettime(NULL, "%M")); |
---|
| 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 | } |
---|
| 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 | } |
---|
| 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 | |
---|
| 584 | if(status.standby > 0 && standby == 0) |
---|
| 585 | { |
---|
[42804] | 586 | if(ostrcmp(getconfig("lcd_wlan_plugin_standby", NULL), "yes") == 0) |
---|
[42633] | 587 | standby = 2; |
---|
| 588 | else |
---|
| 589 | { |
---|
| 590 | tmpstr = createpluginpath("/wlandisplay/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("/wlandisplay/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) |
---|
| 631 | { |
---|
| 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; |
---|
| 640 | } |
---|
| 641 | else if(tmpstr3 != NULL && recmerk == NULL) |
---|
| 642 | { |
---|
| 643 | free(recmerk);recmerk=NULL; |
---|
| 644 | recmerk = ostrcat(tmpstr3, "", 0, 0); |
---|
| 645 | put = 1; |
---|
| 646 | } |
---|
| 647 | } |
---|
| 648 | else if(type == 2) |
---|
| 649 | { |
---|
| 650 | if(loopcount >= 15) |
---|
| 651 | { |
---|
| 652 | put = 1; |
---|
| 653 | loopcount = 0; |
---|
| 654 | } |
---|
| 655 | } |
---|
| 656 | else if(type == 3) |
---|
| 657 | { |
---|
| 658 | if(loopcount >= 15) |
---|
| 659 | { |
---|
| 660 | put = 1; |
---|
| 661 | loopcount = 0; |
---|
| 662 | } |
---|
| 663 | } |
---|
| 664 | |
---|
| 665 | if(put == 1) |
---|
| 666 | { |
---|
| 667 | if(type == 1) |
---|
| 668 | { |
---|
| 669 | // Wettervorhersage |
---|
[42804] | 670 | printf("lcd_samsung wetter = %s\n", getconfig("lcd_wlan_plugin_wetter", NULL)); |
---|
| 671 | if(ostrcmp(getconfig("lcd_wlan_plugin_wetter", NULL), "yes") == 0) |
---|
[42633] | 672 | { |
---|
| 673 | if(weatherwrite == 0) |
---|
| 674 | { |
---|
| 675 | printf("lcd_samsung weatherwrite=0\n"); |
---|
| 676 | if(weatherthread == NULL) |
---|
| 677 | { |
---|
| 678 | printf("lcd_samsung weatherthread=NULL\n"); |
---|
| 679 | if(!file_exist("/tmp/lcdweather")) |
---|
| 680 | weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); |
---|
| 681 | else |
---|
| 682 | { |
---|
| 683 | fileline = malloc(256); |
---|
| 684 | if(fileline != NULL) |
---|
| 685 | { |
---|
| 686 | fd = fopen("/tmp/lcdweather", "r"); |
---|
| 687 | if(fd != NULL) |
---|
| 688 | { |
---|
[42804] | 689 | if(ostrcmp(getconfig("lcd_wlan_plugin_standby", NULL), "yes") == 0) |
---|
[42633] | 690 | { |
---|
| 691 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
| 692 | changetext(day0_d, fileline); |
---|
| 693 | changetext(sday0_d, fileline); |
---|
| 694 | weather_getline(fd, fileline); |
---|
| 695 | changetext(day0_tm, fileline); |
---|
| 696 | changetext(sday0_tm, fileline); |
---|
| 697 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 708 | weather_getline(fd, fileline); |
---|
| 709 | changetext(day1_tm, fileline); |
---|
| 710 | changetext(sday1_tm, fileline); |
---|
| 711 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 722 | weather_getline(fd, fileline); |
---|
| 723 | changetext(day2_tm, fileline); |
---|
| 724 | changetext(sday2_tm, fileline); |
---|
| 725 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 736 | weather_getline(fd, fileline); |
---|
| 737 | changetext(day3_tm, fileline); |
---|
| 738 | changetext(sday3_tm, fileline); |
---|
| 739 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 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 | |
---|
| 769 | } |
---|
| 770 | else |
---|
| 771 | { |
---|
| 772 | weather_getline(fd, fileline);weather_getline(fd, fileline); |
---|
| 773 | changetext(day0_d, fileline); |
---|
| 774 | weather_getline(fd, fileline); |
---|
| 775 | changetext(day0_tm, fileline); |
---|
| 776 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 784 | weather_getline(fd, fileline); |
---|
| 785 | changetext(day1_tm, fileline); |
---|
| 786 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 794 | weather_getline(fd, fileline); |
---|
| 795 | changetext(day2_tm, fileline); |
---|
| 796 | weather_getline(fd, fileline); |
---|
| 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); |
---|
| 804 | weather_getline(fd, fileline); |
---|
| 805 | changetext(day3_tm, fileline); |
---|
| 806 | weather_getline(fd, fileline); |
---|
| 807 | changetext(day3_t, fileline); |
---|
| 808 | weather_getline(fd, fileline); |
---|
| 809 | weather_getline(fd, fileline); |
---|
| 810 | changepic(day3_i, fileline); |
---|
| 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); |
---|
| 826 | } |
---|
| 827 | fclose(fd); |
---|
| 828 | } |
---|
| 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; |
---|
| 847 | } |
---|
| 848 | if(n_stunde != NULL && digitaluhr == 0) |
---|
| 849 | { |
---|
| 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; |
---|
| 870 | } |
---|
| 871 | if(digitaluhr == 1) |
---|
| 872 | { |
---|
| 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 | } |
---|
| 887 | |
---|
| 888 | m_lock(&status.drawingmutex, 0); |
---|
| 889 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
| 890 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
| 891 | m_unlock(&status.drawingmutex, 0); |
---|
| 892 | } |
---|
| 893 | else if(standby == 2) |
---|
| 894 | { |
---|
| 895 | if(akttime_Standby != NULL) |
---|
| 896 | changetext(akttime_Standby, tmpstr); |
---|
| 897 | if(n_minute_standby != NULL && digitaluhr_standby == 0) |
---|
| 898 | { |
---|
| 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; |
---|
| 904 | } |
---|
| 905 | if(n_stunde_standby != NULL && digitaluhr_standby == 0) |
---|
| 906 | { |
---|
| 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 | } |
---|
| 944 | m_lock(&status.drawingmutex, 0); |
---|
| 945 | drawscreen(LCD_Standby, 0, 2); |
---|
| 946 | m_unlock(&status.drawingmutex, 0); |
---|
| 947 | put = 0; |
---|
| 948 | } |
---|
| 949 | } |
---|
| 950 | else if(type == 2) |
---|
| 951 | { |
---|
| 952 | playertype = getconfigint("lastplayertype", NULL); |
---|
| 953 | //if(status.mcaktiv == 1) |
---|
| 954 | //playertype = 0; |
---|
| 955 | //else |
---|
| 956 | ////playertype = getconfigint("playertype", NULL); |
---|
| 957 | //playertype = 1; |
---|
| 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; |
---|
| 981 | |
---|
| 982 | tmpstr2 = convert_timesec(len); |
---|
| 983 | changetext(slen, tmpstr2); |
---|
| 984 | free(tmpstr2); tmpstr2 = NULL; |
---|
| 985 | |
---|
| 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)); |
---|
| 992 | m_lock(&status.drawingmutex, 0); |
---|
| 993 | if(drawscreen(LCD_Play, 0, 2) == -2) |
---|
| 994 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
| 995 | m_unlock(&status.drawingmutex, 0); |
---|
| 996 | } |
---|
| 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); |
---|
| 1028 | changetext(mactors, musicdat.actors); |
---|
| 1029 | |
---|
| 1030 | //if(file_exist(musicdat.thumb)) |
---|
| 1031 | if(file_exist("/tmp/mccover.jpg")) |
---|
| 1032 | { |
---|
| 1033 | mthumb->hidden = NO; |
---|
| 1034 | changepic(mthumb, musicdat.thumb); |
---|
| 1035 | } |
---|
| 1036 | else |
---|
| 1037 | mthumb->hidden = YES; |
---|
| 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 | } |
---|
| 1044 | } |
---|
| 1045 | } |
---|
| 1046 | else |
---|
| 1047 | { |
---|
| 1048 | if(standby == 2) |
---|
| 1049 | { |
---|
| 1050 | if(put == 1) |
---|
| 1051 | { |
---|
| 1052 | changetext(akttime_Standby, tmpstr); |
---|
| 1053 | m_lock(&status.drawingmutex, 0); |
---|
| 1054 | drawscreen(LCD_Standby, 0, 2); |
---|
| 1055 | m_unlock(&status.drawingmutex, 0); |
---|
| 1056 | put = 0; |
---|
| 1057 | } |
---|
| 1058 | } |
---|
| 1059 | } |
---|
| 1060 | |
---|
| 1061 | free(tmpstr); tmpstr = NULL; |
---|
| 1062 | free(tmpstr2); tmpstr2 = NULL; |
---|
| 1063 | free(tmpstr3); tmpstr3 = NULL; |
---|
| 1064 | //sleep(1); |
---|
| 1065 | usleep(500000); |
---|
| 1066 | |
---|
[42804] | 1067 | if(ostrcmp(getconfig("lcd_wlan_plugin_wetter", NULL), "yes") == 0) |
---|
[42633] | 1068 | { |
---|
| 1069 | weatherref = weatherref + 1; |
---|
| 1070 | if(weatherref == 7200) |
---|
| 1071 | { |
---|
| 1072 | weatherwrite = 0; |
---|
| 1073 | system("rm /tmp/lcdweather"); |
---|
| 1074 | weatherref = 0; |
---|
| 1075 | } |
---|
| 1076 | } |
---|
| 1077 | } |
---|
| 1078 | free(timemerk);timemerk=NULL; |
---|
| 1079 | free(sendermerk);sendermerk=NULL; |
---|
| 1080 | free(recmerk);recmerk=NULL; |
---|
| 1081 | free(startlcd);startlcd=NULL; |
---|
| 1082 | free(pichr);pichr=NULL; |
---|
| 1083 | free(picmin);picmin=NULL; |
---|
| 1084 | free(pichr_standby);pichr=NULL; |
---|
| 1085 | free(picmin_standby);picmin=NULL; |
---|
| 1086 | free(pichr2);pichr2=NULL; |
---|
| 1087 | free(picmin2);picmin2=NULL; |
---|
| 1088 | free(pichr2_standby);pichr2_standby=NULL; |
---|
| 1089 | free(picmin2_standby);picmin2_standby=NULL; |
---|
[42804] | 1090 | addconfig("lcd_wlan_plugin_running", "no"); |
---|
[42633] | 1091 | LCD_Samsung1thread = NULL; |
---|
| 1092 | m_lock(&status.drawingmutex, 0); |
---|
| 1093 | if(drawscreen(LCD_Samsung1, 0, 2) == -2) |
---|
| 1094 | printf("nicht genug Speicher fuer drawscreen\n"); |
---|
| 1095 | m_unlock(&status.drawingmutex, 0); |
---|
| 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; |
---|
| 1105 | |
---|
| 1106 | tmpstr = createpluginpath("/wlandisplay/start.png", 0); |
---|
| 1107 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
| 1108 | tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); |
---|
| 1109 | system(tmpstr); |
---|
| 1110 | free(tmpstr); tmpstr=NULL; |
---|
[42804] | 1111 | addconfig("lcd_wlan_plugin_running", "yes"); |
---|
[42633] | 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; |
---|
| 1131 | |
---|
| 1132 | tmpstr = ostrcat("/var/usr/local/share/titan/plugins/wlandisplay/skin2.xml", NULL, 0, 0); |
---|
| 1133 | if(!file_exist(tmpstr)) |
---|
| 1134 | { |
---|
| 1135 | free(tmpstr); tmpstr = NULL; |
---|
| 1136 | tmpstr = ostrcat("/var/swap/usr/local/share/titan/plugins/wlandisplay/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/wlandisplay/skin2.xml", NULL, 0, 0); |
---|
| 1142 | } |
---|
| 1143 | if(!file_exist(tmpstr)) |
---|
| 1144 | { |
---|
| 1145 | free(tmpstr); tmpstr = NULL; |
---|
| 1146 | tmpstr = createpluginpath("/wlandisplay/skin.xml", 0); |
---|
| 1147 | } |
---|
| 1148 | |
---|
| 1149 | printf("use skin: %s\n", tmpstr); |
---|
| 1150 | |
---|
| 1151 | readscreen(tmpstr, 119, 1); |
---|
| 1152 | free(tmpstr); tmpstr = NULL; |
---|
| 1153 | |
---|
[42810] | 1154 | tmpstr = createpluginpath("/wlandisplay/black.jpg", 0); |
---|
[42633] | 1155 | tmpstr = ostrcat("cp ", tmpstr, 0, 1); |
---|
| 1156 | tmpstr = ostrcat(tmpstr, " /tmp/fbreadstop.jpg", 1, 0); |
---|
| 1157 | |
---|
| 1158 | system(tmpstr); |
---|
| 1159 | free(tmpstr); tmpstr = NULL; |
---|
| 1160 | system("killall fbread"); |
---|
[42810] | 1161 | debug(10, "LCD WLAN SPF.. loadet !!!"); |
---|
[42804] | 1162 | tmpstr = getconfig("lcd_wlan_plugin_running", NULL); |
---|
[42633] | 1163 | if(ostrcmp(tmpstr, "yes") == 0) |
---|
| 1164 | LCD_Samsung1_main(); |
---|
| 1165 | tmpstr = NULL; |
---|
| 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"); |
---|
[42810] | 1176 | debug(10, "LCD WLAN unloadet !!!"); |
---|
[42633] | 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"); |
---|
| 1186 | struct skin* lcdip = getscreennode(samsung1_main, "lcdip"); |
---|
| 1187 | struct skin* allmenu = getscreennode(samsung1_main, "allmenu"); |
---|
| 1188 | struct skin* aktstandby = getscreennode(samsung1_main, "aktstandby"); |
---|
| 1189 | struct skin* wettervor = getscreennode(samsung1_main, "wettervor"); |
---|
| 1190 | struct skin* wettervorort = getscreennode(samsung1_main, "wettervorort"); |
---|
| 1191 | //struct skin* wettervorplz = getscreennode(samsung1_main, "wettervorplz"); |
---|
| 1192 | //struct skin* wettervorland = getscreennode(samsung1_main, "wettervorland"); |
---|
| 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 | |
---|
[42804] | 1200 | if(getconfig("lcd_wlan_plugin_wetter", NULL) == NULL || ostrcmp(getconfig("lcd_wlan_plugin_wetter", NULL), "no") == 0) |
---|
[42633] | 1201 | { |
---|
| 1202 | //wettervorplz->hidden = YES; |
---|
| 1203 | //wettervorland->hidden = YES; |
---|
| 1204 | wettervorort->hidden = YES; |
---|
| 1205 | } |
---|
[42810] | 1206 | changeinput(lcdip, getconfig("lcd_wlan_ip", NULL)); |
---|
| 1207 | /*if(getconfig("lcd_wlan_plugin_type", NULL) == NULL || ostrcmp(getconfig("lcd_wlan_plugin_type", NULL), "d320") != 0) |
---|
[42633] | 1208 | { |
---|
| 1209 | lcdip->hidden = YES; |
---|
[42810] | 1210 | }*/ |
---|
[42633] | 1211 | |
---|
[42810] | 1212 | /*addchoicebox(lcdtype, "spf72h", _("SPF-72H")); |
---|
[42633] | 1213 | addchoicebox(lcdtype, "spf75h", _("SPF-75H")); |
---|
| 1214 | addchoicebox(lcdtype, "spf83h", _("SPF-83H")); |
---|
| 1215 | addchoicebox(lcdtype, "spf85h", _("SPF-85H")); |
---|
| 1216 | addchoicebox(lcdtype, "spf85p", _("SPF-85P")); |
---|
| 1217 | addchoicebox(lcdtype, "spf87h", _("SPF-87H")); |
---|
| 1218 | addchoicebox(lcdtype, "spf87hold", _("SPF-87H-old")); |
---|
| 1219 | addchoicebox(lcdtype, "spf105p", _("SPF-105P")); |
---|
| 1220 | addchoicebox(lcdtype, "spf107h", _("SPF-107H")); |
---|
[42810] | 1221 | addchoicebox(lcdtype, "none", _("tiMote"));*/ |
---|
[42633] | 1222 | addchoicebox(lcdtype, "d320", _("Dummy-320")); |
---|
[42804] | 1223 | setchoiceboxselection(lcdtype, getconfig("lcd_wlan_plugin_type", NULL)); |
---|
[42633] | 1224 | |
---|
| 1225 | addchoicebox(allmenu, "no", _("nein")); |
---|
| 1226 | addchoicebox(allmenu, "yes", _("ja")); |
---|
| 1227 | setchoiceboxselection(allmenu, getconfig("write_fb_to_jpg", NULL)); |
---|
| 1228 | |
---|
| 1229 | addchoicebox(aktstandby, "no", _("nein")); |
---|
| 1230 | addchoicebox(aktstandby, "yes", _("ja")); |
---|
[42804] | 1231 | setchoiceboxselection(aktstandby, getconfig("lcd_wlan_plugin_standby", NULL)); |
---|
[42633] | 1232 | |
---|
| 1233 | addchoicebox(wettervor, "no", _("nein")); |
---|
| 1234 | addchoicebox(wettervor, "yes", _("ja")); |
---|
[42804] | 1235 | setchoiceboxselection(wettervor, getconfig("lcd_wlan_plugin_wetter", NULL)); |
---|
[42633] | 1236 | |
---|
| 1237 | //changemask(wettervorplz, "0000"); |
---|
[42804] | 1238 | //if(getconfig("lcd_wlan_plugin_wetterplz", NULL) == NULL) |
---|
[42633] | 1239 | // changeinput(wettervorplz, "10407"); |
---|
| 1240 | //else |
---|
[42804] | 1241 | // changeinput(wettervorplz, getconfig("lcd_wlan_plugin_wetterplz", NULL)); |
---|
[42633] | 1242 | |
---|
| 1243 | //changemask(wettervorland, "abcdefghijklmnopqrstuvwxyz"); |
---|
[42804] | 1244 | //if(getconfig("lcd_wlan_plugin_wetterland", NULL) == NULL) |
---|
[42633] | 1245 | // changeinput(wettervorland, "Germany"); |
---|
| 1246 | //else |
---|
[42804] | 1247 | // changeinput(wettervorland, getconfig("lcd_wlan_plugin_wetterland", NULL)); |
---|
[42633] | 1248 | |
---|
| 1249 | changemask(wettervorort, "abcdefghijklmnopqrstuvwxyz"); |
---|
[42804] | 1250 | if(getconfig("lcd_wlan_plugin_wetterort", NULL) == NULL) |
---|
[42633] | 1251 | changeinput(wettervorort, "Berlin "); |
---|
| 1252 | else |
---|
[42804] | 1253 | changeinput(wettervorort, getconfig("lcd_wlan_plugin_wetterort", NULL)); |
---|
[42633] | 1254 | |
---|
| 1255 | if(LCD_Samsung1thread != NULL) |
---|
| 1256 | changetext(b3, "STOP"); |
---|
| 1257 | else |
---|
| 1258 | changetext(b3, "START"); |
---|
| 1259 | |
---|
| 1260 | drawscreen(samsung1_main, 0, 0); |
---|
| 1261 | addscreenrc(samsung1_main, listbox); |
---|
| 1262 | tmp = listbox->select; |
---|
| 1263 | |
---|
| 1264 | while(1) |
---|
| 1265 | { |
---|
| 1266 | addscreenrc(samsung1_main, tmp); |
---|
| 1267 | rcret = waitrc(samsung1_main, 0, 0); |
---|
| 1268 | tmp = listbox->select; |
---|
| 1269 | |
---|
| 1270 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "wettervor") == 0) |
---|
| 1271 | { |
---|
| 1272 | if(ostrcmp(wettervor->ret, "yes") == 0) |
---|
| 1273 | { |
---|
| 1274 | //wettervorplz->hidden = NO; |
---|
| 1275 | //wettervorland->hidden = NO; |
---|
| 1276 | wettervorort->hidden = NO; |
---|
| 1277 | } else { |
---|
| 1278 | //wettervorplz->hidden = YES; |
---|
| 1279 | //wettervorland->hidden = YES; |
---|
| 1280 | wettervorort->hidden = YES; |
---|
| 1281 | } |
---|
| 1282 | |
---|
| 1283 | drawscreen(samsung1_main, 0, 0); |
---|
| 1284 | } |
---|
| 1285 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "lcdtype") == 0) |
---|
| 1286 | { |
---|
| 1287 | if(ostrcmp(lcdtype->ret, "d320") == 0) |
---|
| 1288 | { |
---|
| 1289 | lcdip->hidden = NO; |
---|
| 1290 | } else { |
---|
| 1291 | lcdip->hidden = YES; |
---|
| 1292 | } |
---|
| 1293 | |
---|
| 1294 | drawscreen(samsung1_main, 0, 0); |
---|
| 1295 | } |
---|
| 1296 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
| 1297 | break; |
---|
| 1298 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
| 1299 | { |
---|
[42804] | 1300 | addconfig("lcd_wlan_plugin_type", lcdtype->ret); |
---|
[42633] | 1301 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
[42804] | 1302 | addconfig("lcd_wlan_plugin_standby", aktstandby->ret); |
---|
| 1303 | addconfig("lcd_wlan_plugin_wetter", wettervor->ret); |
---|
| 1304 | addconfig("lcd_wlan_plugin_wetterort", wettervorort->ret); |
---|
[42810] | 1305 | addconfig("lcd_wlan_ip", lcdip->ret); |
---|
[42804] | 1306 | //addconfig("lcd_wlan_plugin_wetterplz", wettervorplz->ret); |
---|
| 1307 | //addconfig("lcd_wlan_plugin_wetterland", wettervorland->ret); |
---|
[42633] | 1308 | restart = 1; |
---|
| 1309 | break; |
---|
| 1310 | } |
---|
| 1311 | |
---|
| 1312 | if(rcret == getrcconfigint("rcblue", NULL)) |
---|
| 1313 | { |
---|
[42804] | 1314 | addconfig("lcd_wlan_plugin_type", lcdtype->ret); |
---|
[42633] | 1315 | addconfig("write_fb_to_jpg", allmenu->ret); |
---|
[42804] | 1316 | addconfig("lcd_wlan_plugin_standby", aktstandby->ret); |
---|
| 1317 | addconfig("lcd_wlan_plugin_wetter", wettervor->ret); |
---|
| 1318 | addconfig("lcd_wlan_plugin_wetterort", wettervorort->ret); |
---|
[42810] | 1319 | addconfig("lcd_wlan_ip", lcdip->ret); |
---|
[42804] | 1320 | //addconfig("lcd_wlan_plugin_wetterplz", wettervorplz->ret); |
---|
| 1321 | //addconfig("lcd_wlan_plugin_wetterland", wettervorland->ret); |
---|
[42633] | 1322 | startstop = 1; |
---|
| 1323 | break; |
---|
| 1324 | } |
---|
| 1325 | } |
---|
| 1326 | delownerrc(samsung1_main); |
---|
| 1327 | clearscreen(samsung1_main); |
---|
| 1328 | |
---|
| 1329 | if(LCD_Samsung1thread != NULL && restart == 1) |
---|
| 1330 | { |
---|
| 1331 | LCD_Samsung1thread->aktion = STOP; |
---|
| 1332 | system("killall fbread"); |
---|
| 1333 | sleep(2); |
---|
| 1334 | addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL); |
---|
| 1335 | LCD_Samsung1thread = addtimer(&LCD_Samsung1_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
| 1336 | sleep(1); |
---|
| 1337 | return; |
---|
| 1338 | } |
---|
| 1339 | if(startstop == 1) |
---|
| 1340 | { |
---|
| 1341 | if(LCD_Samsung1thread != NULL) |
---|
| 1342 | { |
---|
[42804] | 1343 | addconfig("lcd_wlan_plugin_running", "no"); |
---|
[42633] | 1344 | LCD_Samsung1thread->aktion = STOP; |
---|
| 1345 | sleep(1); |
---|
| 1346 | system("killall fbread"); |
---|
[42810] | 1347 | debug(10, "LCD WLAN unloadet !!!"); |
---|
[42633] | 1348 | sleep(1); |
---|
| 1349 | } |
---|
| 1350 | else { |
---|
[42804] | 1351 | addconfig("lcd_wlan_plugin_running", "yes"); |
---|
[42633] | 1352 | firststart = 1; |
---|
| 1353 | LCD_Samsung1_main(); |
---|
| 1354 | } |
---|
| 1355 | } |
---|
| 1356 | } |
---|