forked from len0rd/rockbox
Revert r17345 on jdgordon's request, until we figure out why it crashes my x5.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17346 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dd4e3848b8
commit
49a73ca90f
3 changed files with 15 additions and 42 deletions
|
@ -146,21 +146,24 @@ char *option_get_valuestring(struct settings_list *setting,
|
|||
}
|
||||
return buffer;
|
||||
}
|
||||
void option_talk_value(const struct settings_list *setting, int value, bool enqueue)
|
||||
|
||||
static int option_talk(int selected_item, void * data)
|
||||
{
|
||||
struct settings_list *setting = (struct settings_list *)data;
|
||||
int temp_var = selection_to_val(setting, selected_item);
|
||||
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
|
||||
{
|
||||
bool val = value==1?true:false;
|
||||
bool val = temp_var==1?true:false;
|
||||
talk_id(val? setting->bool_setting->lang_yes :
|
||||
setting->bool_setting->lang_no, enqueue);
|
||||
setting->bool_setting->lang_no, false);
|
||||
}
|
||||
#if 0 /* probably dont need this one */
|
||||
else if ((setting->flags & F_FILENAME) == F_FILENAME)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (((setting->flags & F_INT_SETTING) == F_INT_SETTING) ||
|
||||
((setting->flags & F_TABLE_SETTING) == F_TABLE_SETTING))
|
||||
((setting->flags & F_TABLE_SETTING) == F_TABLE_SETTING))
|
||||
{
|
||||
const struct int_setting *int_info = setting->int_setting;
|
||||
const struct table_setting *tbl_info = setting->table_setting;
|
||||
|
@ -177,9 +180,9 @@ void option_talk_value(const struct settings_list *setting, int value, bool enqu
|
|||
get_talk_id = tbl_info->get_talk_id;
|
||||
}
|
||||
if (get_talk_id)
|
||||
talk_id(get_talk_id((int)value, unit), enqueue);
|
||||
talk_id(get_talk_id((int)temp_var, unit), false);
|
||||
else
|
||||
talk_value((int)value, unit, enqueue);
|
||||
talk_value((int)temp_var, unit, false);
|
||||
}
|
||||
else if ((setting->flags & F_T_SOUND) == F_T_SOUND)
|
||||
{
|
||||
|
@ -191,27 +194,20 @@ void option_talk_value(const struct settings_list *setting, int value, bool enqu
|
|||
talkunit = UNIT_PERCENT;
|
||||
else if (!strcmp(unit, "Hz"))
|
||||
talkunit = UNIT_HERTZ;
|
||||
talk_value((int)value, talkunit, false);
|
||||
talk_value((int)temp_var, talkunit, false);
|
||||
}
|
||||
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
|
||||
{
|
||||
int value = (int)value;
|
||||
int value = (int)temp_var;
|
||||
if (setting->flags & F_CHOICETALKS)
|
||||
{
|
||||
talk_id(setting->choice_setting->talks[value], enqueue);
|
||||
talk_id(setting->choice_setting->talks[value], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
talk_id(P2ID(setting->choice_setting->desc[value]), enqueue);
|
||||
talk_id(P2ID(setting->choice_setting->desc[value]), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int option_talk(int selected_item, void * data)
|
||||
{
|
||||
struct settings_list *setting = (struct settings_list *)data;
|
||||
int temp_var = selection_to_val(setting, selected_item);
|
||||
option_talk_value(setting, temp_var, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,5 +33,4 @@ void option_select_next_val(struct settings_list *setting,
|
|||
char *option_get_valuestring(struct settings_list *setting,
|
||||
char *buffer, int buf_len,
|
||||
intptr_t temp_var);
|
||||
void option_talk_value(const struct settings_list *setting, int value, bool enqueue);
|
||||
#endif /* _GUI_OPTION_SELECT_H_ */
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "viewport.h"
|
||||
#include "audio.h"
|
||||
#include "quickscreen.h"
|
||||
#include "talk.h"
|
||||
|
||||
static struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
|
||||
static struct viewport vp_icons[NB_SCREENS];
|
||||
|
@ -221,15 +220,7 @@ static void gui_quickscreen_draw(struct gui_quickscreen *qs,
|
|||
display->set_viewport(NULL);
|
||||
}
|
||||
|
||||
static int option_value(const struct settings_list *setting)
|
||||
{
|
||||
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
|
||||
{
|
||||
return *(bool*)setting->setting==true?1:0;
|
||||
}
|
||||
else
|
||||
return *(int*)setting->setting;
|
||||
}
|
||||
|
||||
/*
|
||||
* Does the actions associated to the given button if any
|
||||
* - qs : the quickscreen
|
||||
|
@ -258,8 +249,6 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
|
|||
return false;
|
||||
}
|
||||
option_select_next_val((struct settings_list *)qs->items[item], false, true);
|
||||
option_talk_value((struct settings_list *)qs->items[item],
|
||||
option_value((struct settings_list *)qs->items[item]), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -282,17 +271,6 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
|
|||
quickscreen_fix_viewports(qs, &screens[i], &vp[i]);
|
||||
gui_quickscreen_draw(qs, &screens[i], &vp[i]);
|
||||
}
|
||||
talk_id(qs->items[QUICKSCREEN_LEFT]->lang_id, false);
|
||||
option_talk_value(qs->items[QUICKSCREEN_LEFT],
|
||||
option_value(qs->items[QUICKSCREEN_LEFT]), true);
|
||||
|
||||
talk_id(qs->items[QUICKSCREEN_RIGHT]->lang_id, true);
|
||||
option_talk_value(qs->items[QUICKSCREEN_RIGHT],
|
||||
option_value(qs->items[QUICKSCREEN_RIGHT]), true);
|
||||
|
||||
talk_id(qs->items[QUICKSCREEN_BOTTOM]->lang_id, true);
|
||||
option_talk_value(qs->items[QUICKSCREEN_BOTTOM],
|
||||
option_value(qs->items[QUICKSCREEN_BOTTOM]), true);
|
||||
while (true) {
|
||||
button = get_action(CONTEXT_QUICKSCREEN,HZ/5);
|
||||
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue