diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-05-07 11:47:54 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-05-07 11:47:54 +0000 |
commit | 79e7375ddf5e5c18e241607d47746ae5345b4b48 (patch) | |
tree | 72c53e9e87e7d863220f7bb0df6fdd406c5d1b31 | |
parent | d7ef2474120f2a009af139754f6d387c8e83c949 (diff) |
Add support for the next/prev side buttons to mpegplayer on the Gigabeat S to control seeking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25871 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 4c7245dc94..8bd506da35 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -170,7 +170,9 @@ PLUGIN_IRAM_DECLARE #define MPEG_VOLDOWN2 BUTTON_VOL_DOWN #define MPEG_VOLUP2 BUTTON_VOL_UP #define MPEG_RW BUTTON_UP +#define MPEG_RW2 BUTTON_PREV #define MPEG_FF BUTTON_DOWN +#define MPEG_FF2 BUTTON_NEXT #define MPEG_RC_MENU BUTTON_RC_DSP #define MPEG_RC_STOP (BUTTON_RC_PLAY | BUTTON_REPEAT) @@ -1207,23 +1209,31 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh) switch (btn) { case MPEG_FF: +#ifdef MPEG_FF2 + case MPEG_FF2: +#endif #ifdef MPEG_RC_FF case MPEG_RC_FF: #endif - wvs_set_status(WVS_STATUS_FF); + if (!(btn & BUTTON_REPEAT)) + wvs_set_status(WVS_STATUS_FF); + btn = MPEG_FF | BUTTON_REPEAT; /* simplify code below */ break; case MPEG_RW: +#ifdef MPEG_RW2 + case MPEG_RW2: +#endif #ifdef MPEG_RC_RW case MPEG_RC_RW: #endif - wvs_set_status(WVS_STATUS_RW); + if (!(btn & BUTTON_REPEAT)) + wvs_set_status(WVS_STATUS_RW); + btn = MPEG_RW | BUTTON_REPEAT; /* simplify code below */ break; default: btn = -1; } - btn |= BUTTON_REPEAT; - while (1) { stream_keep_disk_active(); @@ -1236,6 +1246,12 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh) case MPEG_FF | BUTTON_REPEAT: case MPEG_RW | BUTTON_REPEAT: +#ifdef MPEG_FF2 + case MPEG_FF2 | BUTTON_REPEAT: +#endif +#ifdef MPEG_RW2 + case MPEG_RW2 | BUTTON_REPEAT: +#endif #ifdef MPEG_RC_FF case MPEG_RC_FF | BUTTON_REPEAT: case MPEG_RC_RW | BUTTON_REPEAT: @@ -1244,6 +1260,12 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh) case MPEG_FF | BUTTON_REL: case MPEG_RW | BUTTON_REL: +#ifdef MPEG_FF2 + case MPEG_FF2 | BUTTON_REL: +#endif +#ifdef MPEG_RW2 + case MPEG_RW2 | BUTTON_REL: +#endif #ifdef MPEG_RC_FF case MPEG_RC_FF | BUTTON_REL: case MPEG_RC_RW | BUTTON_REL: @@ -1667,6 +1689,12 @@ static void button_loop(void) case MPEG_RW: case MPEG_FF: +#ifdef MPEG_RW2 + case MPEG_RW2: +#endif +#ifdef MPEG_FF2 + case MPEG_FF2: +#endif #ifdef MPEG_RC_RW case MPEG_RC_RW: case MPEG_RC_FF: |