Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

talk: Improvements in voicing "years"

* Enhance LANG_VOICED_DATE_FORMAT to distinguish between "numeric year"
and "grouped year" (2020 -> "two thousand twenty" vs "twenty twenty",
respectively)
* Metadata year voicing will now use "numeric year" if specified in
LANG_VOICED_DATE_FORMAT instead of always using grouped year.
* Datetime year voicing respects the format instead of always using
"numeric year"

Change-Id: Icc25da7c36107d3e4e8c70291f87a915e2bcabd3

+20 -10
+4 -4
apps/lang/english-us.lang
··· 14666 14666 user: core 14667 14667 <source> 14668 14668 *: "Press LEFT to cancel." 14669 - android,hifietma*,zenvision: "Press BACK to cancel." 14669 + android,hifietma*: "Press BACK to cancel." 14670 14670 cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." 14671 14671 ihifi760,ihifi960: "Double tap RETURN to cancel." 14672 14672 ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." ··· 14681 14681 </source> 14682 14682 <dest> 14683 14683 *: "Press LEFT to cancel." 14684 - android,hifietma*,zenvision: "Press BACK to cancel." 14684 + android,hifietma*: "Press BACK to cancel." 14685 14685 cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." 14686 14686 ihifi760,ihifi960: "Double tap RETURN to cancel." 14687 14687 ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." ··· 14696 14696 </dest> 14697 14697 <voice> 14698 14698 *: "Press LEFT to cancel." 14699 - android,hifietma*,zenvision: "Press BACK to cancel." 14699 + android,hifietma*: "Press BACK to cancel." 14700 14700 cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." 14701 14701 ihifi760,ihifi960: "Double tap RETURN to cancel." 14702 14702 ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." ··· 15191 15191 </phrase> 15192 15192 <phrase> 15193 15193 id: LANG_VOICED_DATE_FORMAT 15194 - desc: format string for how dates will be read back. Y == 4-digit year, A == month name, m == numeric month, d == numeric day. For example, "AdY" will read "January 21 2021" 15194 + desc: format string for how dates will be read back. Y == 4-digit year (grouped), y == 4-digit year (numeric), A == month name, m == numeric month, d == numeric day. For example, for 2021-01-05, "AdY" will be voiced as "January 5 twenty twenty-one" and "dmy" will be voiced as "5 1 two thousand twenty one 15195 15195 user: core 15196 15196 <source> 15197 15197 *: "dAY"
+1 -1
apps/lang/english.lang
··· 15458 15458 </phrase> 15459 15459 <phrase> 15460 15460 id: LANG_VOICED_DATE_FORMAT 15461 - desc: format string for how dates will be read back. Y == 4-digit year, A == month name, m == numeric month, d == numeric day. For example, "AdY" will read "January 21 2021" 15461 + desc: format string for how dates will be read back. Y == 4-digit year (grouped), y == 4-digit year (numeric), A == month name, m == numeric month, d == numeric day. For example, for 2021-01-05, "AdY" will be voiced as "January 5 twenty twenty-one" and "dmy" will be voiced as "5 1 two thousand twenty one 15462 15462 user: core 15463 15463 <source> 15464 15464 *: "dAY"
+11 -4
apps/screens.c
··· 593 593 if(say_it && val) 594 594 talk_spell(val, true); 595 595 break; 596 - case LANG_ID3_YEAR: 596 + case LANG_ID3_YEAR: { 597 + const char *format = str(LANG_VOICED_DATE_FORMAT); 598 + bool numericyear = strrchr(format, 'y'); 597 599 if (id3->year_string) 598 600 { 599 601 val = id3->year_string; 600 602 if(say_it && val) 601 - say_number_and_spell(val, true); 603 + say_number_and_spell(val, !numericyear); 602 604 } 603 605 else if (id3->year) 604 606 { 605 607 itoa_buf(buffer, buffer_len, id3->year); 606 608 val = buffer; 607 - if(say_it) 608 - talk_value(id3->year, UNIT_DATEYEAR, true); 609 + if(say_it) { 610 + if (numericyear) 611 + talk_number(id3->year, true); 612 + else 613 + talk_value(id3->year, UNIT_DATEYEAR, true); 614 + } 609 615 } 610 616 break; 617 + } 611 618 case LANG_ID3_LENGTH: 612 619 length = info->track_ct > 1 ? id3->length : id3->length / 1000; 613 620
+4 -1
apps/talk.c
··· 1566 1566 1567 1567 for (ptr = format ; *ptr ; ptr++) { 1568 1568 switch(*ptr) { 1569 + case 'y': 1570 + talk_number(1900 + tm->tm_year, true); 1571 + break; 1569 1572 case 'Y': 1570 - talk_number(1900 + tm->tm_year, true); 1573 + talk_year(1900 + tm->tm_year, true); 1571 1574 break; 1572 1575 case 'A': 1573 1576 talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true);