Changeset 28322 for titan/plugins/lcdsamsung/lcdsamsung.c
- Timestamp:
- 04/02/14 17:50:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/lcdsamsung/lcdsamsung.c
r24709 r28322 466 466 put = 0; 467 467 468 if(status.security == 1) 469 { 470 if(status.standby > 0 && standby == 0) 468 if(status.standby > 0 && standby == 0) 469 { 470 if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) 471 standby = 2; 472 else 471 473 { 472 if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) 473 standby = 2; 474 else 474 tmpstr = createpluginpath("/lcdsamsung/standby.jpg", 0); 475 tmpstr = ostrcat("cp ", tmpstr, 0, 1); 476 tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); 477 system(tmpstr); 478 free(tmpstr); tmpstr=NULL; 479 sleep(3); 480 481 tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0); 482 tmpstr = ostrcat("cp ", tmpstr, 0, 1); 483 tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0); 484 system(tmpstr); 485 sleep(2); 486 system("killall fbread"); 487 standby = 1; 488 } 489 } 490 if(status.standby == 0 && standby > 0) 491 { 492 if(standby == 1) 493 system(startlcd); 494 standby = 0; 495 put = 1; 496 } 497 498 if(weatherthread == NULL && weatherwrite == 0) 499 { 500 if(file_exist("/tmp/lcdweather")) 501 put = 1; 502 } 503 if(ostrcmp(tmpstr, timemerk) != 0) 504 { 505 free(timemerk);timemerk=NULL; 506 timemerk = ostrcat(tmpstr, "", 0, 0); 507 put = 1; 508 } 509 510 if(standby == 0 || standby == 2 ) 511 { 512 if(type == 1 && standby == 0) 513 { 514 if(ostrcmp(tmpstr2, sendermerk) != 0) 475 515 { 476 tmpstr = createpluginpath("/lcdsamsung/standby.jpg", 0);477 tmpstr = ostrcat("cp ", tmpstr, 0, 1);478 tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0);479 system(tmpstr);480 free(tmpstr); tmpstr=NULL;481 sleep(3);482 483 tmpstr = createpluginpath("/lcdsamsung/black.jpg", 0);484 tmpstr = ostrcat("cp ", tmpstr, 0, 1);485 tmpstr = ostrcat(tmpstr, " /tmp/titanlcd.png", 1, 0);486 system(tmpstr);487 sleep(2);488 system("killall fbread");489 standby= 1;516 free(sendermerk);sendermerk=NULL; 517 sendermerk = ostrcat(tmpstr2, "", 0, 0); 518 put = 1; 519 } 520 if(tmpstr3 == NULL && recmerk != NULL) 521 { 522 put = 1; 523 free(recmerk);recmerk=NULL; 524 } 525 else if(tmpstr3 != NULL && recmerk == NULL) 526 { 527 free(recmerk);recmerk=NULL; 528 recmerk = ostrcat(tmpstr3, "", 0, 0); 529 put = 1; 490 530 } 491 531 } 492 if(status.standby == 0 && standby > 0)532 else if(type == 2) 493 533 { 494 if(standby == 1) 495 system(startlcd); 496 standby = 0; 497 put = 1; 498 } 499 500 if(weatherthread == NULL && weatherwrite == 0) 501 { 502 if(file_exist("/tmp/lcdweather")) 503 put = 1; 504 } 505 if(ostrcmp(tmpstr, timemerk) != 0) 534 if(loopcount >= 15) 535 { 536 put = 1; 537 loopcount = 0; 538 } 539 } 540 541 if(put == 1) 506 542 { 507 free(timemerk);timemerk=NULL; 508 timemerk = ostrcat(tmpstr, "", 0, 0); 509 put = 1; 510 } 511 512 if(standby == 0 || standby == 2 ) 513 { 514 if(type == 1 && standby == 0) 543 if(type == 1) 515 544 { 516 if(ostrcmp(tmpstr2, sendermerk) != 0) 545 // Wettervorhersage 546 if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) 517 547 { 518 free(sendermerk);sendermerk=NULL; 519 sendermerk = ostrcat(tmpstr2, "", 0, 0); 520 put = 1; 548 if(weatherwrite == 0) 549 { 550 if(weatherthread == NULL) 551 { 552 if(!file_exist("/tmp/lcdweather")) 553 weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); 554 else 555 { 556 fileline = malloc(256); 557 if(fileline != NULL) 558 { 559 fd = fopen("/tmp/lcdweather", "r"); 560 if(fd != NULL) 561 { 562 if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) 563 { 564 weather_getline(fd, fileline);weather_getline(fd, fileline); 565 changetext(day0_d, fileline); 566 changetext(sday0_d, fileline); 567 weather_getline(fd, fileline);weather_getline(fd, fileline); 568 changetext(day0_t, fileline); 569 changetext(sday0_t, fileline); 570 weather_getline(fd, fileline); 571 weather_getline(fd, fileline); 572 changepic(day0_i, fileline); 573 changepic(sday0_i, fileline); 574 575 weather_getline(fd, fileline); 576 changetext(day1_d, fileline); 577 changetext(sday1_d, fileline); 578 weather_getline(fd, fileline);weather_getline(fd, fileline); 579 changetext(day1_t, fileline); 580 changetext(sday1_t, fileline); 581 weather_getline(fd, fileline); 582 weather_getline(fd, fileline); 583 changepic(day1_i, fileline); 584 changepic(sday1_i, fileline); 585 586 weather_getline(fd, fileline); 587 changetext(day2_d, fileline); 588 changetext(sday2_d, fileline); 589 weather_getline(fd, fileline);weather_getline(fd, fileline); 590 changetext(day2_t, fileline); 591 changetext(sday2_t, fileline); 592 weather_getline(fd, fileline); 593 weather_getline(fd, fileline); 594 changepic(day2_i, fileline); 595 changepic(sday2_i, fileline); 596 597 weather_getline(fd, fileline); 598 changetext(day3_d, fileline); 599 changetext(sday3_d, fileline); 600 weather_getline(fd, fileline);weather_getline(fd, fileline); 601 changetext(day3_t, fileline); 602 changetext(sday3_t, fileline); 603 weather_getline(fd, fileline); 604 weather_getline(fd, fileline); 605 changepic(day3_i, fileline); 606 changepic(sday3_i, fileline); 607 } 608 else 609 { 610 weather_getline(fd, fileline);weather_getline(fd, fileline); 611 changetext(day0_d, fileline); 612 weather_getline(fd, fileline);weather_getline(fd, fileline); 613 changetext(day0_t, fileline); 614 weather_getline(fd, fileline); 615 weather_getline(fd, fileline); 616 changepic(day0_i, fileline); 617 618 weather_getline(fd, fileline); 619 changetext(day1_d, fileline); 620 weather_getline(fd, fileline);weather_getline(fd, fileline); 621 changetext(day1_t, fileline); 622 weather_getline(fd, fileline); 623 weather_getline(fd, fileline); 624 changepic(day1_i, fileline); 625 626 weather_getline(fd, fileline); 627 changetext(day2_d, fileline); 628 weather_getline(fd, fileline);weather_getline(fd, fileline); 629 changetext(day2_t, fileline); 630 weather_getline(fd, fileline); 631 weather_getline(fd, fileline); 632 changepic(day2_i, fileline); 633 634 weather_getline(fd, fileline); 635 changetext(day3_d, fileline); 636 weather_getline(fd, fileline);weather_getline(fd, fileline); 637 changetext(day3_t, fileline); 638 weather_getline(fd, fileline); 639 weather_getline(fd, fileline); 640 changepic(day3_i, fileline); 641 } 642 fclose(fd); 643 } 644 free(fileline); fileline=NULL; 645 } 646 weatherwrite = 1; 647 } 648 } 649 } 650 } 651 if(standby == 0) 652 { 653 if(akttime != NULL) 654 changetext(akttime, tmpstr); 655 if(n_minute != NULL && digitaluhr == 0) 656 { 657 free(tmpstr);tmpstr=NULL; 658 tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); 659 free(n_minute->pic); 660 n_minute->pic = string_replace("min_mm", tmpstr, picmin, 0); 661 free(tmpstr);tmpstr=NULL; 662 } 663 if(n_stunde != NULL && digitaluhr == 0) 664 { 665 free(tmpstr);tmpstr=NULL; 666 if(hr >= 12) 667 hr = hr - 12; 668 if(hr < 10) 669 tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); 670 else 671 tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); 672 if(min < 12) 673 tmpstr = ostrcat(tmpstr,"00", 0, 0); 674 else if(min < 24) 675 tmpstr = ostrcat(tmpstr,"12", 0, 0); 676 else if(min < 36) 677 tmpstr = ostrcat(tmpstr,"24", 0, 0); 678 else if(min < 48) 679 tmpstr = ostrcat(tmpstr,"36", 0, 0); 680 else if(min < 60) 681 tmpstr = ostrcat(tmpstr,"48", 0, 0); 682 free(n_stunde->pic); 683 n_stunde->pic = string_replace("hr_hhmm", tmpstr, pichr, 0); 684 free(tmpstr);tmpstr=NULL; 685 } 686 if(digitaluhr == 1) 687 { 688 free(tmpstr);tmpstr=NULL; 689 tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); 690 n_stunde->pic = string_replace("wert_w", tmpstr, pichr, 0); 691 free(tmpstr);tmpstr=NULL; 692 tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); 693 n_stunde2->pic = string_replace("wert_w", tmpstr, pichr2, 0); 694 free(tmpstr);tmpstr=NULL; 695 tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); 696 n_minute->pic = string_replace("wert_w", tmpstr, picmin, 0); 697 free(tmpstr);tmpstr=NULL; 698 tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); 699 n_minute2->pic = string_replace("wert_w", tmpstr, picmin2, 0); 700 free(tmpstr);tmpstr=NULL; 701 } 702 703 704 if(drawscreen(LCD_Samsung1, 0, 0) == -2) 705 printf("nicht genug Speicher fuer drawscreen\n"); 706 } 707 else if(standby == 2) 708 { 709 if(akttime_Standby != NULL) 710 changetext(akttime_Standby, tmpstr); 711 if(n_minute_standby != NULL && digitaluhr_standby == 0) 712 { 713 free(tmpstr);tmpstr=NULL; 714 tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); 715 free(n_minute_standby->pic); 716 n_minute_standby->pic = string_replace("min_mm", tmpstr, picmin_standby, 0); 717 free(tmpstr);tmpstr=NULL; 718 } 719 if(n_stunde_standby != NULL && digitaluhr_standby == 0) 720 { 721 free(tmpstr);tmpstr=NULL; 722 if(hr >= 12) 723 hr = hr - 12; 724 if(hr < 10) 725 tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); 726 else 727 tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); 728 if(min < 12) 729 tmpstr = ostrcat(tmpstr,"00", 0, 0); 730 else if(min < 24) 731 tmpstr = ostrcat(tmpstr,"12", 0, 0); 732 else if(min < 36) 733 tmpstr = ostrcat(tmpstr,"24", 0, 0); 734 else if(min < 48) 735 tmpstr = ostrcat(tmpstr,"36", 0, 0); 736 else if(min < 60) 737 tmpstr = ostrcat(tmpstr,"48", 0, 0); 738 free(n_stunde_standby->pic); 739 n_stunde_standby->pic = string_replace("hr_hhmm", tmpstr, pichr_standby, 0); 740 free(tmpstr);tmpstr=NULL; 741 } 742 if(digitaluhr_standby == 1) 743 { 744 free(tmpstr);tmpstr=NULL; 745 tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); 746 n_stunde_standby->pic = string_replace("wert_w", tmpstr, pichr_standby, 0); 747 free(tmpstr);tmpstr=NULL; 748 tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); 749 n_stunde2_standby->pic = string_replace("wert_w", tmpstr, pichr2_standby, 0); 750 free(tmpstr);tmpstr=NULL; 751 tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); 752 n_minute_standby->pic = string_replace("wert_w", tmpstr, picmin_standby, 0); 753 free(tmpstr);tmpstr=NULL; 754 tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); 755 n_minute2_standby->pic = string_replace("wert_w", tmpstr, picmin2_standby, 0); 756 free(tmpstr);tmpstr=NULL; 757 } 758 759 drawscreen(LCD_Standby, 0, 0); 760 put = 0; 521 761 } 522 if(tmpstr3 == NULL && recmerk != NULL)523 {524 put = 1;525 free(recmerk);recmerk=NULL;526 }527 else if(tmpstr3 != NULL && recmerk == NULL)528 {529 free(recmerk);recmerk=NULL;530 recmerk = ostrcat(tmpstr3, "", 0, 0);531 put = 1;532 }533 762 } 534 763 else if(type == 2) 535 764 { 536 if(loopcount >= 15) 765 if(status.mcaktiv == 1) 766 playertype = 0; 767 else 768 playertype = getconfigint("playertype", NULL); 769 770 if(playertype == 1) 537 771 { 538 put = 1; 539 loopcount = 0; 772 unsigned long long int startpos = 0; 773 playergetinfots(&len, &startpos, NULL, &pos, NULL, 0); 774 len = len / 90000; 775 pos = (pos - startpos) / 90000; 540 776 } 541 } 542 543 if(put == 1) 544 { 545 if(type == 1) 777 else 546 778 { 547 // Wettervorhersage 548 if(ostrcmp(getconfig("lcd_samsung_plugin_wetter", NULL), "yes") == 0) 549 { 550 if(weatherwrite == 0) 551 { 552 if(weatherthread == NULL) 553 { 554 if(!file_exist("/tmp/lcdweather")) 555 weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); 556 else 557 { 558 fileline = malloc(256); 559 if(fileline != NULL) 560 { 561 fd = fopen("/tmp/lcdweather", "r"); 562 if(fd != NULL) 563 { 564 if(ostrcmp(getconfig("lcd_samsung_plugin_standby", NULL), "yes") == 0) 565 { 566 weather_getline(fd, fileline);weather_getline(fd, fileline); 567 changetext(day0_d, fileline); 568 changetext(sday0_d, fileline); 569 weather_getline(fd, fileline);weather_getline(fd, fileline); 570 changetext(day0_t, fileline); 571 changetext(sday0_t, fileline); 572 weather_getline(fd, fileline); 573 weather_getline(fd, fileline); 574 changepic(day0_i, fileline); 575 changepic(sday0_i, fileline); 576 577 weather_getline(fd, fileline); 578 changetext(day1_d, fileline); 579 changetext(sday1_d, fileline); 580 weather_getline(fd, fileline);weather_getline(fd, fileline); 581 changetext(day1_t, fileline); 582 changetext(sday1_t, fileline); 583 weather_getline(fd, fileline); 584 weather_getline(fd, fileline); 585 changepic(day1_i, fileline); 586 changepic(sday1_i, fileline); 587 588 weather_getline(fd, fileline); 589 changetext(day2_d, fileline); 590 changetext(sday2_d, fileline); 591 weather_getline(fd, fileline);weather_getline(fd, fileline); 592 changetext(day2_t, fileline); 593 changetext(sday2_t, fileline); 594 weather_getline(fd, fileline); 595 weather_getline(fd, fileline); 596 changepic(day2_i, fileline); 597 changepic(sday2_i, fileline); 598 599 weather_getline(fd, fileline); 600 changetext(day3_d, fileline); 601 changetext(sday3_d, fileline); 602 weather_getline(fd, fileline);weather_getline(fd, fileline); 603 changetext(day3_t, fileline); 604 changetext(sday3_t, fileline); 605 weather_getline(fd, fileline); 606 weather_getline(fd, fileline); 607 changepic(day3_i, fileline); 608 changepic(sday3_i, fileline); 609 } 610 else 611 { 612 weather_getline(fd, fileline);weather_getline(fd, fileline); 613 changetext(day0_d, fileline); 614 weather_getline(fd, fileline);weather_getline(fd, fileline); 615 changetext(day0_t, fileline); 616 weather_getline(fd, fileline); 617 weather_getline(fd, fileline); 618 changepic(day0_i, fileline); 619 620 weather_getline(fd, fileline); 621 changetext(day1_d, fileline); 622 weather_getline(fd, fileline);weather_getline(fd, fileline); 623 changetext(day1_t, fileline); 624 weather_getline(fd, fileline); 625 weather_getline(fd, fileline); 626 changepic(day1_i, fileline); 627 628 weather_getline(fd, fileline); 629 changetext(day2_d, fileline); 630 weather_getline(fd, fileline);weather_getline(fd, fileline); 631 changetext(day2_t, fileline); 632 weather_getline(fd, fileline); 633 weather_getline(fd, fileline); 634 changepic(day2_i, fileline); 635 636 weather_getline(fd, fileline); 637 changetext(day3_d, fileline); 638 weather_getline(fd, fileline);weather_getline(fd, fileline); 639 changetext(day3_t, fileline); 640 weather_getline(fd, fileline); 641 weather_getline(fd, fileline); 642 changepic(day3_i, fileline); 643 } 644 fclose(fd); 645 } 646 free(fileline); fileline=NULL; 647 } 648 weatherwrite = 1; 649 } 650 } 651 } 652 } 653 if(standby == 0) 654 { 655 if(akttime != NULL) 656 changetext(akttime, tmpstr); 657 if(n_minute != NULL && digitaluhr == 0) 658 { 659 free(tmpstr);tmpstr=NULL; 660 tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); 661 free(n_minute->pic); 662 n_minute->pic = string_replace("min_mm", tmpstr, picmin, 0); 663 free(tmpstr);tmpstr=NULL; 664 } 665 if(n_stunde != NULL && digitaluhr == 0) 666 { 667 free(tmpstr);tmpstr=NULL; 668 if(hr >= 12) 669 hr = hr - 12; 670 if(hr < 10) 671 tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); 672 else 673 tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); 674 if(min < 12) 675 tmpstr = ostrcat(tmpstr,"00", 0, 0); 676 else if(min < 24) 677 tmpstr = ostrcat(tmpstr,"12", 0, 0); 678 else if(min < 36) 679 tmpstr = ostrcat(tmpstr,"24", 0, 0); 680 else if(min < 48) 681 tmpstr = ostrcat(tmpstr,"36", 0, 0); 682 else if(min < 60) 683 tmpstr = ostrcat(tmpstr,"48", 0, 0); 684 free(n_stunde->pic); 685 n_stunde->pic = string_replace("hr_hhmm", tmpstr, pichr, 0); 686 free(tmpstr);tmpstr=NULL; 687 } 688 if(digitaluhr == 1) 689 { 690 free(tmpstr);tmpstr=NULL; 691 tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); 692 n_stunde->pic = string_replace("wert_w", tmpstr, pichr, 0); 693 free(tmpstr);tmpstr=NULL; 694 tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); 695 n_stunde2->pic = string_replace("wert_w", tmpstr, pichr2, 0); 696 free(tmpstr);tmpstr=NULL; 697 tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); 698 n_minute->pic = string_replace("wert_w", tmpstr, picmin, 0); 699 free(tmpstr);tmpstr=NULL; 700 tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); 701 n_minute2->pic = string_replace("wert_w", tmpstr, picmin2, 0); 702 free(tmpstr);tmpstr=NULL; 703 } 704 705 706 if(drawscreen(LCD_Samsung1, 0, 0) == -2) 707 printf("nicht genug Speicher fuer drawscreen\n"); 708 } 709 else if(standby == 2) 710 { 711 if(akttime_Standby != NULL) 712 changetext(akttime_Standby, tmpstr); 713 if(n_minute_standby != NULL && digitaluhr_standby == 0) 714 { 715 free(tmpstr);tmpstr=NULL; 716 tmpstr = ostrcat("min_",gettime(NULL, "%M"), 0, 0); 717 free(n_minute_standby->pic); 718 n_minute_standby->pic = string_replace("min_mm", tmpstr, picmin_standby, 0); 719 free(tmpstr);tmpstr=NULL; 720 } 721 if(n_stunde_standby != NULL && digitaluhr_standby == 0) 722 { 723 free(tmpstr);tmpstr=NULL; 724 if(hr >= 12) 725 hr = hr - 12; 726 if(hr < 10) 727 tmpstr = ostrcat("hr_0",oitoa(hr), 0, 1); 728 else 729 tmpstr = ostrcat("hr_",oitoa(hr), 0, 1); 730 if(min < 12) 731 tmpstr = ostrcat(tmpstr,"00", 0, 0); 732 else if(min < 24) 733 tmpstr = ostrcat(tmpstr,"12", 0, 0); 734 else if(min < 36) 735 tmpstr = ostrcat(tmpstr,"24", 0, 0); 736 else if(min < 48) 737 tmpstr = ostrcat(tmpstr,"36", 0, 0); 738 else if(min < 60) 739 tmpstr = ostrcat(tmpstr,"48", 0, 0); 740 free(n_stunde_standby->pic); 741 n_stunde_standby->pic = string_replace("hr_hhmm", tmpstr, pichr_standby, 0); 742 free(tmpstr);tmpstr=NULL; 743 } 744 if(digitaluhr_standby == 1) 745 { 746 free(tmpstr);tmpstr=NULL; 747 tmpstr = ostrcat("wert_",oitoa(hr/10), 0, 1); 748 n_stunde_standby->pic = string_replace("wert_w", tmpstr, pichr_standby, 0); 749 free(tmpstr);tmpstr=NULL; 750 tmpstr = ostrcat("wert_",oitoa(hr%10), 0, 1); 751 n_stunde2_standby->pic = string_replace("wert_w", tmpstr, pichr2_standby, 0); 752 free(tmpstr);tmpstr=NULL; 753 tmpstr = ostrcat("wert_",oitoa(min/10), 0, 1); 754 n_minute_standby->pic = string_replace("wert_w", tmpstr, picmin_standby, 0); 755 free(tmpstr);tmpstr=NULL; 756 tmpstr = ostrcat("wert_",oitoa(min%10), 0, 1); 757 n_minute2_standby->pic = string_replace("wert_w", tmpstr, picmin2_standby, 0); 758 free(tmpstr);tmpstr=NULL; 759 } 760 761 drawscreen(LCD_Standby, 0, 0); 762 put = 0; 763 } 779 pos = playergetpts() / 90000; 780 len = playergetlength(); 764 781 } 765 else if(type == 2) 766 { 767 if(status.mcaktiv == 1) 768 playertype = 0; 769 else 770 playertype = getconfigint("playertype", NULL); 771 772 if(playertype == 1) 773 { 774 unsigned long long int startpos = 0; 775 playergetinfots(&len, &startpos, NULL, &pos, NULL, 0); 776 len = len / 90000; 777 pos = (pos - startpos) / 90000; 778 } 779 else 780 { 781 pos = playergetpts() / 90000; 782 len = playergetlength(); 783 } 784 if(pos < 0) pos = 0; 785 reverse = len - pos; 786 if(len == 0) 787 sprogress->progresssize = 0; 788 else 789 sprogress->progresssize = pos * 100 / len; 790 791 tmpstr2 = convert_timesec(pos); 792 changetext(spos, tmpstr2); 793 free(tmpstr2); tmpstr2 = NULL; 794 795 tmpstr2 = convert_timesec(len); 796 changetext(slen, tmpstr2); 797 free(tmpstr2); tmpstr2 = NULL; 798 799 tmpstr2 = convert_timesec(reverse); 800 changetext(sreverse, tmpstr2); 801 free(tmpstr2); tmpstr2 = NULL; 802 803 changetext(akttimeplay, tmpstr); 804 changetext(stitle, basename(status.playfile)); 805 if(drawscreen(LCD_Play, 0, 0) == -2) 806 printf("nicht genug Speicher fuer drawscreen\n"); 807 } 782 if(pos < 0) pos = 0; 783 reverse = len - pos; 784 if(len == 0) 785 sprogress->progresssize = 0; 786 else 787 sprogress->progresssize = pos * 100 / len; 788 789 tmpstr2 = convert_timesec(pos); 790 changetext(spos, tmpstr2); 791 free(tmpstr2); tmpstr2 = NULL; 792 793 tmpstr2 = convert_timesec(len); 794 changetext(slen, tmpstr2); 795 free(tmpstr2); tmpstr2 = NULL; 796 797 tmpstr2 = convert_timesec(reverse); 798 changetext(sreverse, tmpstr2); 799 free(tmpstr2); tmpstr2 = NULL; 800 801 changetext(akttimeplay, tmpstr); 802 changetext(stitle, basename(status.playfile)); 803 if(drawscreen(LCD_Play, 0, 0) == -2) 804 printf("nicht genug Speicher fuer drawscreen\n"); 808 805 } 809 806 } 810 else 811 { 812 if(standby == 2) 807 } 808 else 809 { 810 if(standby == 2) 811 { 812 if(put == 1) 813 813 { 814 if(put == 1) 815 { 816 changetext(akttime_Standby, tmpstr); 817 drawscreen(LCD_Standby, 0, 0); 818 put = 0; 819 } 814 changetext(akttime_Standby, tmpstr); 815 drawscreen(LCD_Standby, 0, 0); 816 put = 0; 820 817 } 821 } 822 } 818 } 819 } 820 823 821 free(tmpstr); tmpstr = NULL; 824 822 free(tmpstr2); tmpstr2 = NULL;
Note: See TracChangeset
for help on using the changeset viewer.