From ce1312e383e200b2745ffb118bc85f44e37d6a87 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 6 Nov 2005 16:18:55 +0000 Subject: [PATCH] iRiver: Fixed the wps not to stop audio before shutdown has been accepted. Please revert back if you feel this wrong. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7764 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 16 +++++++++++++--- apps/wps.h | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/wps.c b/apps/wps.c index 84f862de9c..ca6e394881 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -750,10 +750,20 @@ long wps_show(void) /* stop and exit wps */ #ifdef WPS_EXIT case WPS_EXIT: -#ifdef WPS_RC_EXIT - case WPS_RC_EXIT: -#endif +# ifdef WPS_EXIT_PRE + if (lastbutton != WPS_EXIT_PRE) + break; +# endif exit = true; + +# ifdef WPS_RC_EXIT + case WPS_RC_EXIT: +# ifdef WPS_RC_EXIT_PRE + if (lastbutton != WPS_RC_EXIT_PRE) + break; +# endif + exit = true; +# endif break; #endif diff --git a/apps/wps.h b/apps/wps.h index e1f053a3d2..b8499984a8 100644 --- a/apps/wps.h +++ b/apps/wps.h @@ -38,7 +38,8 @@ #define WPS_MENU_PRE BUTTON_MODE #define WPS_BROWSE (BUTTON_SELECT | BUTTON_REL) #define WPS_BROWSE_PRE BUTTON_SELECT -#define WPS_EXIT BUTTON_OFF +#define WPS_EXIT (BUTTON_OFF | BUTTON_REL) +#define WPS_EXIT_PRE BUTTON_OFF #define WPS_ID3 (BUTTON_MODE | BUTTON_ON) #define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) #define WPS_QUICK (BUTTON_MODE | BUTTON_REPEAT) @@ -54,7 +55,8 @@ #define WPS_RC_PAUSE BUTTON_RC_ON #define WPS_RC_INCVOL BUTTON_RC_VOL_UP #define WPS_RC_DECVOL BUTTON_RC_VOL_DOWN -#define WPS_RC_EXIT BUTTON_RC_STOP +#define WPS_RC_EXIT (BUTTON_RC_STOP | BUTTON_REL) +#define WPS_RC_EXIT_PRE BUTTON_RC_STOP #define WPS_RC_MENU (BUTTON_RC_MODE | BUTTON_REL) #define WPS_RC_MENU_PRE BUTTON_RC_MODE #define WPS_RC_BROWSE (BUTTON_RC_MENU | BUTTON_REL)