summaryrefslogtreecommitdiff
path: root/apps/root_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r--apps/root_menu.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index c94a4443e6..189b2ec35c 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -86,6 +86,20 @@ static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume
86 or goto current track based on previous 86 or goto current track based on previous
87 screen */ 87 screen */
88 88
89static int previous_music = GO_TO_WPS; /* Toggles behavior of the return-to
90 * playback-button depending
91 * on FM radio */
92
93#if (CONFIG_TUNER)
94static void rootmenu_start_playback_callback(unsigned short id, void *param)
95{
96 (void) id; (void) param;
97 /* Cancel FM radio selection as previous music. For cases where we start
98 playback without going to the WPS, such as playlist insert or
99 playlist catalog. */
100 previous_music = GO_TO_WPS;
101}
102#endif
89 103
90static char current_track_path[MAX_PATH]; 104static char current_track_path[MAX_PATH];
91static void rootmenu_track_changed_callback(unsigned short id, void* param) 105static void rootmenu_track_changed_callback(unsigned short id, void* param)
@@ -730,13 +744,6 @@ static int load_plugin_screen(char *plug_path)
730} 744}
731#endif 745#endif
732 746
733static int previous_music = GO_TO_WPS;
734
735void previous_music_is_wps(void)
736{
737 previous_music = GO_TO_WPS;
738}
739
740void root_menu(void) 747void root_menu(void)
741{ 748{
742 int previous_browser = GO_TO_FILEBROWSER; 749 int previous_browser = GO_TO_FILEBROWSER;
@@ -747,6 +754,9 @@ void root_menu(void)
747 if (global_settings.start_in_screen == 0) 754 if (global_settings.start_in_screen == 0)
748 next_screen = (int)global_status.last_screen; 755 next_screen = (int)global_status.last_screen;
749 else next_screen = global_settings.start_in_screen - 2; 756 else next_screen = global_settings.start_in_screen - 2;
757#if CONFIG_TUNER
758 add_event(PLAYBACK_EVENT_START_PLAYBACK, rootmenu_start_playback_callback);
759#endif
750 add_event(PLAYBACK_EVENT_TRACK_CHANGE, rootmenu_track_changed_callback); 760 add_event(PLAYBACK_EVENT_TRACK_CHANGE, rootmenu_track_changed_callback);
751#ifdef HAVE_RTC_ALARM 761#ifdef HAVE_RTC_ALARM
752 if ( rtc_check_alarm_started(true) ) 762 if ( rtc_check_alarm_started(true) )
@@ -829,18 +839,16 @@ void root_menu(void)
829 break; 839 break;
830#endif 840#endif
831 default: 841 default:
832 if (next_screen == GO_TO_FILEBROWSER
833#ifdef HAVE_TAGCACHE 842#ifdef HAVE_TAGCACHE
834 || next_screen == GO_TO_DBBROWSER 843/* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */
835#endif 844 if (next_screen == GO_TO_FILEBROWSER || next_screen == GO_TO_DBBROWSER)
836 )
837 previous_browser = next_screen; 845 previous_browser = next_screen;
838 if (next_screen == GO_TO_WPS
839#if CONFIG_TUNER
840 || next_screen == GO_TO_FM
841#endif 846#endif
842 ) 847#if CONFIG_TUNER
848/* With !CONFIG_TUNER previous_music is always GO_TO_WPS */
849 if (next_screen == GO_TO_WPS || next_screen == GO_TO_FM)
843 previous_music = next_screen; 850 previous_music = next_screen;
851#endif
844 next_screen = load_screen(next_screen); 852 next_screen = load_screen(next_screen);
845 break; 853 break;
846 } /* switch() */ 854 } /* switch() */