summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStepan Moskovchenko <stevenm@rockbox.org>2006-05-07 07:27:07 +0000
committerStepan Moskovchenko <stevenm@rockbox.org>2006-05-07 07:27:07 +0000
commit595a2040204a5f2de2ca3249e215de25983d6711 (patch)
tree1200a33f2f87d7312031c1155f4750580d4fb958
parent68af7bae87b0fa4f0da080752a73e638f2ecdf21 (diff)
downloadrockbox-595a2040204a5f2de2ca3249e215de25983d6711.tar.gz
rockbox-595a2040204a5f2de2ca3249e215de25983d6711.zip
Whoops! Lousy button code...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9884 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/midiplay.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/apps/plugins/midiplay.c b/apps/plugins/midiplay.c
index 70ffaa7d92..4814897906 100644
--- a/apps/plugins/midiplay.c
+++ b/apps/plugins/midiplay.c
@@ -20,6 +20,48 @@
PLUGIN_HEADER
+
+/* variable button definitions */
+#if CONFIG_KEYPAD == RECORDER_PAD
+#define BTN_QUIT BUTTON_OFF
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+
+#elif CONFIG_KEYPAD == ONDIO_PAD
+#define BTN_QUIT BUTTON_OFF
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+
+#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
+#define BTN_QUIT BUTTON_OFF
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+
+#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
+#define BTN_QUIT (BUTTON_SELECT | BUTTON_MENU)
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_SCROLL_FWD
+#define BTN_DOWN BUTTON_SCROLL_BACK
+
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define BTN_QUIT BUTTON_POWER
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_VOL_UP
+#define BTN_DOWN BUTTON_VOL_DOWN
+
+#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
+#define BTN_QUIT BUTTON_POWER
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+
+#endif
+
+
+
#define FRACTSIZE 10
#define SAMPLE_RATE 22050 // 44100 22050 11025
#define MAX_VOICES 14 // Note: 24 midi channels is the minimum general midi
@@ -220,8 +262,8 @@ int midimain(void * filename)
/* Code taken from Oscilloscope plugin */
switch(rb->button_get(false))
{
- case BUTTON_UP:
- case BUTTON_UP | BUTTON_REPEAT:
+ case BTN_UP:
+ case BTN_UP | BUTTON_REPEAT:
vol = rb->global_settings->volume;
if (vol < rb->sound_max(SOUND_VOLUME))
{
@@ -231,8 +273,8 @@ int midimain(void * filename)
}
break;
- case BUTTON_DOWN:
- case BUTTON_DOWN | BUTTON_REPEAT:
+ case BTN_DOWN:
+ case BTN_DOWN | BUTTON_REPEAT:
vol = rb->global_settings->volume;
if (vol > rb->sound_min(SOUND_VOLUME))
{
@@ -242,7 +284,7 @@ int midimain(void * filename)
}
break;
- case BUTTON_RIGHT:
+ case BTN_RIGHT:
{
/* Skip 3 seconds */
/* Should skip length be retrieved from the RB settings? */
@@ -254,7 +296,7 @@ int midimain(void * filename)
break;
}
- case BUTTON_OFF:
+ case BTN_QUIT:
quit=1;
}