1
0
Fork 0
forked from len0rd/rockbox

Stop/shutdown logic rework in browsers and menus. Recorder V1: Double-Off shutdown is now possible from menus and sub-browsers as well. Player, other targets which are always powered during charging: Attempted shutdown from menu with charger plugged now displays the charging splash.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13079 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-04-09 13:39:37 +00:00
parent dcb4aa242b
commit 178c565beb
6 changed files with 59 additions and 46 deletions

View file

@ -58,6 +58,7 @@
#include "icons.h"
#endif /* End HAVE_LCD_BITMAP */
#include "gui/gwps-common.h"
#include "bookmark.h"
#include "misc.h"
@ -676,6 +677,52 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
return false;
}
bool list_stop_handler(void)
{
bool ret = false;
/* Stop the music if it is playing */
if(audio_status())
{
if (!global_settings.party_mode)
{
if (global_settings.fade_on_stop)
fade(0);
bookmark_autobookmark();
audio_stop();
}
}
#if CONFIG_CHARGING
#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
else
{
if (charger_inserted())
charging_splash();
else
shutdown_screen(); /* won't return if shutdown actually happens */
ret = true; /* screen is dirty, caller needs to refresh */
}
#endif
#ifndef HAVE_POWEROFF_WHILE_CHARGING
{
static long last_off = 0;
if (TIME_BEFORE(current_tick, last_off + HZ/2))
{
if (charger_inserted())
{
charging_splash();
ret = true; /* screen is dirty, caller needs to refresh */
}
}
last_off = current_tick;
}
#endif
#endif /* CONFIG_CHARGING */
return ret;
}
#if CONFIG_CHARGING
static bool waiting_to_resume_play = false;
static long play_resume_tick;