From 0f7f3467bfcac6091106d2927c3728952d710615 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 15 Oct 2007 10:33:01 +0000 Subject: Integer setting changes to make all those settings consistant on the target. wheel targets, clockwise is increase value archos player, + is increase button targets, up is increase git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15120 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/option_select.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) (limited to 'apps/gui/option_select.c') diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 7550b8b7d4..6092a63da6 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -32,6 +32,16 @@ #include "misc.h" #include "splash.h" +#if defined (HAVE_SCROLLWHEEL) || \ + (CONFIG_KEYPAD == IPOD_3G_PAD) || \ + (CONFIG_KEYPAD == IPOD_4G_PAD) || \ + (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ + (CONFIG_KEYPAD == PLAYER_PAD) +/* Define this if your target makes sense to have + smaller values at the top of the list increasing down the list */ +#define ASCENDING_INT_SETTINGS +#endif + static const char *unit_strings[] = { [UNIT_INT] = "", [UNIT_MS] = "ms", @@ -249,14 +259,20 @@ static int selection_to_val(struct settings_list *setting, int selection) else if ((setting->flags & F_T_SOUND) == F_T_SOUND) { int setting_id = setting->sound_setting->setting; +#ifndef ASCENDING_INT_SETTINGS step = sound_steps(setting_id); max = sound_max(setting_id); min = sound_min(setting_id); +#else + step = -sound_steps(setting_id); + min = sound_max(setting_id); + max = sound_min(setting_id); +#endif } else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING) { struct int_setting *info = setting->int_setting; -#if CONFIG_KEYPAD != PLAYER_PAD +#ifndef ASCENDING_INT_SETTINGS min = info->min; max = info->max; step = info->step; @@ -266,12 +282,6 @@ static int selection_to_val(struct settings_list *setting, int selection) step = -info->step; #endif } - if (setting->flags & F_FLIPLIST) - { - int a; - a = min; min = max; max = a; - step = -step; - } return max- (selection * step); } static char * value_setting_get_name_cb(int selected_item, @@ -342,32 +352,16 @@ bool option_screen(struct settings_list *setting, int min = sound_min(setting_id); int max = sound_max(setting_id); nb_items = (max-min)/steps + 1; - if (setting->flags&F_FLIPLIST) - { - selected = (oldvalue - min) / steps; - } - else - { - selected = (max - oldvalue) / steps; - } + selected = (max - oldvalue) / steps; function = sound_get_fn(setting_id); } else { struct int_setting *info = setting->int_setting; int min, max, step; - if (setting->flags&F_FLIPLIST) - { - min = info->max; - max = info->min; - step = -info->step; - } - else - { - max = info->max; - min = info->min; - step = info->step; - } + max = info->max; + min = info->min; + step = info->step; nb_items = (max-min)/step + 1; selected = (max - oldvalue)/step; function = info->option_callback; -- cgit v1.2.3