forked from len0rd/rockbox
Info screen: charging and battery.
For CHARGING_SIMPLE: if the charger is inserted, then indicate that the battery is charging, and do not show the battery level (which should be bogus anyway). This is the only place the charger status is reported for blind users. Allow reporting charge_state for CHARGING_MONITOR: the header file says it could be CHARGING or TRICKLE. Hope this is right. Interestingly, that's how the #ifdefs were for the voice part. Have the voice match the displayed info. In particular do not report battery level when in a charging state. Use the new talk time unit for the battery remaining duration. If battery_level() is 0 and no info is available, then say "blank" instead of nothing. LANG_BATTERY_CHARGE: more verbose voice entry. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15419 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cd963d84ca
commit
69f88a5c35
2 changed files with 21 additions and 16 deletions
|
@ -8654,7 +8654,7 @@
|
|||
</dest>
|
||||
<voice>
|
||||
*: none
|
||||
charging: "Charging"
|
||||
charging: "Battery: Charging"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
|
|
|
@ -204,7 +204,11 @@ static char* info_getname(int selected_item, void *data, char *buffer)
|
|||
}
|
||||
break;
|
||||
case INFO_BATTERY: /* battery */
|
||||
#if CONFIG_CHARGING == CHARGING_CONTROL
|
||||
#if CONFIG_CHARGING == CHARGING_SIMPLE
|
||||
if (charger_input_state == CHARGER)
|
||||
snprintf(buffer, MAX_PATH, (char *)str(LANG_BATTERY_CHARGE));
|
||||
else
|
||||
#elif CONFIG_CHARGING >= CHARGING_MONITOR
|
||||
if (charge_state == CHARGING)
|
||||
snprintf(buffer, MAX_PATH, (char *)str(LANG_BATTERY_CHARGE));
|
||||
else if (charge_state == TOPOFF)
|
||||
|
@ -284,25 +288,26 @@ static int info_speak_item(int selected_item, void * data)
|
|||
break;
|
||||
}
|
||||
case INFO_BATTERY: /* battery */
|
||||
#if CONFIG_CHARGING == CHARGING_SIMPLE
|
||||
if (charger_input_state == CHARGER)
|
||||
talk_id(LANG_BATTERY_CHARGE, true);
|
||||
else
|
||||
#elif CONFIG_CHARGING >= CHARGING_MONITOR
|
||||
if (charge_state == CHARGING)
|
||||
talk_id(LANG_BATTERY_CHARGE, true);
|
||||
else if (charge_state == TOPOFF)
|
||||
talk_id(LANG_BATTERY_TOPOFF_CHARGE, true);
|
||||
else if (charge_state == TRICKLE)
|
||||
talk_id(LANG_BATTERY_TRICKLE_CHARGE, true);
|
||||
else
|
||||
#endif
|
||||
if (battery_level() >= 0)
|
||||
{
|
||||
talk_id(LANG_BATTERY_TIME, false);
|
||||
talk_value(battery_level(), UNIT_PERCENT, true);
|
||||
if(battery_time () / 60 > 0)
|
||||
talk_value(battery_time () / 60, UNIT_INT, true);
|
||||
if(battery_time () % 60 > 0)
|
||||
talk_value(battery_time () % 60, UNIT_INT, true);
|
||||
#if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||
if (charge_state == CHARGING)
|
||||
talk_id(LANG_BATTERY_CHARGE, true);
|
||||
#if CONFIG_CHARGING == CHARGING_CONTROL
|
||||
else if (charge_state == TOPOFF)
|
||||
talk_id(LANG_BATTERY_TOPOFF_CHARGE, true);
|
||||
#endif
|
||||
else if (charge_state == TRICKLE)
|
||||
talk_id(LANG_BATTERY_TRICKLE_CHARGE, true);
|
||||
#endif
|
||||
talk_value(battery_time() *60, UNIT_TIME, true);
|
||||
}
|
||||
else talk_id(VOICE_BLANK, false);
|
||||
break;
|
||||
case INFO_DISK1: /* disk 1 */
|
||||
#ifdef HAVE_MULTIVOLUME
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue