summaryrefslogtreecommitdiff
path: root/apps/sound_menu.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2004-09-19 21:58:37 +0000
committerBjörn Stenberg <bjorn@haxx.se>2004-09-19 21:58:37 +0000
commit6c33c51a4ca9907d23e3154d956fd6781122f492 (patch)
treef0e598efaf064bb72c33c0a8a2edba4cf9ebb13c /apps/sound_menu.c
parent17f54a40f100a3343a15a431d235699024aa76c8 (diff)
Redesigned the button handling. The code now uses symbolic function defines instead of checking for specific buttons. This makes it easier to add support for new devices with different button layouts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5091 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/sound_menu.c')
-rw-r--r--apps/sound_menu.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index a037c94084..fdb2043171 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -103,38 +103,29 @@ bool set_sound(const char* string,
changed = false;
button = button_get_w_tmo(HZ/2);
switch( button ) {
-#ifdef HAVE_RECORDER_KEYPAD
- case BUTTON_UP:
- case BUTTON_UP | BUTTON_REPEAT:
-#else
- case BUTTON_RIGHT:
- case BUTTON_RIGHT | BUTTON_REPEAT:
-#endif
+ case SETTINGS_INC:
+ case SETTINGS_INC | BUTTON_REPEAT:
(*variable)+=steps;
if(*variable > max )
*variable = max;
changed = true;
break;
-#ifdef HAVE_RECORDER_KEYPAD
- case BUTTON_DOWN:
- case BUTTON_DOWN | BUTTON_REPEAT:
-#else
- case BUTTON_LEFT:
- case BUTTON_LEFT | BUTTON_REPEAT:
-#endif
+ case SETTINGS_DEC:
+ case SETTINGS_DEC | BUTTON_REPEAT:
(*variable)-=steps;
if(*variable < min )
*variable = min;
changed = true;
break;
-#ifdef HAVE_RECORDER_KEYPAD
- case BUTTON_LEFT:
-#else
- case BUTTON_STOP:
- case BUTTON_MENU:
- case BUTTON_PLAY:
+ case SETTINGS_OK:
+ case SETTINGS_CANCEL:
+#ifdef SETTINGS_OK2
+ case SETTINGS_OK2:
+#endif
+#ifdef SETTINGS_CANCEL2
+ case SETTINGS_CANCEL2:
#endif
done = true;
break;