summaryrefslogtreecommitdiffstats
path: root/apps/gui/option_select.c
diff options
context:
space:
mode:
authorPaul Louden <paulthenerd@gmail.com>2008-02-05 09:09:38 +0000
committerPaul Louden <paulthenerd@gmail.com>2008-02-05 09:09:38 +0000
commitf7c938a7b730c2149f93db5c66b1336835e0a81e (patch)
tree4b3c8310dde7fa3b6e83617147a2d01a9579ad15 /apps/gui/option_select.c
parent2b6d35854d656d729968208cf5448db762852d68 (diff)
downloadrockbox-f7c938a7b730c2149f93db5c66b1336835e0a81e.tar.gz
rockbox-f7c938a7b730c2149f93db5c66b1336835e0a81e.zip
(Hopefully) Revert the quickscreen changes. Many fixes need to be made,
and the exact implementation needs discussion. We apologize for the inconvenience and hope to bring an improved quickscreen to you soon. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16224 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/option_select.c')
-rw-r--r--apps/gui/option_select.c63
1 files changed, 48 insertions, 15 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index 5dec9f7216..cb5b6eee36 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -60,7 +60,7 @@ static const char *unit_strings[] =
/* these two vars are needed so arbitrary values can be added to the
TABLE_SETTING settings if the F_ALLOW_ARBITRARY_VALS flag is set */
static int table_setting_oldval = 0, table_setting_array_position = 0;
-char *option_get_valuestring(struct settings_list *setting,
+static char *option_get_valuestring(struct settings_list *setting,
char *buffer, int buf_len,
intptr_t temp_var)
{
@@ -210,21 +210,19 @@ static int option_talk(int selected_item, void * data)
}
return 0;
}
-
-#ifdef HAVE_QUICKSCREEN /* only the quickscreen uses this so far */
-void option_select_next_val(struct settings_list *setting)
+#if 0
+int option_select_next_val(struct settings_list *setting,
+ intptr_t temp_var)
{
int val = 0;
- int *value = setting->setting;
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
{
- *(bool*)value = !*(bool*)value;
- return;
+ val = (bool)temp_var ? 0 : 1;
}
else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
{
- struct int_setting *info = (struct int_setting *)setting->int_setting;
- val = *value + info->step;
+ struct int_setting *info = setting->int_setting;
+ val = (int)temp_var + info->step;
if (val > info->max)
val = info->min;
}
@@ -234,18 +232,53 @@ void option_select_next_val(struct settings_list *setting)
int steps = sound_steps(setting_id);
int min = sound_min(setting_id);
int max = sound_max(setting_id);
- val = *value + steps;
- if (val >= max)
+ val = (int)temp_var + steps;
+ if (val > max)
val = min;
}
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
{
- struct choice_setting *info = (struct choice_setting *)setting->choice_setting;
- val = *value + 1;
- if (val >= info->count)
+ struct choice_setting *info = setting->choice_setting;
+ val = (int)temp_var;
+ if (val > info->count)
val = 0;
}
- *value = val;
+ return val;
+}
+
+int option_select_prev_val(struct settings_list *setting,
+ intptr_t temp_var)
+{
+ int val = 0;
+ if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
+ {
+ val = (bool)temp_var ? 0 : 1;
+ }
+ else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
+ {
+ struct int_setting *info = setting->int_setting;
+ val = (int)temp_var - info->step;
+ if (val < info->min)
+ val = info->max;
+ }
+ else if ((setting->flags & F_T_SOUND) == F_T_SOUND)
+ {
+ int setting_id = setting->sound_setting->setting;
+ int steps = sound_steps(setting_id);
+ int min = sound_min(setting_id);
+ int max = sound_max(setting_id);
+ val = (int)temp_var -+ steps;
+ if (val < min)
+ val = max;
+ }
+ else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
+ {
+ struct choice_setting *info = setting->choice_setting;
+ val = (int)temp_var;
+ if (val < 0)
+ val = info->count - 1;
+ }
+ return val;
}
#endif