mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
Info screen fixups:
* Shortened the voice entry for external disk names. * Deprecated LANG_CURRENT_TIME which is not used anywhere. * Before there were CRLFs, then there were blank lines, cleaned that up. * Removed extra format specifier and args in the snprintf for MMC NOT_PRESENT. * Made the voice info about disks match more closely what is displayed: basically, speak disk size for multi-volume case as well. * Not too sure about the reordering, so I did NOT touch that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15415 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a042c720c3
commit
f6b404bd73
2 changed files with 23 additions and 34 deletions
|
|
@ -6962,8 +6962,8 @@
|
|||
</dest>
|
||||
<voice>
|
||||
*: none
|
||||
e200,c200: "micro Secure Digital card:"
|
||||
ondio*: "Multimedia card"
|
||||
e200,c200: "micro S D"
|
||||
ondio*: "M M C"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
|
|
@ -6996,16 +6996,16 @@
|
|||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_CURRENT_TIME
|
||||
desc: in run time screen
|
||||
desc: deprecated
|
||||
user:
|
||||
<source>
|
||||
*: "Current Time"
|
||||
*: ""
|
||||
</source>
|
||||
<dest>
|
||||
*: "Current Time"
|
||||
*: ""
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Current Time"
|
||||
*: ""
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ struct info_data
|
|||
unsigned long free2;
|
||||
#endif
|
||||
};
|
||||
enum infoscreenorder
|
||||
|
||||
enum infoscreenorder
|
||||
{
|
||||
INFO_BATTERY = 0,
|
||||
INFO_DISK1, /* capacity or internal capacity/free on hotswap */
|
||||
|
|
@ -148,13 +147,10 @@ enum infoscreenorder
|
|||
static char* info_getname(int selected_item, void *data, char *buffer)
|
||||
{
|
||||
struct info_data *info = (struct info_data*)data;
|
||||
|
||||
#if CONFIG_RTC
|
||||
struct tm *tm;
|
||||
|
||||
#endif
|
||||
const unsigned char *kbyte_units[] =
|
||||
|
||||
{
|
||||
ID2P(LANG_KILOBYTE),
|
||||
ID2P(LANG_MEGABYTE),
|
||||
|
|
@ -187,16 +183,13 @@ static char* info_getname(int selected_item, void *data, char *buffer)
|
|||
snprintf(buffer, MAX_PATH, "%02d:%02d:%02d %s",
|
||||
global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12,
|
||||
tm->tm_min,
|
||||
|
||||
tm->tm_sec,
|
||||
global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A");
|
||||
break;
|
||||
case INFO_DATE:
|
||||
tm = get_time();
|
||||
snprintf(buffer, MAX_PATH, "%s %d %d",
|
||||
|
||||
str(LANG_MONTH_JANUARY + tm->tm_mon),
|
||||
|
||||
tm->tm_mday,
|
||||
tm->tm_year+1900);
|
||||
break;
|
||||
|
|
@ -248,8 +241,8 @@ static char* info_getname(int selected_item, void *data, char *buffer)
|
|||
}
|
||||
else
|
||||
{
|
||||
snprintf(buffer, MAX_PATH, "%s %s %s", str(LANG_DISK_NAME_MMC),
|
||||
s1, str(LANG_NOT_PRESENT), s2);
|
||||
snprintf(buffer, MAX_PATH, "%s %s", str(LANG_DISK_NAME_MMC),
|
||||
str(LANG_NOT_PRESENT));
|
||||
}
|
||||
#else
|
||||
output_dyn_value(s1, sizeof s1, info->size, kbyte_units, true);
|
||||
|
|
@ -259,6 +252,7 @@ static char* info_getname(int selected_item, void *data, char *buffer)
|
|||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static int info_speak_item(int selected_item, void * data)
|
||||
{
|
||||
struct info_data *info = (struct info_data*)data;
|
||||
|
|
@ -267,7 +261,6 @@ static int info_speak_item(int selected_item, void * data)
|
|||
ID2P(LANG_MEGABYTE),
|
||||
ID2P(LANG_GIGABYTE)
|
||||
};
|
||||
|
||||
switch (selected_item)
|
||||
{
|
||||
case INFO_VERSION: /* version */
|
||||
|
|
@ -276,26 +269,19 @@ static int info_speak_item(int selected_item, void * data)
|
|||
break;
|
||||
#if CONFIG_RTC
|
||||
case INFO_TIME:
|
||||
|
||||
talk_id(VOICE_CURRENT_TIME, false);
|
||||
talk_time(get_time(), true);
|
||||
break;
|
||||
case INFO_DATE:
|
||||
talk_date(get_time(), true);
|
||||
|
||||
break;
|
||||
#endif
|
||||
case INFO_BUFFER: /* buffer */
|
||||
|
||||
{
|
||||
talk_id(LANG_BUFFER_STAT, false);
|
||||
|
||||
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
|
||||
|
||||
output_dyn_value(NULL, 0, buflen, kbyte_units, true);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
case INFO_BATTERY: /* battery */
|
||||
if (battery_level() >= 0)
|
||||
|
|
@ -319,25 +305,28 @@ static int info_speak_item(int selected_item, void * data)
|
|||
}
|
||||
break;
|
||||
case INFO_DISK1: /* disk 1 */
|
||||
talk_id(LANG_DISK_FREE_INFO, false);
|
||||
#ifdef HAVE_MULTIVOLUME
|
||||
talk_id(LANG_DISK_NAME_INTERNAL, true);
|
||||
#endif
|
||||
talk_id(LANG_DISK_NAME_INTERNAL, false);
|
||||
talk_id(LANG_DISK_FREE_INFO, true);
|
||||
output_dyn_value(NULL, 0, info->free, kbyte_units, true);
|
||||
talk_id(LANG_DISK_SIZE_INFO, true);
|
||||
output_dyn_value(NULL, 0, info->size, kbyte_units, true);
|
||||
#else
|
||||
talk_id(LANG_DISK_FREE_INFO, false);
|
||||
output_dyn_value(NULL, 0, info->free, kbyte_units, true);
|
||||
#endif
|
||||
break;
|
||||
case INFO_DISK2: /* disk 2 */
|
||||
#ifdef HAVE_MULTIVOLUME
|
||||
talk_id(LANG_DISK_NAME_MMC, false);
|
||||
if (info->size2)
|
||||
{
|
||||
talk_id(LANG_DISK_FREE_INFO, false);
|
||||
talk_id(LANG_DISK_NAME_MMC, true);
|
||||
talk_id(LANG_DISK_FREE_INFO, true);
|
||||
output_dyn_value(NULL, 0, info->free2, kbyte_units, true);
|
||||
talk_id(LANG_DISK_SIZE_INFO, true);
|
||||
output_dyn_value(NULL, 0, info->size2, kbyte_units, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
talk_id(LANG_DISK_NAME_MMC, false);
|
||||
talk_id(LANG_NOT_PRESENT, true);
|
||||
}
|
||||
else talk_id(LANG_NOT_PRESENT, true);
|
||||
#else
|
||||
talk_id(LANG_DISK_SIZE_INFO, false);
|
||||
output_dyn_value(NULL, 0, info->size, kbyte_units, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue