diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2006-09-09 14:53:30 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2006-09-09 14:53:30 +0000 |
commit | 08a3a59ea4cd58cd3f7e0943deb6476f59bfbb7e (patch) | |
tree | 0453ad89697d6f854ed8eac5378cfcd7eaa14a76 /apps | |
parent | 7f800aca161ba94043cbcff621db4e9caba69945 (diff) | |
download | rockbox-08a3a59ea4cd58cd3f7e0943deb6476f59bfbb7e.tar.gz rockbox-08a3a59ea4cd58cd3f7e0943deb6476f59bfbb7e.zip |
Make 'Filename:' on recording screen possible to translate. Also replace some hardcoded values with sizeof.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10908 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 14 | ||||
-rw-r--r-- | apps/recorder/recording.c | 41 |
2 files changed, 35 insertions, 20 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index edf052145c..514f6c540c 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -9792,3 +9792,17 @@ | |||
9792 | *: "kilobits per second" | 9792 | *: "kilobits per second" |
9793 | </voice> | 9793 | </voice> |
9794 | </phrase> | 9794 | </phrase> |
9795 | <phrase> | ||
9796 | id: LANG_SYSFONT_RECORDING_FILENAME | ||
9797 | desc: Filename header in recording screen | ||
9798 | user: | ||
9799 | <source> | ||
9800 | *: "Filename:" | ||
9801 | </source> | ||
9802 | <dest> | ||
9803 | *: "" | ||
9804 | </dest> | ||
9805 | <voice> | ||
9806 | *: "" | ||
9807 | </voice> | ||
9808 | </phrase> | ||
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 118965d496..41af72fefa 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -819,7 +819,7 @@ bool recording_screen(bool no_source) | |||
819 | int filename_offset[NB_SCREENS]; | 819 | int filename_offset[NB_SCREENS]; |
820 | int pm_y[NB_SCREENS]; | 820 | int pm_y[NB_SCREENS]; |
821 | 821 | ||
822 | const unsigned char *byte_units[] = { | 822 | static const unsigned char *byte_units[] = { |
823 | ID2P(LANG_BYTE), | 823 | ID2P(LANG_BYTE), |
824 | ID2P(LANG_KILOBYTE), | 824 | ID2P(LANG_KILOBYTE), |
825 | ID2P(LANG_MEGABYTE), | 825 | ID2P(LANG_MEGABYTE), |
@@ -899,7 +899,7 @@ bool recording_screen(bool no_source) | |||
899 | if (!remote_display_on) | 899 | if (!remote_display_on) |
900 | { | 900 | { |
901 | screens[1].clear_display(); | 901 | screens[1].clear_display(); |
902 | snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); | 902 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
903 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 903 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, |
904 | screens[1].height/(h*2) + 1, buf); | 904 | screens[1].height/(h*2) + 1, buf); |
905 | screens[1].update(); | 905 | screens[1].update(); |
@@ -977,7 +977,7 @@ bool recording_screen(bool no_source) | |||
977 | remote_display_on = false; | 977 | remote_display_on = false; |
978 | screen_update = 1; | 978 | screen_update = 1; |
979 | screens[1].clear_display(); | 979 | screens[1].clear_display(); |
980 | snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); | 980 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
981 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 981 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, |
982 | screens[1].height/(h*2) + 1, buf); | 982 | screens[1].height/(h*2) + 1, buf); |
983 | screens[1].update(); | 983 | screens[1].update(); |
@@ -1384,14 +1384,14 @@ bool recording_screen(bool no_source) | |||
1384 | if ((global_settings.rec_sizesplit) && (global_settings.rec_split_method)) | 1384 | if ((global_settings.rec_sizesplit) && (global_settings.rec_split_method)) |
1385 | { | 1385 | { |
1386 | dmb = dsize/1024/1024; | 1386 | dmb = dsize/1024/1024; |
1387 | snprintf(buf, 32, "%s %dMB", | 1387 | snprintf(buf, sizeof(buf), "%s %dMB", |
1388 | str(LANG_SYSFONT_SPLIT_SIZE), dmb); | 1388 | str(LANG_SYSFONT_SPLIT_SIZE), dmb); |
1389 | } | 1389 | } |
1390 | else | 1390 | else |
1391 | { | 1391 | { |
1392 | hours = seconds / 3600; | 1392 | hours = seconds / 3600; |
1393 | minutes = (seconds - (hours * 3600)) / 60; | 1393 | minutes = (seconds - (hours * 3600)) / 60; |
1394 | snprintf(buf, 32, "%s %02d:%02d:%02d", | 1394 | snprintf(buf, sizeof(buf), "%s %02d:%02d:%02d", |
1395 | str(LANG_SYSFONT_RECORDING_TIME), | 1395 | str(LANG_SYSFONT_RECORDING_TIME), |
1396 | hours, minutes, seconds%60); | 1396 | hours, minutes, seconds%60); |
1397 | } | 1397 | } |
@@ -1401,7 +1401,7 @@ bool recording_screen(bool no_source) | |||
1401 | 1401 | ||
1402 | if(audio_stat & AUDIO_STATUS_PRERECORD) | 1402 | if(audio_stat & AUDIO_STATUS_PRERECORD) |
1403 | { | 1403 | { |
1404 | snprintf(buf, 32, "%s...", str(LANG_SYSFONT_RECORD_PRERECORD)); | 1404 | snprintf(buf, sizeof(buf), "%s...", str(LANG_SYSFONT_RECORD_PRERECORD)); |
1405 | } | 1405 | } |
1406 | else | 1406 | else |
1407 | { | 1407 | { |
@@ -1414,7 +1414,7 @@ bool recording_screen(bool no_source) | |||
1414 | active */ | 1414 | active */ |
1415 | dhours = dseconds / 3600; | 1415 | dhours = dseconds / 3600; |
1416 | dminutes = (dseconds - (dhours * 3600)) / 60; | 1416 | dminutes = (dseconds - (dhours * 3600)) / 60; |
1417 | snprintf(buf, 32, "%s %02d:%02d", | 1417 | snprintf(buf, sizeof(buf), "%s %02d:%02d", |
1418 | str(LANG_SYSFONT_RECORD_TIMESPLIT_REC), | 1418 | str(LANG_SYSFONT_RECORD_TIMESPLIT_REC), |
1419 | dhours, dminutes); | 1419 | dhours, dminutes); |
1420 | } | 1420 | } |
@@ -1423,7 +1423,7 @@ bool recording_screen(bool no_source) | |||
1423 | output_dyn_value(buf2, sizeof buf2, | 1423 | output_dyn_value(buf2, sizeof buf2, |
1424 | num_recorded_bytes, | 1424 | num_recorded_bytes, |
1425 | byte_units, true); | 1425 | byte_units, true); |
1426 | snprintf(buf, 32, "%s %s", | 1426 | snprintf(buf, sizeof(buf), "%s %s", |
1427 | str(LANG_SYSFONT_RECORDING_SIZE), buf2); | 1427 | str(LANG_SYSFONT_RECORDING_SIZE), buf2); |
1428 | } | 1428 | } |
1429 | } | 1429 | } |
@@ -1443,7 +1443,8 @@ bool recording_screen(bool no_source) | |||
1443 | else | 1443 | else |
1444 | strcpy(filename, ""); | 1444 | strcpy(filename, ""); |
1445 | 1445 | ||
1446 | snprintf(buf, 32, "Filename: %s", filename); | 1446 | snprintf(buf, sizeof(buf), "%s %s", |
1447 | str(LANG_SYSFONT_RECORDING_FILENAME), filename); | ||
1447 | screens[i].puts(0, 2, buf); | 1448 | screens[i].puts(0, 2, buf); |
1448 | } | 1449 | } |
1449 | } | 1450 | } |
@@ -1472,7 +1473,7 @@ bool recording_screen(bool no_source) | |||
1472 | update_countdown = 1; | 1473 | update_countdown = 1; |
1473 | } | 1474 | } |
1474 | 1475 | ||
1475 | snprintf(buf, 32, "%s: %s", str(LANG_SYSFONT_VOLUME), | 1476 | snprintf(buf, sizeof(buf), "%s: %s", str(LANG_SYSFONT_VOLUME), |
1476 | fmt_gain(SOUND_VOLUME, | 1477 | fmt_gain(SOUND_VOLUME, |
1477 | global_settings.volume, | 1478 | global_settings.volume, |
1478 | buf2, sizeof(buf2))); | 1479 | buf2, sizeof(buf2))); |
@@ -1492,7 +1493,7 @@ bool recording_screen(bool no_source) | |||
1492 | if(global_settings.rec_source == AUDIO_SRC_MIC) | 1493 | if(global_settings.rec_source == AUDIO_SRC_MIC) |
1493 | { | 1494 | { |
1494 | /* Draw MIC recording gain */ | 1495 | /* Draw MIC recording gain */ |
1495 | snprintf(buf, 32, "%s:%s", str(LANG_SYSFONT_RECORDING_GAIN), | 1496 | snprintf(buf, sizeof(buf), "%s:%s", str(LANG_SYSFONT_RECORDING_GAIN), |
1496 | fmt_gain(SOUND_MIC_GAIN, | 1497 | fmt_gain(SOUND_MIC_GAIN, |
1497 | global_settings.rec_mic_gain, | 1498 | global_settings.rec_mic_gain, |
1498 | buf2, sizeof(buf2))); | 1499 | buf2, sizeof(buf2))); |
@@ -1516,7 +1517,7 @@ bool recording_screen(bool no_source) | |||
1516 | ) | 1517 | ) |
1517 | { | 1518 | { |
1518 | /* Draw LINE or FMRADIO recording gain */ | 1519 | /* Draw LINE or FMRADIO recording gain */ |
1519 | snprintf(buf, 32, "%s:%s", | 1520 | snprintf(buf, sizeof(buf), "%s:%s", |
1520 | str(LANG_SYSFONT_RECORDING_LEFT), | 1521 | str(LANG_SYSFONT_RECORDING_LEFT), |
1521 | fmt_gain(SOUND_LEFT_GAIN, | 1522 | fmt_gain(SOUND_LEFT_GAIN, |
1522 | global_settings.rec_left_gain, | 1523 | global_settings.rec_left_gain, |
@@ -1534,7 +1535,7 @@ bool recording_screen(bool no_source) | |||
1534 | PM_HEIGHT + 3, buf); | 1535 | PM_HEIGHT + 3, buf); |
1535 | } | 1536 | } |
1536 | 1537 | ||
1537 | snprintf(buf, 32, "%s:%s", | 1538 | snprintf(buf, sizeof(buf), "%s:%s", |
1538 | str(LANG_SYSFONT_RECORDING_RIGHT), | 1539 | str(LANG_SYSFONT_RECORDING_RIGHT), |
1539 | fmt_gain(SOUND_RIGHT_GAIN, | 1540 | fmt_gain(SOUND_RIGHT_GAIN, |
1540 | global_settings.rec_right_gain, | 1541 | global_settings.rec_right_gain, |
@@ -1586,25 +1587,25 @@ bool recording_screen(bool no_source) | |||
1586 | } | 1587 | } |
1587 | 1588 | ||
1588 | /************** AGC test info ****************** | 1589 | /************** AGC test info ****************** |
1589 | snprintf(buf, 32, "D:%d U:%d", | 1590 | snprintf(buf, sizeof(buf), "D:%d U:%d", |
1590 | (agc_droptime+2)/5, (agc_risetime+2)/5); | 1591 | (agc_droptime+2)/5, (agc_risetime+2)/5); |
1591 | lcd_putsxy(1, LCD_HEIGHT - 8, buf); | 1592 | lcd_putsxy(1, LCD_HEIGHT - 8, buf); |
1592 | snprintf(buf, 32, "B:%d", | 1593 | snprintf(buf, sizeof(buf), "B:%d", |
1593 | (agc_baltime+2)/5); | 1594 | (agc_baltime+2)/5); |
1594 | lcd_putsxy(LCD_WIDTH/2 + 3, LCD_HEIGHT - 8, buf); | 1595 | lcd_putsxy(LCD_WIDTH/2 + 3, LCD_HEIGHT - 8, buf); |
1595 | ***********************************************/ | 1596 | ***********************************************/ |
1596 | 1597 | ||
1597 | if (cursor == 5) | 1598 | if (cursor == 5) |
1598 | snprintf(buf, 32, "%s: %s", | 1599 | snprintf(buf, sizeof(buf), "%s: %s", |
1599 | str(LANG_RECORDING_AGC_MAXGAIN), | 1600 | str(LANG_RECORDING_AGC_MAXGAIN), |
1600 | fmt_gain(SOUND_LEFT_GAIN, | 1601 | fmt_gain(SOUND_LEFT_GAIN, |
1601 | agc_maxgain, buf2, sizeof(buf2))); | 1602 | agc_maxgain, buf2, sizeof(buf2))); |
1602 | else if (agc_preset == 0) | 1603 | else if (agc_preset == 0) |
1603 | snprintf(buf, 32, "%s: %s", | 1604 | snprintf(buf, sizeof(buf), "%s: %s", |
1604 | str(LANG_RECORDING_AGC_PRESET), | 1605 | str(LANG_RECORDING_AGC_PRESET), |
1605 | agc_preset_str[agc_preset]); | 1606 | agc_preset_str[agc_preset]); |
1606 | else if (global_settings.rec_source == AUDIO_SRC_MIC) | 1607 | else if (global_settings.rec_source == AUDIO_SRC_MIC) |
1607 | snprintf(buf, 32, "%s: %s%s", | 1608 | snprintf(buf, sizeof(buf), "%s: %s%s", |
1608 | str(LANG_RECORDING_AGC_PRESET), | 1609 | str(LANG_RECORDING_AGC_PRESET), |
1609 | agc_preset_str[agc_preset], | 1610 | agc_preset_str[agc_preset], |
1610 | fmt_gain(SOUND_LEFT_GAIN, | 1611 | fmt_gain(SOUND_LEFT_GAIN, |
@@ -1612,7 +1613,7 @@ bool recording_screen(bool no_source) | |||
1612 | global_settings.rec_mic_gain, | 1613 | global_settings.rec_mic_gain, |
1613 | buf2, sizeof(buf2))); | 1614 | buf2, sizeof(buf2))); |
1614 | else | 1615 | else |
1615 | snprintf(buf, 32, "%s: %s%s", | 1616 | snprintf(buf, sizeof(buf), "%s: %s%s", |
1616 | str(LANG_RECORDING_AGC_PRESET), | 1617 | str(LANG_RECORDING_AGC_PRESET), |
1617 | agc_preset_str[agc_preset], | 1618 | agc_preset_str[agc_preset], |
1618 | fmt_gain(SOUND_LEFT_GAIN, | 1619 | fmt_gain(SOUND_LEFT_GAIN, |
@@ -1821,7 +1822,7 @@ bool f2_rec_screen(void) | |||
1821 | str(LANG_SYSFONT_RECORDING_QUALITY)); | 1822 | str(LANG_SYSFONT_RECORDING_QUALITY)); |
1822 | } | 1823 | } |
1823 | 1824 | ||
1824 | snprintf(buf, 32, "%d", global_settings.rec_quality); | 1825 | snprintf(buf, sizeof(buf), "%d", global_settings.rec_quality); |
1825 | FOR_NB_SCREENS(i) | 1826 | FOR_NB_SCREENS(i) |
1826 | { | 1827 | { |
1827 | screens[i].putsxy(0, LCD_HEIGHT/2-h, buf); | 1828 | screens[i].putsxy(0, LCD_HEIGHT/2-h, buf); |