diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-12 11:00:19 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-12 11:00:19 +0000 |
| commit | 0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07 (patch) | |
| tree | 70627c231bc98f806bfd0fb7e7b1af58432df819 /apps | |
| parent | 2e9412025b2f84b86a855c05beb748bc2e585525 (diff) | |
| download | rockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.zip rockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.tar.gz rockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.tar.bz2 rockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.tar.xz | |
Now the FM, V2 and Ondio players use the new SYS_POWEROFF event. Now you can safely turn off the player by holding OFF.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5259 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/misc.c | 5 | ||||
| -rw-r--r-- | apps/tree.c | 26 |
2 files changed, 20 insertions, 11 deletions
diff --git a/apps/misc.c b/apps/misc.c index 96d23a8..5be6264 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -217,6 +217,7 @@ bool clean_shutdown(void) { lcd_clear_display(); splash(0, true, str(LANG_SHUTTINGDOWN)); + sleep(HZ); mpeg_stop(); ata_flush(); ata_spindown(1); @@ -239,6 +240,10 @@ int default_event_handler(int event) #endif usb_screen(); return SYS_USB_CONNECTED; + case SYS_POWEROFF: + if (!clean_shutdown()) + return SYS_POWEROFF; + break; } return 0; } diff --git a/apps/tree.c b/apps/tree.c index 1a92dfd..03c7d2c 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -946,21 +946,25 @@ static bool dirbrowse(const char *root, const int *dirfilter) break; #ifdef TREE_OFF +#ifndef HAVE_SW_POWEROFF case TREE_OFF: - /* Stop the music if it is playing, else show the shutdown - screen */ - if(mpeg_status()) - mpeg_stop(); - else { - if (!charger_inserted()) { - shutdown_screen(); - } else { - charging_splash(); + if (*dirfilter < NUM_FILTER_MODES) + { + /* Stop the music if it is playing, else show the shutdown + screen */ + if(mpeg_status()) + mpeg_stop(); + else { + if (!charger_inserted()) { + shutdown_screen(); + } else { + charging_splash(); + } + restore = true; } - restore = true; } break; - +#endif case TREE_OFF | BUTTON_REPEAT: if (charger_inserted()) { charging_splash(); |