mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
Add a setting to control whether or not to speak the file type (r15506).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15508 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d65f9f15f9
commit
a4f491cac1
6 changed files with 32 additions and 9 deletions
|
|
@ -11462,3 +11462,17 @@
|
|||
*: "Announce Battery Level"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_VOICE_FILETYPE
|
||||
desc: voice settings menu
|
||||
user:
|
||||
<source>
|
||||
*: "Say file type"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Say file type"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Say file type"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
|||
|
|
@ -443,11 +443,12 @@ static int talk_callback(int action,const struct menu_item_ex *this_item)
|
|||
}
|
||||
return action;
|
||||
}
|
||||
MENUITEM_SETTING(talk_filetype_item, &global_settings.talk_filetype, NULL);
|
||||
MENUITEM_SETTING(talk_battery_level_item,
|
||||
&global_settings.talk_battery_level, NULL);
|
||||
MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice,
|
||||
&talk_menu_item, &talk_dir_item, &talk_dir_clip_item,
|
||||
&talk_file_item, &talk_file_clip_item,
|
||||
&talk_file_item, &talk_file_clip_item, &talk_filetype_item,
|
||||
&talk_battery_level_item);
|
||||
/* VOICE MENU */
|
||||
/***********************************/
|
||||
|
|
|
|||
|
|
@ -112,12 +112,12 @@
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define PLUGIN_API_VERSION 87
|
||||
#define PLUGIN_API_VERSION 88
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define PLUGIN_MIN_API_VERSION 87
|
||||
#define PLUGIN_MIN_API_VERSION 88
|
||||
|
||||
/* plugin return codes */
|
||||
enum plugin_status {
|
||||
|
|
|
|||
|
|
@ -529,6 +529,7 @@ struct user_settings
|
|||
bool talk_dir_clip; /* use directory .talk clips */
|
||||
int talk_file; /* voice file mode: 0=off, 1=number, 2=spell */
|
||||
bool talk_file_clip; /* use file .talk clips */
|
||||
bool talk_filetype; /* say file type */
|
||||
bool talk_battery_level;
|
||||
|
||||
/* file browser sorting */
|
||||
|
|
|
|||
|
|
@ -753,6 +753,8 @@ const struct settings_list settings[] = {
|
|||
ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
|
||||
ID2P(LANG_VOICE_SPELL)),
|
||||
OFFON_SETTING(F_TEMPVAR, talk_file_clip, LANG_VOICE_FILE_TALK, false, "talk file clip", NULL),
|
||||
OFFON_SETTING(F_TEMPVAR, talk_filetype, LANG_VOICE_FILETYPE,
|
||||
false, "talk filetype", NULL),
|
||||
OFFON_SETTING(F_TEMPVAR, talk_battery_level,
|
||||
LANG_TALK_BATTERY_LEVEL, false,
|
||||
"Announce Battery Level", NULL),
|
||||
|
|
|
|||
|
|
@ -268,15 +268,19 @@ static int tree_voice_cb(int selected_item, void * data)
|
|||
talk_id(is_dir ? VOICE_DIR : VOICE_FILE, false);
|
||||
talk_number(selected_item+1 - (is_dir ? 0 : local_tc->dirsindir),
|
||||
true);
|
||||
if(!is_dir && *local_tc->dirfilter < NUM_FILTER_MODES)
|
||||
if(global_settings.talk_filetype
|
||||
&& !is_dir && *local_tc->dirfilter < NUM_FILTER_MODES)
|
||||
say_filetype(attr);
|
||||
break;
|
||||
case 2: /* spelled */
|
||||
talk_shutup();
|
||||
if(global_settings.talk_filetype)
|
||||
{
|
||||
if(is_dir)
|
||||
talk_id(VOICE_DIR, true);
|
||||
else if(*local_tc->dirfilter < NUM_FILTER_MODES)
|
||||
say_filetype(attr);
|
||||
}
|
||||
talk_spell(name, true);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1208,6 +1212,7 @@ static int ft_play_dirname(char* name)
|
|||
DEBUGF("Found: %s\n", dirname_mp3_filename);
|
||||
|
||||
talk_file(dirname_mp3_filename, false);
|
||||
if(global_settings.talk_filetype)
|
||||
talk_id(VOICE_DIR, true);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue