diff options
-rwxr-xr-x | apps/playlist.c | 5 | ||||
-rw-r--r-- | apps/root_menu.c | 38 | ||||
-rw-r--r-- | apps/root_menu.h | 2 |
3 files changed, 23 insertions, 22 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index b0f7964178..43aa97790b 100755 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -2599,11 +2599,6 @@ void playlist_start(int start_index, unsigned long elapsed, | |||
2599 | { | 2599 | { |
2600 | struct playlist_info* playlist = ¤t_playlist; | 2600 | struct playlist_info* playlist = ¤t_playlist; |
2601 | 2601 | ||
2602 | /* Cancel FM radio selection as previous music. For cases where we start | ||
2603 | playback without going to the WPS, such as playlist insert.. or | ||
2604 | playlist catalog. */ | ||
2605 | previous_music_is_wps(); | ||
2606 | |||
2607 | playlist->index = start_index; | 2602 | playlist->index = start_index; |
2608 | 2603 | ||
2609 | playlist->started = true; | 2604 | playlist->started = true; |
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 | ||
89 | static 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) | ||
94 | static 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 | ||
90 | static char current_track_path[MAX_PATH]; | 104 | static char current_track_path[MAX_PATH]; |
91 | static void rootmenu_track_changed_callback(unsigned short id, void* param) | 105 | static 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 | ||
733 | static int previous_music = GO_TO_WPS; | ||
734 | |||
735 | void previous_music_is_wps(void) | ||
736 | { | ||
737 | previous_music = GO_TO_WPS; | ||
738 | } | ||
739 | |||
740 | void root_menu(void) | 747 | void 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() */ |
diff --git a/apps/root_menu.h b/apps/root_menu.h index 6004a43f34..262b1d9a0c 100644 --- a/apps/root_menu.h +++ b/apps/root_menu.h | |||
@@ -69,8 +69,6 @@ enum { | |||
69 | #ifndef PLUGIN | 69 | #ifndef PLUGIN |
70 | extern struct menu_item_ex root_menu_; | 70 | extern struct menu_item_ex root_menu_; |
71 | 71 | ||
72 | extern void previous_music_is_wps(void); | ||
73 | |||
74 | void root_menu_load_from_cfg(void* setting, char *value); | 72 | void root_menu_load_from_cfg(void* setting, char *value); |
75 | char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len); | 73 | char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len); |
76 | void root_menu_set_default(void* setting, void* defaultval); | 74 | void root_menu_set_default(void* setting, void* defaultval); |