mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
root_menu: Remove previous_music_is_wps() and change previous_music via event callback.
Change-Id: I0f3b85a8fe8010a2480ef44a72a90dc7904bc777
This commit is contained in:
parent
bebf71a08b
commit
35b4ba8513
3 changed files with 23 additions and 22 deletions
|
@ -2599,11 +2599,6 @@ void playlist_start(int start_index, unsigned long elapsed,
|
||||||
{
|
{
|
||||||
struct playlist_info* playlist = ¤t_playlist;
|
struct playlist_info* playlist = ¤t_playlist;
|
||||||
|
|
||||||
/* Cancel FM radio selection as previous music. For cases where we start
|
|
||||||
playback without going to the WPS, such as playlist insert.. or
|
|
||||||
playlist catalog. */
|
|
||||||
previous_music_is_wps();
|
|
||||||
|
|
||||||
playlist->index = start_index;
|
playlist->index = start_index;
|
||||||
|
|
||||||
playlist->started = true;
|
playlist->started = true;
|
||||||
|
|
|
@ -86,6 +86,20 @@ static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume
|
||||||
or goto current track based on previous
|
or goto current track based on previous
|
||||||
screen */
|
screen */
|
||||||
|
|
||||||
|
static int previous_music = GO_TO_WPS; /* Toggles behavior of the return-to
|
||||||
|
* playback-button depending
|
||||||
|
* on FM radio */
|
||||||
|
|
||||||
|
#if (CONFIG_TUNER)
|
||||||
|
static void rootmenu_start_playback_callback(unsigned short id, void *param)
|
||||||
|
{
|
||||||
|
(void) id; (void) param;
|
||||||
|
/* Cancel FM radio selection as previous music. For cases where we start
|
||||||
|
playback without going to the WPS, such as playlist insert or
|
||||||
|
playlist catalog. */
|
||||||
|
previous_music = GO_TO_WPS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static char current_track_path[MAX_PATH];
|
static char current_track_path[MAX_PATH];
|
||||||
static void rootmenu_track_changed_callback(unsigned short id, void* param)
|
static void rootmenu_track_changed_callback(unsigned short id, void* param)
|
||||||
|
@ -730,13 +744,6 @@ static int load_plugin_screen(char *plug_path)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int previous_music = GO_TO_WPS;
|
|
||||||
|
|
||||||
void previous_music_is_wps(void)
|
|
||||||
{
|
|
||||||
previous_music = GO_TO_WPS;
|
|
||||||
}
|
|
||||||
|
|
||||||
void root_menu(void)
|
void root_menu(void)
|
||||||
{
|
{
|
||||||
int previous_browser = GO_TO_FILEBROWSER;
|
int previous_browser = GO_TO_FILEBROWSER;
|
||||||
|
@ -747,6 +754,9 @@ void root_menu(void)
|
||||||
if (global_settings.start_in_screen == 0)
|
if (global_settings.start_in_screen == 0)
|
||||||
next_screen = (int)global_status.last_screen;
|
next_screen = (int)global_status.last_screen;
|
||||||
else next_screen = global_settings.start_in_screen - 2;
|
else next_screen = global_settings.start_in_screen - 2;
|
||||||
|
#if CONFIG_TUNER
|
||||||
|
add_event(PLAYBACK_EVENT_START_PLAYBACK, rootmenu_start_playback_callback);
|
||||||
|
#endif
|
||||||
add_event(PLAYBACK_EVENT_TRACK_CHANGE, rootmenu_track_changed_callback);
|
add_event(PLAYBACK_EVENT_TRACK_CHANGE, rootmenu_track_changed_callback);
|
||||||
#ifdef HAVE_RTC_ALARM
|
#ifdef HAVE_RTC_ALARM
|
||||||
if ( rtc_check_alarm_started(true) )
|
if ( rtc_check_alarm_started(true) )
|
||||||
|
@ -829,18 +839,16 @@ void root_menu(void)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
if (next_screen == GO_TO_FILEBROWSER
|
|
||||||
#ifdef HAVE_TAGCACHE
|
#ifdef HAVE_TAGCACHE
|
||||||
|| next_screen == GO_TO_DBBROWSER
|
/* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */
|
||||||
#endif
|
if (next_screen == GO_TO_FILEBROWSER || next_screen == GO_TO_DBBROWSER)
|
||||||
)
|
|
||||||
previous_browser = next_screen;
|
previous_browser = next_screen;
|
||||||
if (next_screen == GO_TO_WPS
|
|
||||||
#if CONFIG_TUNER
|
|
||||||
|| next_screen == GO_TO_FM
|
|
||||||
#endif
|
#endif
|
||||||
)
|
#if CONFIG_TUNER
|
||||||
|
/* With !CONFIG_TUNER previous_music is always GO_TO_WPS */
|
||||||
|
if (next_screen == GO_TO_WPS || next_screen == GO_TO_FM)
|
||||||
previous_music = next_screen;
|
previous_music = next_screen;
|
||||||
|
#endif
|
||||||
next_screen = load_screen(next_screen);
|
next_screen = load_screen(next_screen);
|
||||||
break;
|
break;
|
||||||
} /* switch() */
|
} /* switch() */
|
||||||
|
|
|
@ -69,8 +69,6 @@ enum {
|
||||||
#ifndef PLUGIN
|
#ifndef PLUGIN
|
||||||
extern struct menu_item_ex root_menu_;
|
extern struct menu_item_ex root_menu_;
|
||||||
|
|
||||||
extern void previous_music_is_wps(void);
|
|
||||||
|
|
||||||
void root_menu_load_from_cfg(void* setting, char *value);
|
void root_menu_load_from_cfg(void* setting, char *value);
|
||||||
char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len);
|
char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len);
|
||||||
void root_menu_set_default(void* setting, void* defaultval);
|
void root_menu_set_default(void* setting, void* defaultval);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue