From 9e376a557dd3ad8a29879ac534b0569428b0c92a Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 26 Jun 2005 21:13:14 +0000 Subject: Iriver: remote FFWD/REW support git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6883 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 20 +++++++++++++++++++- apps/wps.h | 12 ++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/apps/wps.c b/apps/wps.c index f05109872d..be0ad448dd 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -105,8 +105,14 @@ static bool ffwd_rew(int button) while (!exit) { switch ( button ) { case WPS_FFWD: +#ifdef WPS_RC_FFWD + case WPS_RC_FFWD: +#endif direction = 1; case WPS_REW: +#ifdef WPS_RC_REW + case WPS_RC_REW: +#endif if (ff_rewind) { if (direction == 1) @@ -186,6 +192,10 @@ static bool ffwd_rew(int button) case WPS_PREV: case WPS_NEXT: +#ifdef WPS_RC_PREV + case WPS_RC_PREV: + case WPS_RC_NEXT: +#endif audio_ff_rewind(id3->elapsed+ff_rewind_count); ff_rewind_count = 0; ff_rewind = false; @@ -576,7 +586,7 @@ long wps_show(void) case WPS_REW: #ifdef WPS_RC_FFWD case WPS_RC_FFWD: - case WPS_RC_RWD: + case WPS_RC_REW: #endif ffwd_rew(button); break; @@ -589,6 +599,10 @@ long wps_show(void) #endif #ifdef WPS_RC_PREV case WPS_RC_PREV: +#ifdef WPS_RC_PREV_PRE + if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) + break; +#endif #endif if (!id3 || (id3->elapsed < 3*1000)) { audio_prev(); @@ -612,6 +626,10 @@ long wps_show(void) #endif #ifdef WPS_RC_NEXT case WPS_RC_NEXT: +#ifdef WPS_RC_NEXT_PRE + if ((button == WPS_RC_NEXT) && (lastbutton != WPS_RC_NEXT_PRE)) + break; +#endif #endif audio_next(); break; diff --git a/apps/wps.h b/apps/wps.h index 94a6b04859..3fac42d648 100644 --- a/apps/wps.h +++ b/apps/wps.h @@ -42,15 +42,19 @@ #define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) #define WPS_QUICK (BUTTON_ON | BUTTON_REPEAT) -#define WPS_RC_NEXT BUTTON_RC_FF -#define WPS_RC_PREV BUTTON_RC_REW +#define WPS_RC_NEXT (BUTTON_RC_FF | BUTTON_REL) +#define WPS_RC_NEXT_PRE BUTTON_RC_FF +#define WPS_RC_PREV (BUTTON_RC_REW | BUTTON_REL) +#define WPS_RC_PREV_PRE BUTTON_RC_REW +#define WPS_RC_FFWD (BUTTON_RC_FF | BUTTON_REPEAT) +#define WPS_RC_REW (BUTTON_RC_REW | BUTTON_REPEAT) #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_MENU (BUTTON_RC_MENU | BUTTON_REL) -#define WPS_RC_MENU_PRE BUTTON_RC_MENU -#define WPS_RC_BROWSE (BUTTON_RC_MODE | BUTTON_REL) +#define WPS_RC_MENU_PRE BUTTON_RC_MENU +#define WPS_RC_BROWSE (BUTTON_RC_MODE | BUTTON_REL) #define WPS_RC_BROWSE_PRE BUTTON_RC_MODE #elif CONFIG_KEYPAD == RECORDER_PAD -- cgit v1.2.3