Changeset 20406
- Timestamp:
- 03/08/13 18:52:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/lcdsamsung/lcdsamsung.c
r20335 r20406 10 10 11 11 int pluginaktiv = 0; 12 int pluginversion = PLUGINVERSION; 12 //int pluginversion = PLUGINVERSION; 13 int pluginversion = 999999; 13 14 14 15 struct stimerthread* LCD_Samsung1thread = NULL; … … 94 95 struct skin* akttime_Standby = NULL; 95 96 97 struct skin* n_stunde = NULL; 98 struct skin* n_minute = NULL; 99 96 100 struct skin* sday0_t = NULL; 97 101 struct skin* sday0_i = NULL; … … 109 113 110 114 char* tmpstr = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *timemerk = NULL, *sendermerk = NULL, *recmerk = NULL; 115 char* pichr = NULL, *picmin = NULL, *pichr_standby = NULL, *picmin_standby = NULL; 111 116 FILE *fd = NULL; 112 117 char *fileline = NULL; … … 150 155 day3_d = getscreennode(LCD_Samsung1, "day3_d"); 151 156 akttime = getscreennode(LCD_Samsung1, "akttime"); 157 n_stunde = getscreennode(LCD_Samsung1, "stunde"); 158 n_minute = getscreennode(LCD_Samsung1, "minute"); 152 159 if(file_exist("/tmp/lcdweather")) 153 160 system("rm /tmp/lcdweather"); … … 176 183 LCD_Samsung1 = getscreen("LCD_spf87"); 177 184 akttime = getscreennode(LCD_Samsung1, "akttime"); 185 n_stunde = getscreennode(LCD_Samsung1, "stunde"); 186 if(n_stunde != NULL) 187 pichr = ostrcat(n_stunde->pic, "", 0, 0); 188 n_minute = getscreennode(LCD_Samsung1, "minute"); 189 if(n_minute != NULL) 190 picmin = ostrcat(n_minute->pic, "", 0, 0); 178 191 } 179 192 … … 264 277 sday3_i = getscreennode(LCD_Standby, "day3_i"); 265 278 sday3_d = getscreennode(LCD_Standby, "day3_d"); 279 280 struct skin* n_stunde_standby = getscreennode(LCD_Standby, "stunde"); 281 if(n_stunde_standby != NULL) 282 pichr_standby = ostrcat(n_stunde_standby->pic, "", 0, 0); 283 struct skin* n_minute_standby = getscreennode(LCD_Standby, "minute"); 284 if(n_minute_standby != NULL) 285 picmin_standby = ostrcat(n_minute_standby->pic, "", 0, 0); 286 266 287 } 267 288 … … 273 294 int playertype = 0; 274 295 int loopcount = 0; 296 297 int hr = 0, min = 0; 275 298 276 299 if(firststart == 1) … … 284 307 285 308 tmpstr = gettime(NULL, "%H:%M"); 309 hr = atoi(gettime(NULL, "%H")); 310 min = atoi(gettime(NULL, "%M")); 286 311 287 312 // TV Programm läuft … … 515 540 if(standby == 0) 516 541 { 517 changetext(akttime, tmpstr); 542 if(akttime != NULL) 543 changetext(akttime, tmpstr); 544 if(n_minute != NULL) 545 { 546 free(tmpstr);tmpstr=NULL; 547 tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); 548 free(n_minute->pic); 549 n_minute->pic = string_replace("min_mm", tmpstr, picmin, 0); 550 free(tmpstr);tmpstr=NULL; 551 } 552 if(n_stunde != NULL) 553 { 554 free(tmpstr);tmpstr=NULL; 555 if(hr > 12) 556 hr = hr - 12; 557 if(hr < 10) 558 tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); 559 else 560 tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); 561 if(min < 15) 562 tmpstr = ostrcat(tmpstr,"00", 0, 0); 563 else if(min < 30) 564 tmpstr = ostrcat(tmpstr,"15", 0, 0); 565 else if(min < 45) 566 tmpstr = ostrcat(tmpstr,"30", 0, 0); 567 else if(min < 59) 568 tmpstr = ostrcat(tmpstr,"45", 0, 0); 569 free(n_stunde->pic); 570 n_stunde->pic = string_replace("hr_hhmm", tmpstr, pichr, 0); 571 free(tmpstr);tmpstr=NULL; 572 } 573 574 518 575 if(drawscreen(LCD_Samsung1, 0, 0) == -2) 519 576 printf("nicht genug Speicher fuer drawscreen\n"); … … 521 578 else if(standby == 2) 522 579 { 523 changetext(akttime_Standby, tmpstr); 580 if(akttime_Standby != NULL) 581 changetext(akttime_Standby, tmpstr); 524 582 drawscreen(LCD_Standby, 0, 0); 525 583 put = 0; … … 605 663 free(recmerk);recmerk=NULL; 606 664 free(startlcd);startlcd=NULL; 665 free(pichr);pichr=NULL; 666 free(picmin);picmin=NULL; 667 free(pichr_standby);pichr=NULL; 668 free(picmin_standby);picmin=NULL; 607 669 addconfig("lcd_samsung_plugin_running", "no"); 608 670 LCD_Samsung1thread = NULL;
Note: See TracChangeset
for help on using the changeset viewer.