summaryrefslogtreecommitdiff
path: root/apps/radio
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-08-16 12:07:46 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-08-16 12:07:46 +0000
commitb5412c9440a1d9f89a837e45cc8c2fd9c7854e33 (patch)
tree43aeb8f2bf31739de4c9f303dad1096ed52dc796 /apps/radio
parent0be2426528d64f72f6cababaf6bbd85a7d1cc866 (diff)
downloadrockbox-b5412c9440a1d9f89a837e45cc8c2fd9c7854e33.tar.gz
rockbox-b5412c9440a1d9f89a837e45cc8c2fd9c7854e33.zip
Fix FS#11469 - make the fms update as it should
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27828 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/radio')
-rw-r--r--apps/radio/radio.c68
-rw-r--r--apps/radio/radio_skin.c2
2 files changed, 34 insertions, 36 deletions
diff --git a/apps/radio/radio.c b/apps/radio/radio.c
index 17f3d89bfc..74bdb4bc75 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -394,7 +394,7 @@ int radio_screen(void)
394 int button; 394 int button;
395 int i; 395 int i;
396 bool stereo = false, last_stereo = false; 396 bool stereo = false, last_stereo = false;
397 bool update_screen = true, restore = true; 397 int update_type = 0;
398 bool screen_freeze = false; 398 bool screen_freeze = false;
399 bool keep_playing = false; 399 bool keep_playing = false;
400 bool talk = false; 400 bool talk = false;
@@ -467,8 +467,11 @@ int radio_screen(void)
467 if (radio_status == FMRADIO_OFF) 467 if (radio_status == FMRADIO_OFF)
468 radio_start(); 468 radio_start();
469#endif 469#endif
470 fms_fix_displays(FMS_ENTER);
471 FOR_NB_SCREENS(i)
472 skin_update(fms_get(i), SKIN_REFRESH_ALL);
470 473
471 if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN))) 474 if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
472 presets_scan(NULL); 475 presets_scan(NULL);
473 476
474 preset_set_current(preset_find(curr_freq)); 477 preset_set_current(preset_find(curr_freq));
@@ -484,7 +487,7 @@ int radio_screen(void)
484 if(search_dir != 0) 487 if(search_dir != 0)
485 { 488 {
486 curr_freq = step_freq(curr_freq, search_dir); 489 curr_freq = step_freq(curr_freq, search_dir);
487 update_screen = true; 490 update_type = SKIN_REFRESH_ALL;
488 491
489 if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq)) 492 if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
490 { 493 {
@@ -496,12 +499,12 @@ int radio_screen(void)
496 trigger_cpu_boost(); 499 trigger_cpu_boost();
497 } 500 }
498 501
499 if (!update_screen) 502 if (!update_type)
500 { 503 {
501 cancel_cpu_boost(); 504 cancel_cpu_boost();
502 } 505 }
503 506
504 button = fms_do_button_loop(update_screen); 507 button = fms_do_button_loop(update_type>0);
505 508
506#ifndef HAVE_NOISY_IDLE_MODE 509#ifndef HAVE_NOISY_IDLE_MODE
507 if (button != ACTION_NONE) 510 if (button != ACTION_NONE)
@@ -530,7 +533,7 @@ int radio_screen(void)
530 } 533 }
531 } 534 }
532 } 535 }
533 update_screen = true; 536 update_type = SKIN_REFRESH_NON_STATIC;
534 break; 537 break;
535 538
536#ifdef FM_RECORD 539#ifdef FM_RECORD
@@ -551,13 +554,13 @@ int radio_screen(void)
551 if(audio_status() == AUDIO_STATUS_RECORD) 554 if(audio_status() == AUDIO_STATUS_RECORD)
552 { 555 {
553 rec_command(RECORDING_CMD_START_NEWFILE); 556 rec_command(RECORDING_CMD_START_NEWFILE);
554 update_screen = true; 557 update_type = SKIN_REFRESH_ALL;
555 } 558 }
556 else 559 else
557 { 560 {
558 have_recorded = true; 561 have_recorded = true;
559 rec_command(RECORDING_CMD_START); 562 rec_command(RECORDING_CMD_START);
560 update_screen = true; 563 update_type = SKIN_REFRESH_ALL;
561 } 564 }
562#endif /* SIMULATOR */ 565#endif /* SIMULATOR */
563 last_seconds = 0; 566 last_seconds = 0;
@@ -586,7 +589,7 @@ int radio_screen(void)
586 case ACTION_STD_NEXT: 589 case ACTION_STD_NEXT:
587 next_station(button == ACTION_STD_PREV ? -1 : 1); 590 next_station(button == ACTION_STD_PREV ? -1 : 1);
588 end_search(); 591 end_search();
589 update_screen = true; 592 update_type = SKIN_REFRESH_ALL;
590 talk = true; 593 talk = true;
591 break; 594 break;
592 595
@@ -599,30 +602,29 @@ int radio_screen(void)
599 { 602 {
600 preset_next(search_dir); 603 preset_next(search_dir);
601 end_search(); 604 end_search();
602 update_screen = true;
603 talk = true; 605 talk = true;
604 } 606 }
605 else if (dir == 0) 607 else if (dir == 0)
606 { 608 {
607 /* Starting auto scan */ 609 /* Starting auto scan */
608 tuner_set(RADIO_MUTE, 1); 610 tuner_set(RADIO_MUTE, 1);
609 update_screen = true;
610 } 611 }
612 update_type = SKIN_REFRESH_ALL;
611 break; 613 break;
612 } 614 }
613 615
614 case ACTION_SETTINGS_INC: 616 case ACTION_SETTINGS_INC:
615 case ACTION_SETTINGS_INCREPEAT: 617 case ACTION_SETTINGS_INCREPEAT:
616 global_settings.volume++; 618 global_settings.volume++;
617 setvol(); 619 setvol();
618 update_screen = true; 620 update_type = SKIN_REFRESH_NON_STATIC;
619 break; 621 break;
620 622
621 case ACTION_SETTINGS_DEC: 623 case ACTION_SETTINGS_DEC:
622 case ACTION_SETTINGS_DECREPEAT: 624 case ACTION_SETTINGS_DECREPEAT:
623 global_settings.volume--; 625 global_settings.volume--;
624 setvol(); 626 setvol();
625 update_screen = true; 627 update_type = SKIN_REFRESH_NON_STATIC;
626 break; 628 break;
627 629
628 case ACTION_FM_PLAY: 630 case ACTION_FM_PLAY:
@@ -631,7 +633,7 @@ int radio_screen(void)
631 else 633 else
632 radio_start(); 634 radio_start();
633 635
634 update_screen = true; 636 update_type = SKIN_REFRESH_NON_STATIC;
635 talk = false; 637 talk = false;
636 talk_shutup(); 638 talk_shutup();
637 break; 639 break;
@@ -640,8 +642,8 @@ int radio_screen(void)
640 fms_fix_displays(FMS_EXIT); 642 fms_fix_displays(FMS_EXIT);
641 radio_menu(); 643 radio_menu();
642 preset_set_current(preset_find(curr_freq)); 644 preset_set_current(preset_find(curr_freq));
643 update_screen = true; 645 fms_fix_displays(FMS_ENTER);
644 restore = true; 646 update_type = SKIN_REFRESH_ALL;
645 break; 647 break;
646 648
647#ifdef FM_PRESET 649#ifdef FM_PRESET
@@ -649,13 +651,13 @@ int radio_screen(void)
649 if(radio_preset_count() < 1) 651 if(radio_preset_count() < 1)
650 { 652 {
651 splash(HZ, ID2P(LANG_FM_NO_PRESETS)); 653 splash(HZ, ID2P(LANG_FM_NO_PRESETS));
652 update_screen = true; 654 update_type = SKIN_REFRESH_ALL;
653 break; 655 break;
654 } 656 }
655 fms_fix_displays(FMS_EXIT); 657 fms_fix_displays(FMS_EXIT);
656 handle_radio_presets(); 658 handle_radio_presets();
657 update_screen = true; 659 fms_fix_displays(FMS_ENTER);
658 restore = true; 660 update_type = SKIN_REFRESH_ALL;
659 break; 661 break;
660#endif /* FM_PRESET */ 662#endif /* FM_PRESET */
661 663
@@ -668,7 +670,7 @@ int radio_screen(void)
668 } 670 }
669 else 671 else
670 { 672 {
671 update_screen = true; 673 update_type = SKIN_REFRESH_ALL;
672 screen_freeze = false; 674 screen_freeze = false;
673 } 675 }
674 break; 676 break;
@@ -697,7 +699,7 @@ int radio_screen(void)
697 } 699 }
698 else 700 else
699 radio_mode = RADIO_SCAN_MODE; 701 radio_mode = RADIO_SCAN_MODE;
700 update_screen = true; 702 update_type = SKIN_REFRESH_ALL;
701 cond_talk_ids_fq(radio_mode ? 703 cond_talk_ids_fq(radio_mode ?
702 LANG_PRESET : LANG_RADIO_SCAN_MODE); 704 LANG_PRESET : LANG_RADIO_SCAN_MODE);
703 talk = true; 705 talk = true;
@@ -708,7 +710,7 @@ int radio_screen(void)
708 case ACTION_FM_NEXT_PRESET: 710 case ACTION_FM_NEXT_PRESET:
709 preset_next(1); 711 preset_next(1);
710 end_search(); 712 end_search();
711 update_screen = true; 713 update_type = SKIN_REFRESH_ALL;
712 talk = true; 714 talk = true;
713 break; 715 break;
714#endif 716#endif
@@ -717,19 +719,19 @@ int radio_screen(void)
717 case ACTION_FM_PREV_PRESET: 719 case ACTION_FM_PREV_PRESET:
718 preset_next(-1); 720 preset_next(-1);
719 end_search(); 721 end_search();
720 update_screen = true; 722 update_type = SKIN_REFRESH_ALL;
721 talk = true; 723 talk = true;
722 break; 724 break;
723#endif 725#endif
724 case ACTION_NONE: 726 case ACTION_NONE:
725 update_screen = true; /* so the fms updates */ 727 update_type = SKIN_REFRESH_NON_STATIC;
726 break; 728 break;
727 729
728 default: 730 default:
729 default_event_handler(button); 731 default_event_handler(button);
730#ifdef HAVE_RDS_CAP 732#ifdef HAVE_RDS_CAP
731 if (tuner_get(RADIO_EVENT)) 733 if (tuner_get(RADIO_EVENT))
732 update_screen = true; 734 update_type = SKIN_REFRESH_ALL;
733#endif 735#endif
734 if (!tuner_get(RADIO_PRESENT)) 736 if (!tuner_get(RADIO_PRESENT))
735 { 737 {
@@ -782,7 +784,7 @@ int radio_screen(void)
782 784
783 if(stereo != last_stereo) 785 if(stereo != last_stereo)
784 { 786 {
785 update_screen = true; 787 update_type = SKIN_REFRESH_ALL;
786 last_stereo = stereo; 788 last_stereo = stereo;
787 } 789 }
788 } 790 }
@@ -790,22 +792,18 @@ int radio_screen(void)
790 792
791#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) 793#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
792 seconds = audio_recorded_time() / HZ; 794 seconds = audio_recorded_time() / HZ;
793 if (update_screen || seconds > last_seconds || restore) 795 if (update_type || seconds > last_seconds)
794 { 796 {
795 last_seconds = seconds; 797 last_seconds = seconds;
796#else 798#else
797 if (update_screen || restore) 799 if (update_type)
798 { 800 {
799#endif 801#endif
800 if (restore)
801 fms_fix_displays(FMS_ENTER);
802 FOR_NB_SCREENS(i) 802 FOR_NB_SCREENS(i)
803 skin_update(fms_get(i), restore ? SKIN_REFRESH_ALL : 803 skin_update(fms_get(i), update_type);
804 SKIN_REFRESH_NON_STATIC);
805 restore = false;
806 } 804 }
807 } 805 }
808 update_screen = false; 806 update_type = 0;
809 807
810 if (global_settings.talk_file && talk 808 if (global_settings.talk_file && talk
811 && radio_status == FMRADIO_PAUSED) 809 && radio_status == FMRADIO_PAUSED)
diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c
index 6bc6c377d4..26e6daccbc 100644
--- a/apps/radio/radio_skin.c
+++ b/apps/radio/radio_skin.c
@@ -114,7 +114,7 @@ void fms_skin_init(void)
114int fms_do_button_loop(bool update_screen) 114int fms_do_button_loop(bool update_screen)
115{ 115{
116 int button = skin_wait_for_action(fms_skin, CONTEXT_FM, 116 int button = skin_wait_for_action(fms_skin, CONTEXT_FM,
117 update_screen ? TIMEOUT_NOBLOCK : HZ); 117 update_screen ? TIMEOUT_NOBLOCK : HZ/5);
118#ifdef HAVE_TOUCHSCREEN 118#ifdef HAVE_TOUCHSCREEN
119 int offset; 119 int offset;
120 if (button == ACTION_TOUCHSCREEN) 120 if (button == ACTION_TOUCHSCREEN)