summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2008-01-27 00:18:29 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2008-01-27 00:18:29 +0000
commit11298701ddee948cfb171c0976b02fb0efc677da (patch)
treee871860809cb10e4c82bea37dbab817d409e1bc8 /apps/plugins
parent9ef02a5fec2fe6cfc2765e3cb0b197be09726cd8 (diff)
add support for the gigabeat remote control in mpegplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16175 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c29
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c42
2 files changed, 71 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 2cc8fbc718..308aee62f3 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -47,6 +47,13 @@ struct mpeg_settings settings;
#define MPEG_START_TIME_SCROLL_UP BUTTON_VOL_UP
#define MPEG_START_TIME_EXIT BUTTON_POWER
+#define MPEG_START_TIME_RC_SELECT (BUTTON_RC_PLAY | BUTTON_REL)
+#define MPEG_START_TIME_RC_LEFT BUTTON_RC_REW
+#define MPEG_START_TIME_RC_RIGHT BUTTON_RC_FF
+#define MPEG_START_TIME_RC_UP BUTTON_RC_VOL_UP
+#define MPEG_START_TIME_RC_DOWN BUTTON_RC_VOL_DOWN
+#define MPEG_START_TIME_RC_EXIT (BUTTON_RC_PLAY | BUTTON_REPEAT)
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define MPEG_START_TIME_SELECT BUTTON_PLAY
#define MPEG_START_TIME_LEFT BUTTON_LEFT
@@ -439,12 +446,20 @@ static int get_start_time(uint32_t duration)
/* Coarse (1 minute) control */
case MPEG_START_TIME_DOWN:
case MPEG_START_TIME_DOWN | BUTTON_REPEAT:
+#if MPEG_START_TIME_RC_DOWN
+ case MPEG_START_TIME_RC_DOWN:
+ case MPEG_START_TIME_RC_DOWN | BUTTON_REPEAT:
+#endif
resume_time = increment_time(resume_time, -60*TS_SECOND, duration);
slider_state = state0;
break;
case MPEG_START_TIME_UP:
case MPEG_START_TIME_UP | BUTTON_REPEAT:
+#if MPEG_START_TIME_RC_UP
+ case MPEG_START_TIME_RC_UP:
+ case MPEG_START_TIME_RC_UP | BUTTON_REPEAT:
+#endif
resume_time = increment_time(resume_time, 60*TS_SECOND, duration);
slider_state = state0;
break;
@@ -452,6 +467,10 @@ static int get_start_time(uint32_t duration)
/* Fine (1 second) control */
case MPEG_START_TIME_LEFT:
case MPEG_START_TIME_LEFT | BUTTON_REPEAT:
+#if MPEG_START_TIME_RC_LEFT
+ case MPEG_START_TIME_RC_LEFT:
+ case MPEG_START_TIME_RC_LEFT | BUTTON_REPEAT:
+#endif
#ifdef MPEG_START_TIME_SCROLL_UP
case MPEG_START_TIME_SCROLL_UP:
case MPEG_START_TIME_SCROLL_UP | BUTTON_REPEAT:
@@ -462,6 +481,10 @@ static int get_start_time(uint32_t duration)
case MPEG_START_TIME_RIGHT:
case MPEG_START_TIME_RIGHT | BUTTON_REPEAT:
+#if MPEG_START_TIME_RC_RIGHT
+ case MPEG_START_TIME_RC_RIGHT:
+ case MPEG_START_TIME_RC_RIGHT | BUTTON_REPEAT:
+#endif
#ifdef MPEG_START_TIME_SCROLL_DOWN
case MPEG_START_TIME_SCROLL_DOWN:
case MPEG_START_TIME_SCROLL_DOWN | BUTTON_REPEAT:
@@ -471,12 +494,18 @@ static int get_start_time(uint32_t duration)
break;
case MPEG_START_TIME_SELECT:
+#if MPEG_START_TIME_RC_SELECT
+ case MPEG_START_TIME_RC_SELECT:
+#endif
settings.resume_time = resume_time;
button = MPEG_START_SEEK;
slider_state = state9;
break;
case MPEG_START_TIME_EXIT:
+#if MPEG_START_TIME_RC_EXIT
+ case MPEG_START_TIME_RC_EXIT:
+#endif
button = MPEG_START_EXIT;
slider_state = state9;
break;
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 7c82ac5243..ba5fd26742 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -149,6 +149,13 @@ PLUGIN_IRAM_DECLARE
#define MPEG_VOLUP2 BUTTON_VOL_UP
#define MPEG_RW BUTTON_UP
#define MPEG_FF BUTTON_DOWN
+#define MPEG_RC_MENU BUTTON_RC_DSP
+#define MPEG_RC_STOP (BUTTON_RC_PLAY | BUTTON_REPEAT)
+#define MPEG_RC_PAUSE (BUTTON_RC_PLAY | BUTTON_REL)
+#define MPEG_RC_VOLDOWN BUTTON_RC_VOL_DOWN
+#define MPEG_RC_VOLUP BUTTON_RC_VOL_UP
+#define MPEG_RC_RW BUTTON_RC_REW
+#define MPEG_RC_FF BUTTON_RC_FF
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define MPEG_MENU BUTTON_LEFT
@@ -999,9 +1006,15 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh)
switch (btn)
{
case MPEG_FF:
+#ifdef MPEG_RC_FF
+ case MPEG_RC_FF:
+#endif
wvs_set_status(WVS_STATUS_FF);
break;
case MPEG_RW:
+#ifdef MPEG_RC_RW
+ case MPEG_RC_RW:
+#endif
wvs_set_status(WVS_STATUS_RW);
break;
default:
@@ -1023,10 +1036,18 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh)
case MPEG_FF | BUTTON_REPEAT:
case MPEG_RW | BUTTON_REPEAT:
+#ifdef MPEG_RC_FF
+ case MPEG_RC_FF | BUTTON_REPEAT:
+ case MPEG_RC_RW | BUTTON_REPEAT:
+#endif
break;
case MPEG_FF | BUTTON_REL:
case MPEG_RW | BUTTON_REL:
+#ifdef MPEG_RC_FF
+ case MPEG_RC_FF | BUTTON_REL:
+ case MPEG_RC_RW | BUTTON_REL:
+#endif
if (wvs.status == WVS_STATUS_FF)
time += ff_rw_count;
else if (wvs.status == WVS_STATUS_RW)
@@ -1275,6 +1296,10 @@ static void button_loop(void)
case MPEG_VOLUP2:
case MPEG_VOLUP2|BUTTON_REPEAT:
#endif
+#ifdef MPEG_RC_VOLUP
+ case MPEG_RC_VOLUP:
+ case MPEG_RC_VOLUP|BUTTON_REPEAT:
+#endif
{
wvs_set_volume(+1);
break;
@@ -1286,12 +1311,19 @@ static void button_loop(void)
case MPEG_VOLDOWN2:
case MPEG_VOLDOWN2|BUTTON_REPEAT:
#endif
+#ifdef MPEG_RC_VOLDOWN
+ case MPEG_RC_VOLDOWN:
+ case MPEG_RC_VOLDOWN|BUTTON_REPEAT:
+#endif
{
wvs_set_volume(-1);
break;
} /* MPEG_VOLDOWN*: */
case MPEG_MENU:
+#ifdef MPEG_RC_MENU
+ case MPEG_RC_MENU:
+#endif
{
int state = wvs_halt(); /* save previous state */
int result;
@@ -1330,6 +1362,9 @@ static void button_loop(void)
} /* MPEG_MENU: */
case MPEG_STOP:
+#ifdef MPEG_RC_STOP
+ case MPEG_RC_STOP:
+#endif
case ACTION_STD_CANCEL:
{
wvs_stop();
@@ -1340,6 +1375,9 @@ static void button_loop(void)
#ifdef MPEG_PAUSE2
case MPEG_PAUSE2:
#endif
+#ifdef MPEG_RC_PAUSE
+ case MPEG_RC_PAUSE:
+#endif
{
int status = wvs_status();
@@ -1359,6 +1397,10 @@ static void button_loop(void)
case MPEG_RW:
case MPEG_FF:
+#ifdef MPEG_RC_RW
+ case MPEG_RC_RW:
+ case MPEG_RC_FF:
+#endif
{
wvs_seek(button);
break;