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.

voice: Convert a pile of splashf() messages to be voiced

Basically, this just replaces str(STRID) with ID2P(STRID).

The voiced version of these strings cannot not have any format
specifiers (enforced by the language tooling) and are instead more
generic.

As many of these are error conditions, it is doubly important for
them to be voiced in some way.

There are some places in the code that perform their own voicing
for splash messages (eg the shutdown code); those are left alone.

Change-Id: I7d51af351e8fa5c4beee42fbfc02719f1d6591b8

+29 -29
+1 -1
apps/alarm_menu.c
··· 74 74 talk_value(mins_togo % 60, UNIT_MIN, true); 75 75 talk_force_enqueue_next(); 76 76 } 77 - splashf(HZ*2, str(LANG_ALARM_MOD_TIME_TO_GO), 77 + splashf(HZ*2, ID2P(LANG_ALARM_MOD_TIME_TO_GO), 78 78 mins_togo / 60, mins_togo % 60); 79 79 } else { 80 80 splash(HZ, ID2P(LANG_ALARM_MOD_ERROR));
+6 -6
apps/filetree.c
··· 122 122 } 123 123 cpu_boost(false); 124 124 } 125 - 125 + 126 126 playlist_insert_context_release(&pl_context); 127 127 128 128 tree_unlock_cache(c); ··· 455 455 int current_font_id; 456 456 enum screen_type screen = SCREEN_MAIN; 457 457 #if NB_SCREENS > 1 458 - MENUITEM_STRINGLIST(menu, ID2P(LANG_CUSTOM_FONT), NULL, 458 + MENUITEM_STRINGLIST(menu, ID2P(LANG_CUSTOM_FONT), NULL, 459 459 ID2P(LANG_MAIN_SCREEN), ID2P(LANG_REMOTE_SCREEN)) 460 460 switch (do_menu(&menu, NULL, NULL, false)) 461 461 { ··· 560 560 struct entry* file = tree_get_entry_at(c, c->selected_item); 561 561 if (!file) 562 562 { 563 - splashf(HZ, str(LANG_READ_FAILED), str(LANG_UNKNOWN)); 563 + splashf(HZ, ID2P(LANG_READ_FAILED), str(LANG_UNKNOWN)); 564 564 return rc; 565 565 } 566 566 ··· 602 602 if (!warn_on_pl_erase()) 603 603 break; 604 604 605 - if (global_settings.party_mode && audio_status()) 605 + if (global_settings.party_mode && audio_status()) 606 606 { 607 607 playlist_insert_track(NULL, buf, 608 608 PLAYLIST_INSERT_LAST, true, true); ··· 768 768 file = tree_get_entry_at(c, c->selected_item); 769 769 if (!file) 770 770 { 771 - splashf(HZ, str(LANG_READ_FAILED), str(LANG_UNKNOWN)); 771 + splashf(HZ, ID2P(LANG_READ_FAILED), str(LANG_UNKNOWN)); 772 772 return rc; 773 773 } 774 774 ··· 833 833 extern char lastfile[]; /* from tree.c */ 834 834 char buf[MAX_PATH]; 835 835 int rc = 0; 836 - bool exit_func = false; 836 + bool exit_func = false; 837 837 int i = strlen(c->currdir); 838 838 839 839 /* strip trailing slashes */
+2 -2
apps/gui/skin_engine/skin_parser.c
··· 2173 2173 { 2174 2174 if (success) 2175 2175 { 2176 - splashf(HZ, str(LANG_FONT_LOAD_ERROR), "(no name)"); 2176 + splashf(HZ, ID2P(LANG_FONT_LOAD_ERROR), "(no name)"); 2177 2177 DEBUGF("font %d not specified\n", font_id); 2178 2178 } 2179 2179 success = false; ··· 2198 2198 2199 2199 if (font->id < 0) 2200 2200 { 2201 - splashf(HZ, str(LANG_FONT_LOAD_ERROR), font->name); 2201 + splashf(HZ, ID2P(LANG_FONT_LOAD_ERROR), font->name); 2202 2202 DEBUGF("Unable to load font %d: '%s'\n", font_id, font->name); 2203 2203 font->name = NULL; /* to stop trying to load it again if we fail */ 2204 2204 success = false;
+1 -1
apps/misc.c
··· 222 222 display_count, str(LANG_OFF_ABORT)); 223 223 } 224 224 else 225 - splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), 225 + splashf(0, ID2P(LANG_PLAYLIST_SEARCH_MSG), 226 226 display_count, str(LANG_OFF_ABORT)); 227 227 228 228 if (action_userabort(TIMEOUT_NOBLOCK))
+1 -1
apps/open_plugin.c
··· 348 348 349 349 logf("OP add_path Invalid, *Clearing entry*"); 350 350 if (lang_id != LANG_SHORTCUTS) /* from shortcuts menu */ 351 - splashf(HZ * 2, str(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 351 + splashf(HZ * 2, ID2P(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 352 352 op_clear_entry(op_entry); 353 353 return 0; 354 354 }
+1 -1
apps/playlist.c
··· 684 684 } 685 685 } 686 686 687 - splashf(0, P2STR(fmt), count, str(LANG_OFF_ABORT)); 687 + splashf(0, fmt, count, str(LANG_OFF_ABORT)); 688 688 } 689 689 690 690 /*
+2 -2
apps/playlist_catalog.c
··· 100 100 talk_dir_or_spell(dirbuf, NULL, true); 101 101 talk_force_enqueue_next(); 102 102 } 103 - splashf(HZ*2, str(LANG_CATALOG_NO_DIRECTORY), dirbuf); 103 + splashf(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), dirbuf); 104 104 return -1; 105 105 } 106 106 else { ··· 265 265 talk_id(LANG_PLAYLIST_INSERT_COUNT, true); 266 266 } 267 267 268 - splashf(0, str(LANG_PLAYLIST_INSERT_COUNT), count, str(LANG_OFF_ABORT)); 268 + splashf(0, ID2P(LANG_PLAYLIST_INSERT_COUNT), count, str(LANG_OFF_ABORT)); 269 269 } 270 270 271 271 /* Add specified track into playlist. Callback from directory insert */
+1 -1
apps/playlist_viewer.c
··· 1271 1271 { 1272 1272 if (found_indicies_count != last_found_count) 1273 1273 { 1274 - splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), found_indicies_count, 1274 + splashf(0, ID2P(LANG_PLAYLIST_SEARCH_MSG), found_indicies_count, 1275 1275 str(LANG_OFF_ABORT)); 1276 1276 last_found_count = found_indicies_count; 1277 1277 }
+1 -1
apps/plugins/mikmod/mikmod.c
··· 711 711 rb->talk_value_decimal(MikMod_errno, UNIT_INT, 0, true); 712 712 rb->talk_force_enqueue_next(); 713 713 } 714 - rb->splashf(HZ, rb->str(LANG_ERROR_FORMATSTR), MikMod_strerror(MikMod_errno)); 714 + rb->splashf(HZ, ID2P(LANG_ERROR_FORMATSTR), MikMod_strerror(MikMod_errno)); 715 715 quit = true; 716 716 } 717 717
+2 -2
apps/plugins/open_plugins.c
··· 361 361 plugin = rb->filetype_get_plugin(fattr, buf, sizeof(buf)); 362 362 if (!plugin) 363 363 { 364 - rb->splashf(HZ * 2, rb->str(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 364 + rb->splashf(HZ * 2, ID2P(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 365 365 return 0; 366 366 } 367 367 } ··· 420 420 else 421 421 { 422 422 if (op_entry.lang_id != LANG_SHORTCUTS) 423 - rb->splashf(HZ * 2, rb->str(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 423 + rb->splashf(HZ * 2, ID2P(LANG_OPEN_PLUGIN_NOT_A_PLUGIN), pos); 424 424 return 0; 425 425 } 426 426 }
+1 -1
apps/plugins/vbrfix.c
··· 130 130 rb->talk_force_enqueue_next(); 131 131 } 132 132 133 - rb->splashf(HZ*2, rb->str(LANG_FILE_ERROR), rc); 133 + rb->splashf(HZ*2, ID2P(LANG_FILE_ERROR), rc); 134 134 } 135 135 136 136 static const unsigned char empty_id3_header[] =
+1 -1
apps/radio/presets.c
··· 581 581 frac = freq % 100; 582 582 freq /= 100; 583 583 584 - splashf(0, str(LANG_FM_SCANNING), freq, frac); 584 + splashf(0, ID2P(LANG_FM_SCANNING), freq, frac); 585 585 586 586 if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq)) 587 587 {
+1 -1
apps/root_menu.c
··· 257 257 } 258 258 else 259 259 { 260 - splashf(0, str(LANG_BUILDING_DATABASE), 260 + splashf(0, ID2P(LANG_BUILDING_DATABASE), 261 261 stat->processed_entries); 262 262 } 263 263 }
+7 -7
apps/tagtree.c
··· 1065 1065 { 1066 1066 struct tagcache_search tcs; 1067 1067 1068 - splash(0, str(LANG_CREATING)); 1068 + splash(0, ID2P(LANG_CREATING)); 1069 1069 if (!tagcache_create_changelog(&tcs)) 1070 1070 { 1071 1071 splash(HZ*2, ID2P(LANG_FAILED)); ··· 1872 1872 talk_value(total_count, UNIT_INT, true); 1873 1873 } 1874 1874 1875 - splashf(HZ*4, str(LANG_SHOWDIR_BUFFER_FULL), total_count); 1875 + splashf(HZ*4, ID2P(LANG_SHOWDIR_BUFFER_FULL), total_count); 1876 1876 logf("Too small dir buffer"); 1877 1877 return 0; 1878 1878 } ··· 2012 2012 if (count < 0) 2013 2013 { 2014 2014 if (count != RELOAD_TAGTREE) 2015 - splash(HZ, str(LANG_TAGCACHE_BUSY)); 2015 + splash(HZ, ID2P(LANG_TAGCACHE_BUSY)); 2016 2016 else /* unload and re-init tagtree */ 2017 2017 { 2018 - splash(HZ, str(LANG_WAIT)); 2018 + splash(HZ, ID2P(LANG_WAIT)); 2019 2019 tagtree_unload(c); 2020 2020 if (!initialize_tagtree()) 2021 2021 return 0; ··· 2404 2404 n, slots_remaining); 2405 2405 2406 2406 talk_id(LANG_RANDOM_SHUFFLE_RANDOM_SELECTIVE_SONGS_SUMMARY, true); 2407 - splashf(HZ * 2, str(LANG_RANDOM_SHUFFLE_RANDOM_SELECTIVE_SONGS_SUMMARY), 2407 + splashf(HZ * 2, ID2P(LANG_RANDOM_SHUFFLE_RANDOM_SELECTIVE_SONGS_SUMMARY), 2408 2408 slots_remaining); 2409 2409 } 2410 2410 } ··· 2414 2414 { 2415 2415 if (TIME_AFTER(current_tick, last_tick + HZ/4)) 2416 2416 { 2417 - splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT)); 2417 + splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT)); // XXX not voiced 2418 2418 if (action_userabort(TIMEOUT_NOBLOCK)) 2419 2419 { 2420 2420 exit_loop_now = true; ··· 2592 2592 n = tc->filesindir; 2593 2593 for (i = 0; i < n; i++) 2594 2594 { 2595 - splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT)); 2595 + splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT)); // XXX not voiced 2596 2596 if (TIME_AFTER(current_tick, last_tick + HZ/4)) 2597 2597 { 2598 2598 if (action_userabort(TIMEOUT_NOBLOCK))
+1 -1
apps/talk.c
··· 926 926 if (!load_voicefile_index(filehandle)) 927 927 { 928 928 if (global_settings.talk_menu) 929 - splashf(HZ, str(LANG_READ_FAILED), ".voice"); 929 + splashf(HZ, ID2P(LANG_READ_FAILED), ".voice"); 930 930 goto out; 931 931 } 932 932 /* Now determine the maximum buffer size needed for the voicefile.