forked from len0rd/rockbox
Fix for issues in speaking the time in Rockbox Info screen (B#9167).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18309 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9ffc30bec0
commit
50512d696d
2 changed files with 11 additions and 24 deletions
|
|
@ -905,8 +905,6 @@ bool simplelist_show_list(struct simplelist_info *info)
|
||||||
if (info->get_name == NULL)
|
if (info->get_name == NULL)
|
||||||
gui_synclist_set_nb_items(&lists, simplelist_line_count*info->selection_size);
|
gui_synclist_set_nb_items(&lists, simplelist_line_count*info->selection_size);
|
||||||
gui_synclist_draw(&lists);
|
gui_synclist_draw(&lists);
|
||||||
if (action != ACTION_NONE)
|
|
||||||
gui_synclist_speak_item(&lists);
|
|
||||||
old_line_count = simplelist_line_count;
|
old_line_count = simplelist_line_count;
|
||||||
}
|
}
|
||||||
else if(default_event_handler(action) == SYS_USB_CONNECTED)
|
else if(default_event_handler(action) == SYS_USB_CONNECTED)
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,6 @@ static int info_speak_item(int selected_item, void * data)
|
||||||
|
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
static int last_talk = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (selected_item)
|
switch (selected_item)
|
||||||
|
|
@ -300,19 +299,15 @@ static int info_speak_item(int selected_item, void * data)
|
||||||
break;
|
break;
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
case INFO_TIME:
|
case INFO_TIME:
|
||||||
if (TIME_AFTER(current_tick, last_talk + HZ*60))
|
tm = get_time();
|
||||||
|
talk_id(VOICE_CURRENT_TIME, false);
|
||||||
|
if (valid_time(tm))
|
||||||
{
|
{
|
||||||
tm = get_time();
|
talk_time(tm, true);
|
||||||
talk_id(VOICE_CURRENT_TIME, false);
|
}
|
||||||
if (valid_time(tm))
|
else
|
||||||
{
|
{
|
||||||
talk_time(tm, true);
|
talk_id(LANG_UNKNOWN, true);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
talk_id(LANG_UNKNOWN, true);
|
|
||||||
}
|
|
||||||
last_talk = current_tick;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INFO_DATE:
|
case INFO_DATE:
|
||||||
|
|
@ -417,21 +412,15 @@ static int info_action_callback(int action, struct gui_synclist *lists)
|
||||||
|
|
||||||
(void) lists;
|
(void) lists;
|
||||||
#endif
|
#endif
|
||||||
|
gui_synclist_speak_item(lists);
|
||||||
return ACTION_REDRAW;
|
return ACTION_REDRAW;
|
||||||
}
|
}
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
else if (action == ACTION_NONE)
|
else if (action == ACTION_NONE)
|
||||||
{
|
{
|
||||||
if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) ||
|
if (gui_synclist_item_is_onscreen(lists, 0, INFO_TIME))
|
||||||
(!global_settings.talk_menu &&
|
|
||||||
gui_synclist_item_is_onscreen(lists, 0, INFO_TIME)))
|
|
||||||
{
|
{
|
||||||
static int last_redraw = 0;
|
return ACTION_REDRAW;
|
||||||
if (TIME_AFTER(current_tick, last_redraw + HZ*5))
|
|
||||||
{
|
|
||||||
last_redraw = current_tick;
|
|
||||||
return ACTION_REDRAW;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue