diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/option_select.c | 48 |
1 files changed, 21 insertions, 27 deletions
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 @@ | |||
32 | #include "misc.h" | 32 | #include "misc.h" |
33 | #include "splash.h" | 33 | #include "splash.h" |
34 | 34 | ||
35 | #if defined (HAVE_SCROLLWHEEL) || \ | ||
36 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | ||
37 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | ||
38 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ | ||
39 | (CONFIG_KEYPAD == PLAYER_PAD) | ||
40 | /* Define this if your target makes sense to have | ||
41 | smaller values at the top of the list increasing down the list */ | ||
42 | #define ASCENDING_INT_SETTINGS | ||
43 | #endif | ||
44 | |||
35 | static const char *unit_strings[] = | 45 | static const char *unit_strings[] = |
36 | { | 46 | { |
37 | [UNIT_INT] = "", [UNIT_MS] = "ms", | 47 | [UNIT_INT] = "", [UNIT_MS] = "ms", |
@@ -249,14 +259,20 @@ static int selection_to_val(struct settings_list *setting, int selection) | |||
249 | else if ((setting->flags & F_T_SOUND) == F_T_SOUND) | 259 | else if ((setting->flags & F_T_SOUND) == F_T_SOUND) |
250 | { | 260 | { |
251 | int setting_id = setting->sound_setting->setting; | 261 | int setting_id = setting->sound_setting->setting; |
262 | #ifndef ASCENDING_INT_SETTINGS | ||
252 | step = sound_steps(setting_id); | 263 | step = sound_steps(setting_id); |
253 | max = sound_max(setting_id); | 264 | max = sound_max(setting_id); |
254 | min = sound_min(setting_id); | 265 | min = sound_min(setting_id); |
266 | #else | ||
267 | step = -sound_steps(setting_id); | ||
268 | min = sound_max(setting_id); | ||
269 | max = sound_min(setting_id); | ||
270 | #endif | ||
255 | } | 271 | } |
256 | else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING) | 272 | else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING) |
257 | { | 273 | { |
258 | struct int_setting *info = setting->int_setting; | 274 | struct int_setting *info = setting->int_setting; |
259 | #if CONFIG_KEYPAD != PLAYER_PAD | 275 | #ifndef ASCENDING_INT_SETTINGS |
260 | min = info->min; | 276 | min = info->min; |
261 | max = info->max; | 277 | max = info->max; |
262 | step = info->step; | 278 | step = info->step; |
@@ -266,12 +282,6 @@ static int selection_to_val(struct settings_list *setting, int selection) | |||
266 | step = -info->step; | 282 | step = -info->step; |
267 | #endif | 283 | #endif |
268 | } | 284 | } |
269 | if (setting->flags & F_FLIPLIST) | ||
270 | { | ||
271 | int a; | ||
272 | a = min; min = max; max = a; | ||
273 | step = -step; | ||
274 | } | ||
275 | return max- (selection * step); | 285 | return max- (selection * step); |
276 | } | 286 | } |
277 | static char * value_setting_get_name_cb(int selected_item, | 287 | static char * value_setting_get_name_cb(int selected_item, |
@@ -342,32 +352,16 @@ bool option_screen(struct settings_list *setting, | |||
342 | int min = sound_min(setting_id); | 352 | int min = sound_min(setting_id); |
343 | int max = sound_max(setting_id); | 353 | int max = sound_max(setting_id); |
344 | nb_items = (max-min)/steps + 1; | 354 | nb_items = (max-min)/steps + 1; |
345 | if (setting->flags&F_FLIPLIST) | 355 | selected = (max - oldvalue) / steps; |
346 | { | ||
347 | selected = (oldvalue - min) / steps; | ||
348 | } | ||
349 | else | ||
350 | { | ||
351 | selected = (max - oldvalue) / steps; | ||
352 | } | ||
353 | function = sound_get_fn(setting_id); | 356 | function = sound_get_fn(setting_id); |
354 | } | 357 | } |
355 | else | 358 | else |
356 | { | 359 | { |
357 | struct int_setting *info = setting->int_setting; | 360 | struct int_setting *info = setting->int_setting; |
358 | int min, max, step; | 361 | int min, max, step; |
359 | if (setting->flags&F_FLIPLIST) | 362 | max = info->max; |
360 | { | 363 | min = info->min; |
361 | min = info->max; | 364 | step = info->step; |
362 | max = info->min; | ||
363 | step = -info->step; | ||
364 | } | ||
365 | else | ||
366 | { | ||
367 | max = info->max; | ||
368 | min = info->min; | ||
369 | step = info->step; | ||
370 | } | ||
371 | nb_items = (max-min)/step + 1; | 365 | nb_items = (max-min)/step + 1; |
372 | selected = (max - oldvalue)/step; | 366 | selected = (max - oldvalue)/step; |
373 | function = info->option_callback; | 367 | function = info->option_callback; |