diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2007-04-09 13:39:37 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2007-04-09 13:39:37 +0000 |
| commit | 178c565beb521230ec5434f59e36c2592f32a281 (patch) | |
| tree | fcc205085b783b2458a95429019ae42ae1754c97 /apps/misc.c | |
| parent | dcb4aa242b5180214b899004c3860364c4466a1e (diff) | |
| download | rockbox-178c565beb521230ec5434f59e36c2592f32a281.zip rockbox-178c565beb521230ec5434f59e36c2592f32a281.tar.gz rockbox-178c565beb521230ec5434f59e36c2592f32a281.tar.bz2 rockbox-178c565beb521230ec5434f59e36c2592f32a281.tar.xz | |
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
Diffstat (limited to 'apps/misc.c')
| -rw-r--r-- | apps/misc.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index e3b9434..8004589 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -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; |