diff options
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/radio.c | 294 |
1 files changed, 60 insertions, 234 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index caaba67404..6410bdbc10 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -59,86 +59,25 @@ | |||
59 | #include "power.h" | 59 | #include "power.h" |
60 | #include "tree.h" | 60 | #include "tree.h" |
61 | #include "dir.h" | 61 | #include "dir.h" |
62 | #include "action.h" | ||
62 | 63 | ||
63 | #ifdef CONFIG_TUNER | 64 | #ifdef CONFIG_TUNER |
64 | 65 | ||
65 | #if CONFIG_KEYPAD == RECORDER_PAD | 66 | #if CONFIG_KEYPAD == RECORDER_PAD |
66 | #define FM_MENU BUTTON_F1 | 67 | #define FM_RECORD |
67 | #define FM_PRESET BUTTON_F2 | 68 | #define FM_PRESET_ADD |
68 | #define FM_RECORD BUTTON_F3 | 69 | #define FM_PRESET_ACTION |
69 | #define FM_FREEZE BUTTON_PLAY | 70 | #define FM_PRESET |
70 | #define FM_STOP BUTTON_OFF | ||
71 | #define FM_MODE (BUTTON_ON | BUTTON_REPEAT) | ||
72 | #define FM_EXIT_PRE BUTTON_ON | ||
73 | #define FM_EXIT (BUTTON_ON | BUTTON_REL) | ||
74 | #define FM_PRESET_ADD BUTTON_F1 | ||
75 | #define FM_PRESET_ACTION BUTTON_F3 | ||
76 | 71 | ||
77 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | 72 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) |
78 | /* pause/play - short PLAY */ | 73 | #define FM_PRESET |
79 | #define FM_PLAY_PRE BUTTON_ON | ||
80 | #define FM_RC_PLAY_PRE BUTTON_RC_ON | ||
81 | #define FM_PLAY (BUTTON_ON | BUTTON_REL) | ||
82 | #define FM_RC_PLAY (BUTTON_RC_ON | BUTTON_REL) | ||
83 | /* preset/scan mode - long PLAY */ | ||
84 | #define FM_MODE (BUTTON_ON | BUTTON_REPEAT) | ||
85 | #define FM_RC_MODE (BUTTON_RC_ON | BUTTON_REPEAT) | ||
86 | /* preset menu - short SELECT */ | ||
87 | #define FM_PRESET_PRE BUTTON_SELECT | ||
88 | #define FM_RC_PRESET_PRE BUTTON_RC_MENU | ||
89 | #define FM_PRESET (BUTTON_SELECT | BUTTON_REL) | ||
90 | #define FM_RC_PRESET (BUTTON_RC_MENU | BUTTON_REL) | ||
91 | /* fm menu - long SELECT */ | ||
92 | #define FM_MENU (BUTTON_SELECT | BUTTON_REPEAT) | ||
93 | #define FM_RC_MENU (BUTTON_RC_MENU | BUTTON_REPEAT) | ||
94 | /* main menu(exit radio while playing) - A-B */ | ||
95 | #define FM_EXIT_PRE BUTTON_MODE | ||
96 | #define FM_EXIT (BUTTON_MODE | BUTTON_REL) | ||
97 | #define FM_RC_EXIT_PRE BUTTON_RC_MODE | ||
98 | #define FM_RC_EXIT (BUTTON_RC_MODE | BUTTON_REL) | ||
99 | /* prev/next preset on the remote - BITRATE/SOURCE */ | ||
100 | #define FM_NEXT_PRESET (BUTTON_RC_BITRATE | BUTTON_REL) | ||
101 | #define FM_PREV_PRESET (BUTTON_RC_SOURCE | BUTTON_REL) | ||
102 | /* stop and exit radio - STOP */ | ||
103 | #define FM_STOP BUTTON_OFF | ||
104 | #define FM_RC_STOP BUTTON_RC_STOP | ||
105 | 74 | ||
106 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) | 75 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) |
107 | /* pause/play - short PLAY */ | 76 | #define FM_PRESET |
108 | #define FM_PLAY_PRE BUTTON_PLAY | 77 | |
109 | #define FM_RC_PLAY_PRE BUTTON_RC_PLAY | 78 | #elif CONFIG_KEYPAD == ONDIO_PAD |
110 | #define FM_PLAY (BUTTON_PLAY | BUTTON_REL) | 79 | #define FM_RECORD_DBLPRE |
111 | #define FM_RC_PLAY (BUTTON_RC_PLAY | BUTTON_REL) | 80 | #define FM_RECORD |
112 | /* preset/scan mode - long PLAY */ | ||
113 | #define FM_MODE (BUTTON_PLAY | BUTTON_REPEAT) | ||
114 | #define FM_RC_MODE (BUTTON_RC_PLAY | BUTTON_REPEAT) | ||
115 | /* preset menu - short SELECT */ | ||
116 | #define FM_PRESET_PRE BUTTON_SELECT | ||
117 | #define FM_RC_PRESET_PRE BUTTON_RC_MENU | ||
118 | #define FM_PRESET (BUTTON_SELECT | BUTTON_REL) | ||
119 | #define FM_RC_PRESET (BUTTON_RC_MENU | BUTTON_REL) | ||
120 | /* fm menu - long SELECT */ | ||
121 | #define FM_MENU (BUTTON_SELECT | BUTTON_REPEAT) | ||
122 | #define FM_RC_MENU (BUTTON_RC_MENU | BUTTON_REPEAT) | ||
123 | /* main menu(exit radio while playing) - REC */ | ||
124 | #define FM_EXIT_PRE BUTTON_REC | ||
125 | #define FM_EXIT (BUTTON_REC | BUTTON_REL) | ||
126 | #define FM_RC_EXIT_PRE BUTTON_RC_MODE | ||
127 | #define FM_RC_EXIT (BUTTON_RC_MODE | BUTTON_REL) | ||
128 | /* prev/next preset on the remote - REW/FF */ | ||
129 | #define FM_NEXT_PRESET (BUTTON_RC_FF | BUTTON_REL) | ||
130 | #define FM_PREV_PRESET (BUTTON_RC_REW | BUTTON_REL) | ||
131 | /* stop and exit radio - ON */ | ||
132 | #define FM_STOP BUTTON_POWER | ||
133 | #define FM_RC_STOP (BUTTON_RC_MODE | BUTTON_REPEAT) | ||
134 | |||
135 | #elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */ | ||
136 | #define FM_MENU (BUTTON_MENU | BUTTON_REPEAT) | ||
137 | #define FM_RECORD_DBLPRE BUTTON_MENU | ||
138 | #define FM_RECORD (BUTTON_MENU | BUTTON_REL) | ||
139 | #define FM_STOP_PRE BUTTON_OFF | ||
140 | #define FM_STOP (BUTTON_OFF | BUTTON_REL) | ||
141 | #define FM_EXIT (BUTTON_OFF | BUTTON_REPEAT) | ||
142 | #endif | 81 | #endif |
143 | 82 | ||
144 | #define MAX_FREQ (108000000) | 83 | #define MAX_FREQ (108000000) |
@@ -537,22 +476,15 @@ bool radio_screen(void) | |||
537 | if(search_dir) | 476 | if(search_dir) |
538 | button = button_get(false); | 477 | button = button_get(false); |
539 | else | 478 | else |
540 | button = button_get_w_tmo(HZ / PEAK_METER_FPS); | 479 | button = get_action(CONTEXT_FM, HZ / PEAK_METER_FPS); |
541 | if (button != BUTTON_NONE) | 480 | if (button != ACTION_NONE) |
542 | { | 481 | { |
543 | cpu_idle_mode(false); | 482 | cpu_idle_mode(false); |
544 | button_timeout = current_tick + (2*HZ); | 483 | button_timeout = current_tick + (2*HZ); |
545 | } | 484 | } |
546 | switch(button) | 485 | switch(button) |
547 | { | 486 | { |
548 | #ifdef FM_RC_STOP | 487 | case ACTION_FM_STOP: |
549 | case FM_RC_STOP: | ||
550 | #endif | ||
551 | case FM_STOP: | ||
552 | #ifdef FM_STOP_PRE | ||
553 | if (lastbutton != FM_STOP_PRE) | ||
554 | break; | ||
555 | #endif | ||
556 | #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) | 488 | #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) |
557 | if(audio_status() == AUDIO_STATUS_RECORD) | 489 | if(audio_status() == AUDIO_STATUS_RECORD) |
558 | { | 490 | { |
@@ -579,9 +511,9 @@ bool radio_screen(void) | |||
579 | break; | 511 | break; |
580 | 512 | ||
581 | #ifdef FM_RECORD | 513 | #ifdef FM_RECORD |
582 | case FM_RECORD: | 514 | case ACTION_FM_RECORD: |
583 | #ifdef FM_RECORD_DBLPRE | 515 | #ifdef FM_RECORD_DBLPRE |
584 | if (lastbutton != FM_RECORD_DBLPRE) | 516 | if (lastbutton != ACTION_FM_RECORD_DBLPRE) |
585 | { | 517 | { |
586 | rec_lastclick = 0; | 518 | rec_lastclick = 0; |
587 | break; | 519 | break; |
@@ -609,18 +541,7 @@ bool radio_screen(void) | |||
609 | break; | 541 | break; |
610 | #endif /* #ifdef FM_RECORD */ | 542 | #endif /* #ifdef FM_RECORD */ |
611 | 543 | ||
612 | #ifdef FM_RC_EXIT | 544 | case ACTION_FM_EXIT: |
613 | case FM_RC_EXIT: | ||
614 | #endif | ||
615 | case FM_EXIT: | ||
616 | #ifdef FM_EXIT_PRE | ||
617 | if(lastbutton != FM_EXIT_PRE | ||
618 | #ifdef FM_RC_EXIT_PRE | ||
619 | && lastbutton != FM_RC_EXIT_PRE | ||
620 | #endif | ||
621 | ) | ||
622 | break; | ||
623 | #endif | ||
624 | #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) | 545 | #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) |
625 | if(audio_status() == AUDIO_STATUS_RECORD) | 546 | if(audio_status() == AUDIO_STATUS_RECORD) |
626 | audio_stop(); | 547 | audio_stop(); |
@@ -643,11 +564,8 @@ bool radio_screen(void) | |||
643 | clear_preset_list(); | 564 | clear_preset_list(); |
644 | 565 | ||
645 | break; | 566 | break; |
646 | 567 | ||
647 | #ifdef BUTTON_RC_REW | 568 | case ACTION_STD_PREV: |
648 | case BUTTON_RC_REW: | ||
649 | #endif | ||
650 | case BUTTON_LEFT: | ||
651 | if(radio_mode == RADIO_SCAN_MODE) | 569 | if(radio_mode == RADIO_SCAN_MODE) |
652 | { | 570 | { |
653 | curr_freq -= FREQ_STEP; | 571 | curr_freq -= FREQ_STEP; |
@@ -663,10 +581,7 @@ bool radio_screen(void) | |||
663 | update_screen = true; | 581 | update_screen = true; |
664 | break; | 582 | break; |
665 | 583 | ||
666 | #ifdef BUTTON_RC_FF | 584 | case ACTION_STD_NEXT: |
667 | case BUTTON_RC_FF: | ||
668 | #endif | ||
669 | case BUTTON_RIGHT: | ||
670 | if(radio_mode == RADIO_SCAN_MODE) | 585 | if(radio_mode == RADIO_SCAN_MODE) |
671 | { | 586 | { |
672 | curr_freq += FREQ_STEP; | 587 | curr_freq += FREQ_STEP; |
@@ -682,10 +597,7 @@ bool radio_screen(void) | |||
682 | update_screen = true; | 597 | update_screen = true; |
683 | break; | 598 | break; |
684 | 599 | ||
685 | #ifdef BUTTON_RC_REW | 600 | case ACTION_STD_PREVREPEAT: |
686 | case BUTTON_RC_REW | BUTTON_REPEAT: | ||
687 | #endif | ||
688 | case BUTTON_LEFT | BUTTON_REPEAT: | ||
689 | if(radio_mode == RADIO_SCAN_MODE) | 601 | if(radio_mode == RADIO_SCAN_MODE) |
690 | search_dir = -1; | 602 | search_dir = -1; |
691 | else | 603 | else |
@@ -695,11 +607,8 @@ bool radio_screen(void) | |||
695 | } | 607 | } |
696 | 608 | ||
697 | break; | 609 | break; |
698 | 610 | ||
699 | #ifdef BUTTON_RC_FF | 611 | case ACTION_STD_NEXTREPEAT: |
700 | case BUTTON_RC_FF | BUTTON_REPEAT: | ||
701 | #endif | ||
702 | case BUTTON_RIGHT | BUTTON_REPEAT: | ||
703 | if(radio_mode == RADIO_SCAN_MODE) | 612 | if(radio_mode == RADIO_SCAN_MODE) |
704 | search_dir = 1; | 613 | search_dir = 1; |
705 | else | 614 | else |
@@ -710,12 +619,9 @@ bool radio_screen(void) | |||
710 | 619 | ||
711 | break; | 620 | break; |
712 | 621 | ||
713 | #ifdef BUTTON_RC_VOL_UP | 622 | |
714 | case BUTTON_RC_VOL_UP: | 623 | case ACTION_SETTINGS_INC: |
715 | case BUTTON_RC_VOL_UP | BUTTON_REPEAT: | 624 | case ACTION_SETTINGS_INCREPEAT: |
716 | #endif | ||
717 | case BUTTON_UP: | ||
718 | case BUTTON_UP | BUTTON_REPEAT: | ||
719 | global_settings.volume++; | 625 | global_settings.volume++; |
720 | if(global_settings.volume > sound_max(SOUND_VOLUME)) | 626 | if(global_settings.volume > sound_max(SOUND_VOLUME)) |
721 | global_settings.volume = sound_max(SOUND_VOLUME); | 627 | global_settings.volume = sound_max(SOUND_VOLUME); |
@@ -724,12 +630,8 @@ bool radio_screen(void) | |||
724 | settings_save(); | 630 | settings_save(); |
725 | break; | 631 | break; |
726 | 632 | ||
727 | #ifdef BUTTON_RC_VOL_DOWN | 633 | case ACTION_SETTINGS_DEC: |
728 | case BUTTON_RC_VOL_DOWN: | 634 | case ACTION_SETTINGS_DECREPEAT: |
729 | case BUTTON_RC_VOL_DOWN | BUTTON_REPEAT: | ||
730 | #endif | ||
731 | case BUTTON_DOWN: | ||
732 | case BUTTON_DOWN | BUTTON_REPEAT: | ||
733 | global_settings.volume--; | 635 | global_settings.volume--; |
734 | if(global_settings.volume < sound_min(SOUND_VOLUME)) | 636 | if(global_settings.volume < sound_min(SOUND_VOLUME)) |
735 | global_settings.volume = sound_min(SOUND_VOLUME); | 637 | global_settings.volume = sound_min(SOUND_VOLUME); |
@@ -738,19 +640,7 @@ bool radio_screen(void) | |||
738 | settings_save(); | 640 | settings_save(); |
739 | break; | 641 | break; |
740 | 642 | ||
741 | #ifdef FM_PLAY | 643 | case ACTION_FM_PLAY: |
742 | #ifdef FM_RC_PLAY | ||
743 | case FM_RC_PLAY: | ||
744 | #endif | ||
745 | case FM_PLAY: | ||
746 | #ifdef FM_PLAY_PRE | ||
747 | if(lastbutton != FM_PLAY_PRE | ||
748 | #ifdef FM_RC_PLAY_PRE | ||
749 | && lastbutton != FM_RC_PLAY_PRE | ||
750 | #endif | ||
751 | ) | ||
752 | break; | ||
753 | #endif | ||
754 | if (radio_status == FMRADIO_PLAYING) | 644 | if (radio_status == FMRADIO_PLAYING) |
755 | radio_pause(); | 645 | radio_pause(); |
756 | else | 646 | else |
@@ -758,12 +648,8 @@ bool radio_screen(void) | |||
758 | 648 | ||
759 | update_screen = true; | 649 | update_screen = true; |
760 | break; | 650 | break; |
761 | #endif | 651 | |
762 | #ifdef FM_MENU | 652 | case ACTION_FM_MENU: |
763 | #ifdef FM_RC_MENU | ||
764 | case FM_RC_MENU: | ||
765 | #endif | ||
766 | case FM_MENU: | ||
767 | radio_menu(); | 653 | radio_menu(); |
768 | curr_preset = find_preset(curr_freq); | 654 | curr_preset = find_preset(curr_freq); |
769 | FOR_NB_SCREENS(i){ | 655 | FOR_NB_SCREENS(i){ |
@@ -777,21 +663,9 @@ bool radio_screen(void) | |||
777 | #endif | 663 | #endif |
778 | update_screen = true; | 664 | update_screen = true; |
779 | break; | 665 | break; |
780 | #endif | 666 | |
781 | |||
782 | #ifdef FM_RC_PRESET | ||
783 | case FM_RC_PRESET: | ||
784 | #endif | ||
785 | #ifdef FM_PRESET | 667 | #ifdef FM_PRESET |
786 | case FM_PRESET: | 668 | case ACTION_FM_PRESET: |
787 | #ifdef FM_PRESET_PRE | ||
788 | if(lastbutton != FM_PRESET_PRE | ||
789 | #ifdef FM_RC_PRESET_PRE | ||
790 | && lastbutton != FM_RC_PRESET_PRE | ||
791 | #endif | ||
792 | ) | ||
793 | break; | ||
794 | #endif | ||
795 | if(num_presets < 1) | 669 | if(num_presets < 1) |
796 | { | 670 | { |
797 | gui_syncsplash(HZ, true, str(LANG_FM_NO_PRESETS)); | 671 | gui_syncsplash(HZ, true, str(LANG_FM_NO_PRESETS)); |
@@ -823,7 +697,7 @@ bool radio_screen(void) | |||
823 | #endif | 697 | #endif |
824 | 698 | ||
825 | #ifdef FM_FREEZE | 699 | #ifdef FM_FREEZE |
826 | case FM_FREEZE: | 700 | case ACTION_FM_FREEZE: |
827 | if(!screen_freeze) | 701 | if(!screen_freeze) |
828 | { | 702 | { |
829 | gui_syncsplash(HZ, true, str(LANG_FM_FREEZE)); | 703 | gui_syncsplash(HZ, true, str(LANG_FM_FREEZE)); |
@@ -847,38 +721,28 @@ bool radio_screen(void) | |||
847 | } | 721 | } |
848 | break; | 722 | break; |
849 | 723 | ||
850 | #ifdef FM_RC_MODE | ||
851 | case FM_RC_MODE: | ||
852 | #endif | ||
853 | #ifdef FM_MODE | 724 | #ifdef FM_MODE |
854 | case FM_MODE: | 725 | case ACTION_FM_MODE: |
855 | if(lastbutton != FM_MODE | 726 | if(radio_mode == RADIO_SCAN_MODE) |
856 | #ifdef FM_RC_MODE | ||
857 | && lastbutton != FM_RC_MODE | ||
858 | #endif | ||
859 | ) | ||
860 | { | 727 | { |
861 | if(radio_mode == RADIO_SCAN_MODE) | 728 | /* Force scan mode if there are no presets. */ |
862 | { | 729 | if(num_presets > 0) |
863 | /* Force scan mode if there are no presets. */ | 730 | radio_mode = RADIO_PRESET_MODE; |
864 | if(num_presets > 0) | ||
865 | radio_mode = RADIO_PRESET_MODE; | ||
866 | } | ||
867 | else | ||
868 | radio_mode = RADIO_SCAN_MODE; | ||
869 | update_screen = true; | ||
870 | } | 731 | } |
732 | else | ||
733 | radio_mode = RADIO_SCAN_MODE; | ||
734 | update_screen = true; | ||
871 | break; | 735 | break; |
872 | #endif | 736 | #endif |
873 | #ifdef FM_NEXT_PRESET | 737 | #ifdef FM_NEXT_PRESET |
874 | case FM_NEXT_PRESET: | 738 | case ACTION_FM_NEXT_PRESET: |
875 | next_preset(1); | 739 | next_preset(1); |
876 | search_dir = 0; | 740 | search_dir = 0; |
877 | update_screen = true; | 741 | update_screen = true; |
878 | break; | 742 | break; |
879 | #endif | 743 | #endif |
880 | #ifdef FM_PREV_PRESET | 744 | #ifdef FM_PREV_PRESET |
881 | case FM_PREV_PRESET: | 745 | case ACTION_FM_PREV_PRESET: |
882 | next_preset(-1); | 746 | next_preset(-1); |
883 | search_dir = 0; | 747 | search_dir = 0; |
884 | update_screen = true; | 748 | update_screen = true; |
@@ -890,9 +754,11 @@ bool radio_screen(void) | |||
890 | break; | 754 | break; |
891 | } /*switch(button)*/ | 755 | } /*switch(button)*/ |
892 | 756 | ||
893 | if (button != BUTTON_NONE) | 757 | if (button != ACTION_NONE) |
894 | lastbutton = button; | 758 | lastbutton = button; |
895 | 759 | ||
760 | // action_signalscreenchange(); | ||
761 | |||
896 | #if CONFIG_CODEC != SWCODEC | 762 | #if CONFIG_CODEC != SWCODEC |
897 | peak_meter_peek(); | 763 | peak_meter_peek(); |
898 | #endif | 764 | #endif |
@@ -1023,8 +889,8 @@ bool radio_screen(void) | |||
1023 | 889 | ||
1024 | while(1) | 890 | while(1) |
1025 | { | 891 | { |
1026 | button = button_get(true); | 892 | button = get_action(CONTEXT_FM, TIMEOUT_BLOCK); |
1027 | if(button == (FM_STOP | BUTTON_REL)) | 893 | if(button == (ACTION_FM_STOP | BUTTON_REL)) |
1028 | break; | 894 | break; |
1029 | } | 895 | } |
1030 | } | 896 | } |
@@ -1205,13 +1071,9 @@ static int handle_radio_presets_menu_cb(int key, int m) | |||
1205 | #ifdef FM_PRESET_ACTION | 1071 | #ifdef FM_PRESET_ACTION |
1206 | switch(key) | 1072 | switch(key) |
1207 | { | 1073 | { |
1208 | case FM_PRESET_ACTION: | 1074 | case ACTION_F3: |
1209 | key = MENU_EXIT; /* Fake an exit */ | 1075 | key = ACTION_STD_CANCEL; /* Fake an exit */ |
1210 | break; | 1076 | action_signalscreenchange(); |
1211 | |||
1212 | case FM_PRESET_ACTION | BUTTON_REL: | ||
1213 | /* Ignore the release events */ | ||
1214 | key = BUTTON_NONE; | ||
1215 | break; | 1077 | break; |
1216 | } | 1078 | } |
1217 | #endif | 1079 | #endif |
@@ -1361,11 +1223,11 @@ bool handle_radio_presets_menu(void) | |||
1361 | int handle_radio_presets_cb(int key, int m) | 1223 | int handle_radio_presets_cb(int key, int m) |
1362 | { | 1224 | { |
1363 | (void)m; | 1225 | (void)m; |
1364 | #if 0 /* this screen needs fixing! */ | 1226 | |
1365 | switch(key) | 1227 | switch(key) |
1366 | { | 1228 | { |
1367 | #ifdef FM_PRESET_ADD | 1229 | #ifdef FM_PRESET_ADD |
1368 | case FM_PRESET_ADD: | 1230 | case ACTION_STD_MENU: |
1369 | radio_add_preset(); | 1231 | radio_add_preset(); |
1370 | menu_draw(m); | 1232 | menu_draw(m); |
1371 | key = BUTTON_NONE; | 1233 | key = BUTTON_NONE; |
@@ -1373,61 +1235,25 @@ int handle_radio_presets_cb(int key, int m) | |||
1373 | #endif | 1235 | #endif |
1374 | #if (CONFIG_KEYPAD != IRIVER_H100_PAD) && (CONFIG_KEYPAD != IRIVER_H300_PAD) && (CONFIG_KEYPAD != IAUDIO_X5_PAD) | 1236 | #if (CONFIG_KEYPAD != IRIVER_H100_PAD) && (CONFIG_KEYPAD != IRIVER_H300_PAD) && (CONFIG_KEYPAD != IAUDIO_X5_PAD) |
1375 | #ifdef FM_PRESET | 1237 | #ifdef FM_PRESET |
1376 | case FM_PRESET: | 1238 | case ACTION_STD_QUICKSCREEN: |
1377 | menu_draw(m); | 1239 | menu_draw(m); |
1378 | key = ACTION_STD_EXIT; /* Fake an exit */ | 1240 | key = ACTION_STD_EXIT; /* Fake an exit */ |
1379 | break; | 1241 | break; |
1380 | #endif | 1242 | #endif |
1381 | #endif | 1243 | #endif |
1382 | #ifdef FM_PRESET_ACTION | 1244 | case ACTION_F3: |
1383 | case FM_PRESET_ACTION: | 1245 | case ACTION_STD_CONTEXT: |
1384 | #endif | ||
1385 | #ifdef MENU_RC_ENTER | ||
1386 | case MENU_RC_ENTER | BUTTON_REPEAT: | ||
1387 | #endif | ||
1388 | #ifdef MENU_RC_ENTER2 | ||
1389 | case MENU_RC_ENTER2 | BUTTON_REPEAT: | ||
1390 | #endif | ||
1391 | #ifdef MENU_ENTER2 | ||
1392 | case MENU_ENTER2 | BUTTON_REPEAT: | ||
1393 | #endif | ||
1394 | case MENU_ENTER | BUTTON_REPEAT: /* long gives options */ | ||
1395 | { | 1246 | { |
1396 | bool ret; | 1247 | bool ret; |
1397 | ret = handle_radio_presets_menu(); | 1248 | ret = handle_radio_presets_menu(); |
1398 | menu_draw(m); | 1249 | menu_draw(m); |
1399 | if(ret) | 1250 | if(ret) |
1400 | key = MENU_ATTACHED_USB; | 1251 | key = SYS_USB_CONNECTED; |
1401 | else | 1252 | else |
1402 | key = BUTTON_NONE; | 1253 | key = ACTION_NONE; |
1403 | break; | 1254 | break; |
1404 | } | 1255 | } |
1405 | #ifdef MENU_RC_ENTER | ||
1406 | case MENU_RC_ENTER | BUTTON_REL: | ||
1407 | #endif | ||
1408 | #ifdef MENU_RC_ENTER2 | ||
1409 | case MENU_RC_ENTER2 | BUTTON_REL: | ||
1410 | #endif | ||
1411 | #ifdef MENU_ENTER2 | ||
1412 | case MENU_ENTER2 | BUTTON_REL: | ||
1413 | #endif | ||
1414 | case MENU_ENTER | BUTTON_REL: | ||
1415 | key = ACTION_STD_SELECT; /* fake enter for short press */ | ||
1416 | break; | ||
1417 | |||
1418 | /* ignore down events */ | ||
1419 | case ACTION_STD_SELECT: | ||
1420 | /* Ignore the release events */ | ||
1421 | #ifdef FM_PRESET_ADD | ||
1422 | case FM_PRESET_ADD | BUTTON_REL: | ||
1423 | #endif | ||
1424 | #ifdef FM_PRESET_ACTION | ||
1425 | case FM_PRESET_ACTION | BUTTON_REL: | ||
1426 | #endif | ||
1427 | key = BUTTON_NONE; | ||
1428 | break; | ||
1429 | } | 1256 | } |
1430 | #endif | ||
1431 | return key; | 1257 | return key; |
1432 | } | 1258 | } |
1433 | 1259 | ||