forked from len0rd/rockbox
Ondio: Better disk information (multivolume support).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6408 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dc405cc03f
commit
cb28941c8c
3 changed files with 71 additions and 12 deletions
|
|
@ -3080,4 +3080,16 @@ id: LANG_LCD_REMOTE_MENU
|
||||||
desc: in the display sub menu
|
desc: in the display sub menu
|
||||||
eng: "Remote-LCD Einstellungen"
|
eng: "Remote-LCD Einstellungen"
|
||||||
voice: ""
|
voice: ""
|
||||||
new:
|
new:
|
||||||
|
|
||||||
|
id: LANG_DISK_NAME_INTERNAL
|
||||||
|
desc: in info menu; name for internal disk with multivolume (keep short!)
|
||||||
|
eng: "Int:"
|
||||||
|
voice: "Intern"
|
||||||
|
new: "Int:"
|
||||||
|
|
||||||
|
id: LANG_DISK_NAME_MMC
|
||||||
|
desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
|
||||||
|
eng: "MMC:"
|
||||||
|
voice: "Multimediakarte"
|
||||||
|
new: "MMC:"
|
||||||
|
|
|
||||||
|
|
@ -3074,4 +3074,16 @@ id: LANG_LCD_REMOTE_MENU
|
||||||
desc: in the display sub menu
|
desc: in the display sub menu
|
||||||
eng: "Remote-LCD Settings"
|
eng: "Remote-LCD Settings"
|
||||||
voice: ""
|
voice: ""
|
||||||
new:
|
new:
|
||||||
|
|
||||||
|
id: LANG_DISK_NAME_INTERNAL
|
||||||
|
desc: in info menu; name for internal disk with multivolume (keep short!)
|
||||||
|
eng: "Int:"
|
||||||
|
voice: "Internal"
|
||||||
|
new:
|
||||||
|
|
||||||
|
id: LANG_DISK_NAME_MMC
|
||||||
|
desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
|
||||||
|
eng: "MMC:"
|
||||||
|
voice: "Multimedia card"
|
||||||
|
new:
|
||||||
|
|
|
||||||
|
|
@ -151,15 +151,27 @@ bool show_credits(void)
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
extern bool simulate_usb(void);
|
extern bool simulate_usb(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
#define SIZE_FMT "%s%s"
|
||||||
|
#else
|
||||||
|
#define SIZE_FMT "%s %s"
|
||||||
|
#endif
|
||||||
|
|
||||||
bool show_info(void)
|
bool show_info(void)
|
||||||
{
|
{
|
||||||
char s[32], s2[32];
|
char s[32], s1[32];
|
||||||
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
|
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
|
||||||
int integer, decimal;
|
int integer, decimal;
|
||||||
bool done = false;
|
bool done = false;
|
||||||
int key;
|
int key;
|
||||||
int state = 1;
|
int state = 1;
|
||||||
unsigned long size, free;
|
unsigned long size, free;
|
||||||
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
char s2[32];
|
||||||
|
unsigned long size2 = 0;
|
||||||
|
unsigned long free2 = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
const unsigned char *kbyte_units[] = {
|
const unsigned char *kbyte_units[] = {
|
||||||
ID2P(LANG_KILOBYTE),
|
ID2P(LANG_KILOBYTE),
|
||||||
|
|
@ -168,6 +180,10 @@ bool show_info(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
fat_size( IF_MV2(0,) &size, &free );
|
fat_size( IF_MV2(0,) &size, &free );
|
||||||
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
if (fat_ismounted(1))
|
||||||
|
fat_size( 1, &size2, &free2 );
|
||||||
|
#endif
|
||||||
|
|
||||||
if (global_settings.talk_menu)
|
if (global_settings.talk_menu)
|
||||||
{ /* say whatever is reasonable, no real connection to the screen */
|
{ /* say whatever is reasonable, no real connection to the screen */
|
||||||
|
|
@ -180,7 +196,17 @@ bool show_info(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
talk_id(LANG_DISK_FREE_INFO, enqueue);
|
talk_id(LANG_DISK_FREE_INFO, enqueue);
|
||||||
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
talk_id(LANG_DISK_NAME_INTERNAL, true);
|
||||||
|
output_dyn_value(NULL, 0, free, kbyte_units, true);
|
||||||
|
if (size2)
|
||||||
|
{
|
||||||
|
talk_id(LANG_DISK_NAME_MMC, true);
|
||||||
|
output_dyn_value(NULL, 0, free2, kbyte_units, true);
|
||||||
|
}
|
||||||
|
#else
|
||||||
output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */
|
output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
{
|
{
|
||||||
|
|
@ -217,7 +243,7 @@ bool show_info(void)
|
||||||
integer, decimal);
|
integer, decimal);
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(0, y++, s);
|
lcd_puts(0, y++, s);
|
||||||
|
|
||||||
#ifdef HAVE_CHARGE_CTRL
|
#ifdef HAVE_CHARGE_CTRL
|
||||||
if (charge_state == 1)
|
if (charge_state == 1)
|
||||||
snprintf(s, sizeof(s), str(LANG_BATTERY_CHARGE));
|
snprintf(s, sizeof(s), str(LANG_BATTERY_CHARGE));
|
||||||
|
|
@ -236,21 +262,30 @@ bool show_info(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state & 2) {
|
if (state & 2) {
|
||||||
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
|
||||||
output_dyn_value(s2, sizeof s2, size, kbyte_units, true);
|
output_dyn_value(s2, sizeof s2, size, kbyte_units, true);
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL),
|
||||||
snprintf(s, sizeof s, "%s%s", str(LANG_DISK_SIZE_INFO), s2);
|
s1, s2);
|
||||||
#else
|
#else
|
||||||
snprintf(s, sizeof s, "%s %s", str(LANG_DISK_SIZE_INFO), s2);
|
output_dyn_value(s1, sizeof s1, size, kbyte_units, true);
|
||||||
|
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
|
||||||
#endif
|
#endif
|
||||||
lcd_puts(0, y++, s);
|
lcd_puts(0, y++, s);
|
||||||
|
|
||||||
output_dyn_value(s2, sizeof s2, free, kbyte_units, true);
|
#ifdef HAVE_MULTIVOLUME
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
if (size2) {
|
||||||
snprintf(s, sizeof s, "%s%s", str(LANG_DISK_FREE_INFO), s2);
|
output_dyn_value(s1, sizeof s1, free2, kbyte_units, true);
|
||||||
|
output_dyn_value(s2, sizeof s2, size2, kbyte_units, true);
|
||||||
|
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC),
|
||||||
|
s1, s2);
|
||||||
|
lcd_puts(0, y++, s);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
snprintf(s, sizeof s, "%s %s", str(LANG_DISK_FREE_INFO), s2);
|
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
|
||||||
#endif
|
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1);
|
||||||
lcd_puts(0, y++, s);
|
lcd_puts(0, y++, s);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue