summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Doyon <s.doyon@videotron.ca>2007-11-03 04:13:25 +0000
committerStéphane Doyon <s.doyon@videotron.ca>2007-11-03 04:13:25 +0000
commit69f88a5c352ddfcca314560b0bffb8baffdc313a (patch)
tree3d35fc6f165e09956ea5d25d340b79038a97f3ec
parentcd963d84ca5417ee443ea3f1d7cf13040ab9e5e7 (diff)
downloadrockbox-69f88a5c352ddfcca314560b0bffb8baffdc313a.zip
rockbox-69f88a5c352ddfcca314560b0bffb8baffdc313a.tar.gz
rockbox-69f88a5c352ddfcca314560b0bffb8baffdc313a.tar.bz2
rockbox-69f88a5c352ddfcca314560b0bffb8baffdc313a.tar.xz
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
-rw-r--r--apps/lang/english.lang2
-rw-r--r--apps/menus/main_menu.c35
2 files changed, 21 insertions, 16 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 97111a1..91fb290 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -8654,7 +8654,7 @@
</dest>
<voice>
*: none
- charging: "Charging"
+ charging: "Battery: Charging"
</voice>
</phrase>
<phrase>
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 0a86d1f..ddc2689 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -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