Index: rockbox-devel/apps/gui/quickscreen.c
===================================================================
--- rockbox-devel.orig/apps/gui/quickscreen.c
+++ rockbox-devel/apps/gui/quickscreen.c
@@ -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,
@@ -124,6 +126,18 @@ void gui_syncquickscreen_draw(struct gui
gui_quickscreen_draw(qs, &screens[i]);
}
+/* Speak an option's title and current selection */
+void talk_option(struct option_select *opt, bool enqueue)
+{
+ if (global_settings.talk_menu) {
+ talk_id(opt->title_voice_id, enqueue);
+
+ if(opt->items)
+ talk_id(opt->items[opt->option].voice_id, true);
+ else talk_unit(opt->unit_voice_id, opt->option, true);
+ }
+}
+
bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
{
@@ -131,18 +145,22 @@ bool gui_quickscreen_do_button(struct gu
{
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);
@@ -159,6 +177,13 @@ bool gui_syncquickscreen_run(struct gui_
gui_syncquickscreen_draw(qs);
gui_syncstatusbar_draw(&statusbars, true);
action_signalscreenchange();
+ /* 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_QUICK_SCREEN);
+ 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)
@@ -181,6 +206,8 @@ bool gui_syncquickscreen_run(struct gui_
gui_syncstatusbar_draw(&statusbars, false);
}
+ /* Notify that we're exiting this screen */
+ cond_talk_ids_fq(VOICE_OK);
action_signalscreenchange();
return false;
}
Index: rockbox-devel/apps/gui/option_select.h
===================================================================
--- rockbox-devel.orig/apps/gui/option_select.h
+++ rockbox-devel/apps/gui/option_select.h
@@ -27,11 +27,13 @@ typedef void option_formatter(char* dest
struct option_select
{
const char * title;
+ long title_voice_id;
int min_value;
int max_value;
int step;
int option;
const char * extra_string;
+ long unit_voice_id;
/* In the case the option is a number */
option_formatter *formatter;
const struct opt_items * items;
@@ -51,11 +53,13 @@ struct option_select
*/
extern void option_select_init_numeric(struct option_select * opt,
const char * title,
+ long title_voice_id,
int init_value,
int min_value,
int max_value,
int step,
const char * unit,
+ long unit_voice_id,
option_formatter *formatter);
/*
@@ -67,6 +71,7 @@ extern void option_select_init_numeric(s
*/
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: rockbox-devel/apps/gui/option_select.c
===================================================================
--- rockbox-devel.orig/apps/gui/option_select.c
+++ rockbox-devel/apps/gui/option_select.c
@@ -24,19 +24,23 @@
void option_select_init_numeric(struct option_select * opt,
const char * title,
+ long title_voice_id,
int init_value,
int min_value,
int max_value,
int step,
- const char * unit,
+ const char * unit_str,
+ long unit_voice_id,
option_formatter *formatter)
{
opt->title=title;
+ opt->title_voice_id=title_voice_id;
opt->min_value=min_value;
opt->max_value=max_value+1;
opt->option=init_value;
opt->step=step;
- opt->extra_string=unit;
+ opt->extra_string=unit_str;
+ opt->unit_voice_id=unit_voice_id;
opt->formatter=formatter;
opt->items=NULL;
opt->limit_loop=true;
@@ -44,11 +48,13 @@ void option_select_init_numeric(struct o
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: rockbox-devel/apps/screens.c
===================================================================
--- rockbox-devel.orig/apps/screens.c
+++ rockbox-devel/apps/screens.c
@@ -564,17 +564,17 @@ bool quick_screen_quick(int button_enter
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));
Index: rockbox-devel/apps/settings.c
===================================================================
--- rockbox-devel.orig/apps/settings.c
+++ rockbox-devel/apps/settings.c
@@ -1906,17 +1906,17 @@ bool set_bool_options(const char* string
return result;
}
-void talk_unit(int unit, int value)
+void talk_unit(int unit, int value, bool enqueue)
{
if (global_settings.talk_menu)
{
if (unit < UNIT_LAST)
{ /* use the available unit definition */
- talk_value(value, unit, false);
+ talk_value(value, unit, enqueue);
}
else
{ /* say the number, followed by an arbitrary voice ID */
- talk_number(value, false);
+ talk_number(value, enqueue);
talk_id(unit, true);
}
}
@@ -1979,7 +1979,7 @@ bool do_set_setting(const unsigned char*
if (global_settings.talk_menu)
{
if (cb_data->type == INT && !cb_data->options)
- talk_unit(cb_data->voice_unit, *(int*)variable);
+ talk_unit(cb_data->voice_unit, *(int*)variable, false);
else talk_id(cb_data->options[selected].voice_id, false);
}
@@ -2000,7 +2000,7 @@ bool do_set_setting(const unsigned char*
{
value = cb_data->max -
gui_synclist_get_sel_pos(&lists)*cb_data->step;
- talk_unit(cb_data->voice_unit, value);
+ talk_unit(cb_data->voice_unit, value, false);
}
else
{
Index: rockbox-devel/apps/settings.h
===================================================================
--- rockbox-devel.orig/apps/settings.h
+++ rockbox-devel/apps/settings.h
@@ -612,4 +612,6 @@ enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_
/* show path types */
enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
+void talk_unit(int unit, int value, bool enqueue);
+
#endif /* __SETTINGS_H__ */
Index: rockbox-devel/apps/gui/select.c
===================================================================
--- rockbox-devel.orig/apps/gui/select.c
+++ rockbox-devel/apps/gui/select.c
@@ -28,28 +28,34 @@
void gui_select_init_numeric(struct gui_select * select,
const char * title,
+ long title_voice_id,
int init_value,
int min_value,
int max_value,
int step,
const char * unit,
+ long unit_voice_id,
option_formatter *formatter)
{
select->canceled=false;
select->validated=false;
- option_select_init_numeric(&select->options, title, init_value,
- min_value, max_value, step, unit, formatter);
+ option_select_init_numeric(&select->options, title, title_voice_id,
+ init_value,
+ min_value, max_value, step,
+ unit, unit_voice_id, formatter);
}
void gui_select_init_items(struct gui_select * select,
const char * title,
+ long title_voice_id,
int selected,
const struct opt_items * items,
int nb_items)
{
select->canceled=false;
select->validated=false;
- option_select_init_items(&select->options, title, selected, items, nb_items);
+ option_select_init_items(&select->options, title, title_voice_id,
+ selected, items, nb_items);
}
void gui_select_draw(struct gui_select * select, struct screen * display)
Index: rockbox-devel/apps/gui/select.h
===================================================================
--- rockbox-devel.orig/apps/gui/select.h
+++ rockbox-devel/apps/gui/select.h
@@ -43,11 +43,13 @@ struct gui_select
*/
extern void gui_select_init_numeric(struct gui_select * select,
const char * title,
+ long title_id,
int init_value,
int min_value,
int max_value,
int step,
const char * unit,
+ long unit_voice_id,
option_formatter *formatter);
@@ -60,6 +62,7 @@ extern void gui_select_init_numeric(stru
*/
extern void gui_select_init_items(struct gui_select * select,
const char * title,
+ long title_voice_id,
int selected,
const struct opt_items * items,
int nb_items
Index: rockbox-devel/apps/lang/english.lang
===================================================================
--- rockbox-devel.orig/apps/lang/english.lang
+++ rockbox-devel/apps/lang/english.lang
@@ -9996,3 +9996,31 @@
*: "Rockbox ready"
+
+ id: VOICE_QUICK_SCREEN
+ desc: Announces entering the "quick screen"
+ user:
+
+ *: ""
+
+
+ *: ""
+
+
+ *: "Quick screen"
+
+
+
+ id: VOICE_OK
+ desc: On exiting a context, specifically the quick screen
+ user:
+
+ *: ""
+
+
+ *: ""
+
+
+ *: "OK"
+
+