Index: apps/screens.c
===================================================================
--- apps/screens.c (revision 15011)
+++ apps/screens.c (working copy)
@@ -676,17 +676,17 @@
lcd_setmargins(0, 0);
option_select_init_items(&left_option,
- (char *)str(LANG_SYSFONT_SHUFFLE),
+ (char *)STR(LANG_SYSFONT_SHUFFLE),
bool_to_int(global_settings.playlist_shuffle),
left_items,
2);
option_select_init_items(&bottom_option,
- (char *)str(LANG_SYSFONT_FILTER),
+ (char *)STR(LANG_SYSFONT_FILTER),
global_settings.dirfilter,
bottom_items,
sizeof(bottom_items)/sizeof(struct opt_items));
option_select_init_items(&right_option,
- (char *)str(LANG_SYSFONT_REPEAT),
+ (char *)STR(LANG_SYSFONT_REPEAT),
global_settings.repeat_mode,
right_items,
sizeof(right_items)/sizeof(struct opt_items));
@@ -755,17 +755,17 @@
lcd_setmargins(0, 0);
option_select_init_items(&left_option,
- str(LANG_SYSFONT_SCROLL_BAR),
+ STR(LANG_SYSFONT_SCROLL_BAR),
bool_to_int(global_settings.scrollbar),
onoff_items,
2);
option_select_init_items(&bottom_option,
- str(LANG_SYSFONT_FLIP_DISPLAY),
+ STR(LANG_SYSFONT_FLIP_DISPLAY),
bool_to_int(global_settings.flip_display),
yesno_items,
2);
option_select_init_items(&right_option,
- str(LANG_SYSFONT_STATUS_BAR),
+ STR(LANG_SYSFONT_STATUS_BAR),
bool_to_int(global_settings.statusbar),
onoff_items,
2);
Index: apps/lang/english.lang
===================================================================
--- apps/lang/english.lang (revision 15011)
+++ apps/lang/english.lang (working copy)
@@ -11390,3 +11390,31 @@
lcd_color: "Line Selector Colours"
+
+ id: VOICE_QUICKSCREEN
+ desc: spoken only, Announces entering the "quick screen"
+ user:
+
+ *: ""
+
+
+ *: ""
+
+
+ *: "Quick screen"
+
+
+
+ id: VOICE_OK
+ desc: spoken only, On exiting a context, specifically the quick screen
+ user:
+
+ *: ""
+
+
+ *: ""
+
+
+ *: "OK"
+
+
Index: apps/gui/option_select.c
===================================================================
--- apps/gui/option_select.c (revision 15011)
+++ apps/gui/option_select.c (working copy)
@@ -519,11 +519,13 @@
/* to be replaced */
void option_select_init_items(struct option_select * opt,
const char * title,
+ long title_voice_id,
int selected,
const struct opt_items * items,
int nb_items)
{
opt->title=title;
+ opt->title_voice_id=title_voice_id;
opt->min_value=0;
opt->max_value=nb_items;
opt->option=selected;
Index: apps/gui/option_select.h
===================================================================
--- apps/gui/option_select.h (revision 15011)
+++ apps/gui/option_select.h (working copy)
@@ -27,6 +27,7 @@
struct option_select
{
const char * title;
+ long title_voice_id;
int min_value;
int max_value;
int option;
@@ -42,6 +43,7 @@
*/
extern void option_select_init_items(struct option_select * opt,
const char * title,
+ long title_voice_id,
int selected,
const struct opt_items * items,
int nb_items);
Index: apps/gui/quickscreen.c
===================================================================
--- apps/gui/quickscreen.c (revision 15011)
+++ apps/gui/quickscreen.c (working copy)
@@ -30,6 +30,8 @@
#include "misc.h"
#include "statusbar.h"
#include "action.h"
+#include "lang.h"
+#include "talk.h"
void gui_quickscreen_init(struct gui_quickscreen * qs,
struct option_select *left_option,
@@ -133,6 +135,17 @@
gui_quickscreen_draw(qs, &screens[i]);
}
+/* Speak an option's title and current selection */
+void talk_option(struct option_select *opt, bool enqueue)
+{
+ if (talk_menus_enabled())
+ {
+ talk_id(opt->title_voice_id, enqueue);
+ if(opt->items)
+ talk_id(opt->items[opt->option].voice_id, true);
+ }
+}
+
/*
* Does the actions associated to the given button if any
* - qs : the quickscreen
@@ -146,18 +159,22 @@
{
case ACTION_QS_LEFT:
option_select_next(qs->left_option);
+ talk_option(qs->left_option, false);
return(true);
case ACTION_QS_DOWN:
option_select_next(qs->bottom_option);
+ talk_option(qs->bottom_option, false);
return(true);
case ACTION_QS_RIGHT:
option_select_next(qs->right_option);
+ talk_option(qs->right_option, false);
return(true);
case ACTION_QS_DOWNINV:
option_select_prev(qs->bottom_option);
+ talk_option(qs->bottom_option, false);
return(true);
}
return(false);
@@ -173,6 +190,13 @@
bool can_quit=false;
gui_syncquickscreen_draw(qs);
gui_syncstatusbar_draw(&statusbars, true);
+ /* Announce current selection on entering this screen. This is all
+ queued up, but can be interrupted as soon as a setting is
+ changed. */
+ cond_talk_ids(VOICE_QUICKSCREEN);
+ talk_option(qs->left_option, true);
+ talk_option(qs->bottom_option, true);
+ talk_option(qs->right_option, true);
while (true) {
button = get_action(CONTEXT_QUICKSCREEN,TIMEOUT_BLOCK);
if(default_event_handler(button) == SYS_USB_CONNECTED)
@@ -195,6 +219,8 @@
gui_syncstatusbar_draw(&statusbars, false);
}
+ /* Notify that we're exiting this screen */
+ cond_talk_ids_fq(VOICE_OK);
return false;
}