summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/english.lang382
-rw-r--r--apps/lang/lang.make2
-rw-r--r--apps/plugin.c65
-rw-r--r--apps/plugin.h71
-rw-r--r--apps/plugins/dice.c16
-rw-r--r--apps/plugins/fireworks.c52
-rw-r--r--apps/plugins/lib/playback_control.c16
-rw-r--r--apps/plugins/wavrecord.c22
-rw-r--r--apps/plugins/wormlet.c58
-rw-r--r--apps/talk.c3
-rw-r--r--apps/talk.h6
-rwxr-xr-xtools/genlang23
12 files changed, 583 insertions, 133 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 265fcd6844..7a3b257429 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1255,19 +1255,22 @@
1255</phrase> 1255</phrase>
1256<phrase> 1256<phrase>
1257 id: LANG_DITHERING 1257 id: LANG_DITHERING
1258 desc: in the sound settings menu 1258 desc: in the sound settings and some other menus
1259 user: core 1259 user: core
1260 <source> 1260 <source>
1261 *: none 1261 *: none
1262 swcodec: "Dithering" 1262 swcodec: "Dithering"
1263 lcd_bitmap: "Dithering"
1263 </source> 1264 </source>
1264 <dest> 1265 <dest>
1265 *: none 1266 *: none
1266 swcodec: "Dithering" 1267 swcodec: "Dithering"
1268 lcd_bitmap: "Dithering"
1267 </dest> 1269 </dest>
1268 <voice> 1270 <voice>
1269 *: none 1271 *: none
1270 swcodec: "Dithering" 1272 swcodec: "Dithering"
1273 lcd_bitmap: "Dithering"
1271 </voice> 1274 </voice>
1272</phrase> 1275</phrase>
1273<phrase> 1276<phrase>
@@ -8259,7 +8262,7 @@
8259 *: "Incompatible model" 8262 *: "Incompatible model"
8260 </dest> 8263 </dest>
8261 <voice> 8264 <voice>
8262 *: "" 8265 *: "Incompatible model"
8263 </voice> 8266 </voice>
8264</phrase> 8267</phrase>
8265<phrase> 8268<phrase>
@@ -8273,7 +8276,7 @@
8273 *: "Incompatible version" 8276 *: "Incompatible version"
8274 </dest> 8277 </dest>
8275 <voice> 8278 <voice>
8276 *: "" 8279 *: "Incompatible version"
8277 </voice> 8280 </voice>
8278</phrase> 8281</phrase>
8279<phrase> 8282<phrase>
@@ -8287,7 +8290,7 @@
8287 *: "Plugin returned error" 8290 *: "Plugin returned error"
8288 </dest> 8291 </dest>
8289 <voice> 8292 <voice>
8290 *: "" 8293 *: "Plugin returned error"
8291 </voice> 8294 </voice>
8292</phrase> 8295</phrase>
8293<phrase> 8296<phrase>
@@ -14051,3 +14054,374 @@
14051 pitchscreen: "Time stretch" 14054 pitchscreen: "Time stretch"
14052 </voice> 14055 </voice>
14053</phrase> 14056</phrase>
14057<phrase>
14058 id: LANG_REMOTE_CONTROL
14059 desc: Item for menus
14060 user: core
14061 <source>
14062 *: "Remote Control"
14063 </source>
14064 <dest>
14065 *: "Remote Control"
14066 </dest>
14067 <voice>
14068 *: "Remote Control"
14069 </voice>
14070</phrase>
14071<phrase>
14072 id: LANG_NO_REM_CONTROL
14073 desc: Item for menus
14074 user: core
14075 <source>
14076 *: "No Rem. Control"
14077 </source>
14078 <dest>
14079 *: "No Rem. Control"
14080 </dest>
14081 <voice>
14082 *: "No Remote Control"
14083 </voice>
14084</phrase>
14085<phrase>
14086 id: LANG_OUT_OF_CONTROL
14087 desc: Item for menus
14088 user: core
14089 <source>
14090 *: "Out of Control"
14091 </source>
14092 <dest>
14093 *: "Out of Control"
14094 </dest>
14095 <voice>
14096 *: "Out of Control"
14097 </voice>
14098</phrase>
14099<phrase>
14100 id: LANG_2_KEY_CONTROL
14101 desc: Item for menus
14102 user: core
14103 <source>
14104 *: "2 Key Control"
14105 </source>
14106 <dest>
14107 *: "2 Key Control"
14108 </dest>
14109 <voice>
14110 *: "2 Key Control"
14111 </voice>
14112</phrase>
14113<phrase>
14114 id: LANG_4_KEY_CONTROL
14115 desc: Item for menus
14116 user: core
14117 <source>
14118 *: "4 Key Control"
14119 </source>
14120 <dest>
14121 *: "4 Key Control"
14122 </dest>
14123 <voice>
14124 *: "4 Key Control"
14125 </voice>
14126</phrase>
14127<phrase>
14128 id: LANG_PLAY_WORMLET
14129 desc: For wormlet menu
14130 user: core
14131 <source>
14132 *: none
14133 lcd_bitmap: "Play Wormlet!"
14134 </source>
14135 <dest>
14136 *: none
14137 lcd_bitmap: "Play Wormlet!"
14138 </dest>
14139 <voice>
14140 *: none
14141 lcd_bitmap: "Play Wormlet!"
14142 </voice>
14143</phrase>
14144<phrase>
14145 id: LANG_NUMBER_OF_WORMS
14146 desc: For wormlet menu
14147 user: core
14148 <source>
14149 *: none
14150 lcd_bitmap: "Number of Worms"
14151 </source>
14152 <dest>
14153 *: none
14154 lcd_bitmap: "Number of Worms"
14155 </dest>
14156 <voice>
14157 *: none
14158 lcd_bitmap: "Number of Worms"
14159 </voice>
14160</phrase>
14161<phrase>
14162 id: LANG_WORM_GROWTH_PER_FOOD
14163 desc: For wormlet menu
14164 user: core
14165 <source>
14166 *: none
14167 lcd_bitmap: "Worm Growth Per Food"
14168 </source>
14169 <dest>
14170 *: none
14171 lcd_bitmap: "Worm Growth Per Food"
14172 </dest>
14173 <voice>
14174 *: none
14175 lcd_bitmap: "Worm Growth Per Food"
14176 </voice>
14177</phrase>
14178<phrase>
14179 id: LANG_WORM_SPEED
14180 desc: For wormlet menu
14181 user: core
14182 <source>
14183 *: none
14184 lcd_bitmap: "Worm Speed"
14185 </source>
14186 <dest>
14187 *: none
14188 lcd_bitmap: "Worm Speed"
14189 </dest>
14190 <voice>
14191 *: none
14192 lcd_bitmap: "Worm Speed"
14193 </voice>
14194</phrase>
14195<phrase>
14196 id: LANG_ARGHS_PER_FOOD
14197 desc: For wormlet menu
14198 user: core
14199 <source>
14200 *: none
14201 lcd_bitmap: "Arghs Per Food"
14202 </source>
14203 <dest>
14204 *: none
14205 lcd_bitmap: "Arghs Per Food"
14206 </dest>
14207 <voice>
14208 *: none
14209 lcd_bitmap: "Arghs Per Food"
14210 </voice>
14211</phrase>
14212<phrase>
14213 id: LANG_ARGH_SIZE
14214 desc: For wormlet menu
14215 user: core
14216 <source>
14217 *: none
14218 lcd_bitmap: "Argh Size"
14219 </source>
14220 <dest>
14221 *: none
14222 lcd_bitmap: "Argh Size"
14223 </dest>
14224 <voice>
14225 *: none
14226 lcd_bitmap: "Argh Size"
14227 </voice>
14228</phrase>
14229<phrase>
14230 id: LANG_FOOD_SIZE
14231 desc: For wormlet menu
14232 user: core
14233 <source>
14234 *: none
14235 lcd_bitmap: "Food Size"
14236 </source>
14237 <dest>
14238 *: none
14239 lcd_bitmap: "Food Size"
14240 </dest>
14241 <voice>
14242 *: none
14243 lcd_bitmap: "Food Size"
14244 </voice>
14245</phrase>
14246<phrase>
14247 id: LANG_NUMBER_OF_PLAYERS
14248 desc: For game menus
14249 user: core
14250 <source>
14251 *: "Number of Players"
14252 </source>
14253 <dest>
14254 *: "Number of Players"
14255 </dest>
14256 <voice>
14257 *: "Number of Players"
14258 </voice>
14259</phrase>
14260<phrase>
14261 id: LANG_CONTROL_STYLE
14262 desc: In various menus
14263 user: core
14264 <source>
14265 *: "Control Style"
14266 </source>
14267 <dest>
14268 *: "Control Style"
14269 </dest>
14270 <voice>
14271 *: "Control Style"
14272 </voice>
14273</phrase>
14274<phrase>
14275 id: LANG_REVERT_TO_DEFAULT_SETTINGS
14276 desc: In various menus
14277 user: core
14278 <source>
14279 *: "Revert to Default Settings"
14280 </source>
14281 <dest>
14282 *: "Revert to Default Settings"
14283 </dest>
14284 <voice>
14285 *: "Revert to Default Settings"
14286 </voice>
14287</phrase>
14288<phrase>
14289 id: LANG_MENU_QUIT
14290 desc: in various menus
14291 user: core
14292 <source>
14293 *: "Quit"
14294 </source>
14295 <dest>
14296 *: "Quit"
14297 </dest>
14298 <voice>
14299 *: "Quit"
14300 </voice>
14301</phrase>
14302<phrase>
14303 id: LANG_MENU_DISPLAY_OPTIONS
14304 desc: in various menus
14305 user: core
14306 <source>
14307 *: "Display Options"
14308 </source>
14309 <dest>
14310 *: "Display Options"
14311 </dest>
14312 <voice>
14313 *: "Display Options"
14314 </voice>
14315</phrase>
14316<phrase>
14317 id: LANG_PREVTRACK
14318 desc: in playback control menu
14319 user: core
14320 <source>
14321 *: "Previous Track"
14322 </source>
14323 <dest>
14324 *: "Previous Track"
14325 </dest>
14326 <voice>
14327 *: "Previous Track"
14328 </voice>
14329</phrase>
14330<phrase>
14331 id: LANG_PLAYPAUSE
14332 desc: in playback control menu
14333 user: core
14334 <source>
14335 *: "Pause / Play"
14336 </source>
14337 <dest>
14338 *: "Pause / Play"
14339 </dest>
14340 <voice>
14341 *: "Pause / Play"
14342 </voice>
14343</phrase>
14344<phrase>
14345 id: LANG_STOP_PLAYBACK
14346 desc: in playback control menu
14347 user: core
14348 <source>
14349 *: "Stop Playback"
14350 </source>
14351 <dest>
14352 *: "Stop Playback"
14353 </dest>
14354 <voice>
14355 *: "Stop Playback"
14356 </voice>
14357</phrase>
14358<phrase>
14359 id: LANG_NEXTTRACK
14360 desc: in playback control menu
14361 user: core
14362 <source>
14363 *: "Next Track"
14364 </source>
14365 <dest>
14366 *: "Next Track"
14367 </dest>
14368 <voice>
14369 *: "Next Track"
14370 </voice>
14371</phrase>
14372<phrase>
14373 id: LANG_CHANGE_VOLUME
14374 desc: in playback control menu
14375 user: core
14376 <source>
14377 *: "Change Volume"
14378 </source>
14379 <dest>
14380 *: "Change Volume"
14381 </dest>
14382 <voice>
14383 *: "Change Volume"
14384 </voice>
14385</phrase>
14386<phrase>
14387 id: LANG_CHANGE_SHUFFLE_MODE
14388 desc: in playback control menu
14389 user: core
14390 <source>
14391 *: "Shuffle Mode"
14392 </source>
14393 <dest>
14394 *: "Shuffle Mode"
14395 </dest>
14396 <voice>
14397 *: "Shuffle Mode"
14398 </voice>
14399</phrase>
14400<phrase>
14401 id: LANG_CHANGE_REPEAT_MODE
14402 desc: in playback control menu
14403 user: core
14404 <source>
14405 *: "Change Repeat Mode"
14406 </source>
14407 <dest>
14408 *: "Change Repeat Mode"
14409 </dest>
14410 <voice>
14411 *: "Change Repeat Mode"
14412 </voice>
14413</phrase>
14414<phrase>
14415 id: LANG_PLAYBACK_CONTROL
14416 desc: in playback control menu
14417 user: core
14418 <source>
14419 *: "Playback Control"
14420 </source>
14421 <dest>
14422 *: "Playback Control"
14423 </dest>
14424 <voice>
14425 *: "Playback Control"
14426 </voice>
14427</phrase>
diff --git a/apps/lang/lang.make b/apps/lang/lang.make
index cee2456b5d..ee01c5742a 100644
--- a/apps/lang/lang.make
+++ b/apps/lang/lang.make
@@ -42,6 +42,8 @@ $(BUILDDIR)/lang/lang.h: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/featu
42 perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< 42 perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
43$(BUILDDIR)/lang/lang_core.c: $(BUILDDIR)/lang/lang.h 43$(BUILDDIR)/lang/lang_core.c: $(BUILDDIR)/lang/lang.h
44 44
45$(BUILDDIR)/lang_enum.h: $(BUILDDIR)/lang/lang.h
46
45# NOTE: for some weird reasons in GNU make, multi targets rules WITH patterns actually express 47# NOTE: for some weird reasons in GNU make, multi targets rules WITH patterns actually express
46# the fact that the two files are created as the result of one invocation of the rule 48# the fact that the two files are created as the result of one invocation of the rule
47$(BUILDDIR)/%.lng $(BUILDDIR)/%.vstrings: $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features 49$(BUILDDIR)/%.lng $(BUILDDIR)/%.vstrings: $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
diff --git a/apps/plugin.c b/apps/plugin.c
index 97ff7c8c43..7d4199a607 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -176,6 +176,10 @@ static void plugin_check_open_close__exit(void)
176#endif /* HAVE_PLUGIN_CHECK_OPEN_CLOSE */ 176#endif /* HAVE_PLUGIN_CHECK_OPEN_CLOSE */
177 177
178static const struct plugin_api rockbox_api = { 178static const struct plugin_api rockbox_api = {
179 rbversion,
180 &global_settings,
181 &global_status,
182 language_strings,
179 183
180 /* lcd */ 184 /* lcd */
181#ifdef HAVE_LCD_CONTRAST 185#ifdef HAVE_LCD_CONTRAST
@@ -258,6 +262,7 @@ static const struct plugin_api rockbox_api = {
258 bidi_l2v, 262 bidi_l2v,
259#ifdef HAVE_LCD_BITMAP 263#ifdef HAVE_LCD_BITMAP
260 is_diacritic, 264 is_diacritic,
265 get_codepage_name,
261#endif 266#endif
262 font_get_bits, 267 font_get_bits,
263 font_load, 268 font_load,
@@ -268,7 +273,6 @@ static const struct plugin_api rockbox_api = {
268 screen_clear_area, 273 screen_clear_area,
269 gui_scrollbar_draw, 274 gui_scrollbar_draw,
270#endif /* HAVE_LCD_BITMAP */ 275#endif /* HAVE_LCD_BITMAP */
271 get_codepage_name,
272 276
273 backlight_on, 277 backlight_on,
274 backlight_off, 278 backlight_off,
@@ -334,14 +338,16 @@ static const struct plugin_api rockbox_api = {
334 viewportmanager_theme_undo, 338 viewportmanager_theme_undo,
335 viewport_set_fullscreen, 339 viewport_set_fullscreen,
336#endif 340#endif
337 341
338 /* list */ 342 /* list */
339 gui_synclist_init, 343 gui_synclist_init,
340 gui_synclist_set_nb_items, 344 gui_synclist_set_nb_items,
345 gui_synclist_set_voice_callback,
341 gui_synclist_set_icon_callback, 346 gui_synclist_set_icon_callback,
342 gui_synclist_get_nb_items, 347 gui_synclist_get_nb_items,
343 gui_synclist_get_sel_pos, 348 gui_synclist_get_sel_pos,
344 gui_synclist_draw, 349 gui_synclist_draw,
350 gui_synclist_speak_item,
345 gui_synclist_select_item, 351 gui_synclist_select_item,
346 gui_synclist_add_item, 352 gui_synclist_add_item,
347 gui_synclist_del_item, 353 gui_synclist_del_item,
@@ -369,7 +375,7 @@ static const struct plugin_api rockbox_api = {
369 touchscreen_set_mode, 375 touchscreen_set_mode,
370 touchscreen_get_mode, 376 touchscreen_get_mode,
371#endif 377#endif
372 378
373#ifdef HAVE_BUTTON_LIGHT 379#ifdef HAVE_BUTTON_LIGHT
374 buttonlight_set_timeout, 380 buttonlight_set_timeout,
375 buttonlight_off, 381 buttonlight_off,
@@ -421,6 +427,21 @@ static const struct plugin_api rockbox_api = {
421 browse_context_init, 427 browse_context_init,
422 rockbox_browse, 428 rockbox_browse,
423 429
430 /* talking */
431 talk_id,
432 talk_file,
433 talk_file_or_spell,
434 talk_dir_or_spell,
435 talk_number,
436 talk_value,
437 talk_spell,
438 talk_time,
439 talk_date,
440 talk_disable,
441 talk_shutup,
442 talk_force_shutup,
443 talk_force_enqueue_next,
444
424 /* kernel/ system */ 445 /* kernel/ system */
425#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE 446#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE
426 __div0, 447 __div0,
@@ -541,7 +562,7 @@ static const struct plugin_api rockbox_api = {
541 utf8encode, 562 utf8encode,
542 utf8length, 563 utf8length,
543 utf8seek, 564 utf8seek,
544 565
545 /* the buflib memory management library */ 566 /* the buflib memory management library */
546 buflib_init, 567 buflib_init,
547 buflib_available, 568 buflib_available,
@@ -625,6 +646,7 @@ static const struct plugin_api rockbox_api = {
625 mixer_set_frequency, 646 mixer_set_frequency,
626 mixer_get_frequency, 647 mixer_get_frequency,
627 648
649 pcmbuf_fade,
628 system_sound_play, 650 system_sound_play,
629 keyclick_click, 651 keyclick_click,
630#endif /* CONFIG_CODEC == SWCODEC */ 652#endif /* CONFIG_CODEC == SWCODEC */
@@ -676,7 +698,12 @@ static const struct plugin_api rockbox_api = {
676#endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */ 698#endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
677 699
678 /* menu */ 700 /* menu */
701 root_menu_get_options,
679 do_menu, 702 do_menu,
703 root_menu_set_default,
704 root_menu_write_to_cfg,
705 root_menu_load_from_cfg,
706
680 /* statusbars */ 707 /* statusbars */
681 &statusbars, 708 &statusbars,
682 gui_syncstatusbar_draw, 709 gui_syncstatusbar_draw,
@@ -684,10 +711,12 @@ static const struct plugin_api rockbox_api = {
684 /* options */ 711 /* options */
685 get_settings_list, 712 get_settings_list,
686 find_setting, 713 find_setting,
714 settings_save,
687 option_screen, 715 option_screen,
688 set_option, 716 set_option,
689 set_bool_options, 717 set_bool_options,
690 set_int, 718 set_int,
719 set_int_ex,
691 set_bool, 720 set_bool,
692#ifdef HAVE_LCD_COLOR 721#ifdef HAVE_LCD_COLOR
693 set_color, 722 set_color,
@@ -731,17 +760,17 @@ static const struct plugin_api rockbox_api = {
731 plugin_get_buffer, 760 plugin_get_buffer,
732 plugin_get_audio_buffer, /* defined in plugin.c */ 761 plugin_get_audio_buffer, /* defined in plugin.c */
733 plugin_release_audio_buffer, /* defined in plugin.c */ 762 plugin_release_audio_buffer, /* defined in plugin.c */
734 plugin_tsr, /* defined in plugin.c */ 763 plugin_tsr, /* defined in plugin.c */
735 plugin_get_current_filename, 764 plugin_get_current_filename,
765#ifdef PLUGIN_USE_IRAM
766 audio_hard_stop,
767#endif
736#if defined(DEBUG) || defined(SIMULATOR) 768#if defined(DEBUG) || defined(SIMULATOR)
737 debugf, 769 debugf,
738#endif 770#endif
739#ifdef ROCKBOX_HAS_LOGF 771#ifdef ROCKBOX_HAS_LOGF
740 _logf, 772 _logf,
741#endif 773#endif
742 &global_settings,
743 &global_status,
744 talk_disable,
745#if CONFIG_CODEC == SWCODEC 774#if CONFIG_CODEC == SWCODEC
746 codec_thread_do_callback, 775 codec_thread_do_callback,
747 codec_load_file, 776 codec_load_file,
@@ -813,13 +842,6 @@ static const struct plugin_api rockbox_api = {
813 semaphore_release, 842 semaphore_release,
814#endif 843#endif
815 844
816 rbversion,
817 root_menu_get_options,
818 root_menu_set_default,
819 root_menu_write_to_cfg,
820 root_menu_load_from_cfg,
821 settings_save,
822
823 /* new stuff at the end, sort into place next time 845 /* new stuff at the end, sort into place next time
824 the API gets incompatible */ 846 the API gets incompatible */
825}; 847};
@@ -857,7 +879,7 @@ int plugin_load(const char* plugin, const void* parameter)
857 p_hdr = lc_get_header(current_plugin_handle); 879 p_hdr = lc_get_header(current_plugin_handle);
858 880
859 hdr = p_hdr ? &p_hdr->lc_hdr : NULL; 881 hdr = p_hdr ? &p_hdr->lc_hdr : NULL;
860 882
861 883
862 if (hdr == NULL 884 if (hdr == NULL
863 || hdr->magic != PLUGIN_MAGIC 885 || hdr->magic != PLUGIN_MAGIC
@@ -869,14 +891,14 @@ int plugin_load(const char* plugin, const void* parameter)
869 ) 891 )
870 { 892 {
871 lc_close(current_plugin_handle); 893 lc_close(current_plugin_handle);
872 splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL)); 894 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL));
873 return -1; 895 return -1;
874 } 896 }
875 if (hdr->api_version > PLUGIN_API_VERSION 897 if (hdr->api_version > PLUGIN_API_VERSION
876 || hdr->api_version < PLUGIN_MIN_API_VERSION) 898 || hdr->api_version < PLUGIN_MIN_API_VERSION)
877 { 899 {
878 lc_close(current_plugin_handle); 900 lc_close(current_plugin_handle);
879 splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION)); 901 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_VERSION));
880 return -1; 902 return -1;
881 } 903 }
882#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 904#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
@@ -901,18 +923,19 @@ int plugin_load(const char* plugin, const void* parameter)
901 923
902 FOR_NB_SCREENS(i) 924 FOR_NB_SCREENS(i)
903 viewportmanager_theme_enable(i, false, NULL); 925 viewportmanager_theme_enable(i, false, NULL);
904 926
905#ifdef HAVE_TOUCHSCREEN 927#ifdef HAVE_TOUCHSCREEN
906 touchscreen_set_mode(TOUCHSCREEN_BUTTON); 928 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
907#endif 929#endif
908 930
909 /* allow voice to back off if the plugin needs lots of memory */ 931 /* allow voice to back off if the plugin needs lots of memory */
910 talk_buffer_set_policy(TALK_BUFFER_LOOSE); 932 if (!global_settings.talk_menu)
933 talk_buffer_set_policy(TALK_BUFFER_LOOSE);
911 934
912 plugin_check_open_close__enter(); 935 plugin_check_open_close__enter();
913 936
914 int rc = p_hdr->entry_point(parameter); 937 int rc = p_hdr->entry_point(parameter);
915 938
916 tree_unlock_cache(tree_get_context()); 939 tree_unlock_cache(tree_get_context());
917 pop_current_activity(); 940 pop_current_activity();
918 941
diff --git a/apps/plugin.h b/apps/plugin.h
index 868c2a68e3..50f71914e9 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -71,6 +71,9 @@ void* plugin_get_buffer(size_t *buffer_size);
71#include "mp3_playback.h" 71#include "mp3_playback.h"
72#include "root_menu.h" 72#include "root_menu.h"
73#include "talk.h" 73#include "talk.h"
74#ifdef PLUGIN
75#include "lang_enum.h"
76#endif
74#ifdef RB_PROFILE 77#ifdef RB_PROFILE
75#include "profile.h" 78#include "profile.h"
76#endif 79#endif
@@ -160,12 +163,12 @@ void* plugin_get_buffer(size_t *buffer_size);
160#define PLUGIN_MAGIC 0x526F634B /* RocK */ 163#define PLUGIN_MAGIC 0x526F634B /* RocK */
161 164
162/* increase this every time the api struct changes */ 165/* increase this every time the api struct changes */
163#define PLUGIN_API_VERSION 235 166#define PLUGIN_API_VERSION 236
164 167
165/* update this to latest version if a change to the api struct breaks 168/* update this to latest version if a change to the api struct breaks
166 backwards compatibility (and please take the opportunity to sort in any 169 backwards compatibility (and please take the opportunity to sort in any
167 new function which are "waiting" at the end of the function table) */ 170 new function which are "waiting" at the end of the function table) */
168#define PLUGIN_MIN_API_VERSION 235 171#define PLUGIN_MIN_API_VERSION 236
169 172
170/* plugin return codes */ 173/* plugin return codes */
171/* internal returns start at 0x100 to make exit(1..255) work */ 174/* internal returns start at 0x100 to make exit(1..255) work */
@@ -186,9 +189,13 @@ enum plugin_status {
186 version 189 version
187 */ 190 */
188struct plugin_api { 191struct plugin_api {
192 /* let's put these at the top */
193 const char *rbversion;
194 struct user_settings* global_settings;
195 struct system_status *global_status;
196 unsigned char **language_strings;
189 197
190 /* lcd */ 198 /* lcd */
191
192#ifdef HAVE_LCD_CONTRAST 199#ifdef HAVE_LCD_CONTRAST
193 void (*lcd_set_contrast)(int x); 200 void (*lcd_set_contrast)(int x);
194#endif 201#endif
@@ -284,6 +291,7 @@ struct plugin_api {
284 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); 291 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
285#ifdef HAVE_LCD_BITMAP 292#ifdef HAVE_LCD_BITMAP
286 bool (*is_diacritic)(const unsigned short char_code, bool *is_rtl); 293 bool (*is_diacritic)(const unsigned short char_code, bool *is_rtl);
294 const char* (*get_codepage_name)(int cp);
287#endif 295#endif
288 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); 296 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
289 int (*font_load)(const char *path); 297 int (*font_load)(const char *path);
@@ -299,8 +307,6 @@ struct plugin_api {
299 int min_shown, int max_shown, 307 int min_shown, int max_shown,
300 unsigned flags); 308 unsigned flags);
301#endif /* HAVE_LCD_BITMAP */ 309#endif /* HAVE_LCD_BITMAP */
302 const char* (*get_codepage_name)(int cp);
303
304 /* backlight */ 310 /* backlight */
305 /* The backlight_* functions must be present in the API regardless whether 311 /* The backlight_* functions must be present in the API regardless whether
306 * HAVE_BACKLIGHT is defined or not. The reason is that the stock Ondio has 312 * HAVE_BACKLIGHT is defined or not. The reason is that the stock Ondio has
@@ -370,7 +376,7 @@ struct plugin_api {
370 int width, int height); 376 int width, int height);
371#endif 377#endif
372 void (*viewport_set_defaults)(struct viewport *vp, 378 void (*viewport_set_defaults)(struct viewport *vp,
373 const enum screen_type screen); 379 const enum screen_type screen);
374#ifdef HAVE_LCD_BITMAP 380#ifdef HAVE_LCD_BITMAP
375 void (*viewportmanager_theme_enable)(enum screen_type screen, bool enable, 381 void (*viewportmanager_theme_enable)(enum screen_type screen, bool enable,
376 struct viewport *viewport); 382 struct viewport *viewport);
@@ -384,11 +390,13 @@ struct plugin_api {
384 bool scroll_all,int selected_size, 390 bool scroll_all,int selected_size,
385 struct viewport parent[NB_SCREENS]); 391 struct viewport parent[NB_SCREENS]);
386 void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items); 392 void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items);
393 void (*gui_synclist_set_voice_callback)(struct gui_synclist * lists, list_speak_item voice_callback);
387 void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists, 394 void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists,
388 list_get_icon icon_callback); 395 list_get_icon icon_callback);
389 int (*gui_synclist_get_nb_items)(struct gui_synclist * lists); 396 int (*gui_synclist_get_nb_items)(struct gui_synclist * lists);
390 int (*gui_synclist_get_sel_pos)(struct gui_synclist * lists); 397 int (*gui_synclist_get_sel_pos)(struct gui_synclist * lists);
391 void (*gui_synclist_draw)(struct gui_synclist * lists); 398 void (*gui_synclist_draw)(struct gui_synclist * lists);
399 void (*gui_synclist_speak_item)(struct gui_synclist * lists);
392 void (*gui_synclist_select_item)(struct gui_synclist * lists, 400 void (*gui_synclist_select_item)(struct gui_synclist * lists,
393 int item_number); 401 int item_number);
394 void (*gui_synclist_add_item)(struct gui_synclist * lists); 402 void (*gui_synclist_add_item)(struct gui_synclist * lists);
@@ -463,8 +471,6 @@ struct plugin_api {
463 471
464 int (*filetype_get_attr)(const char* file); 472 int (*filetype_get_attr)(const char* file);
465 473
466
467
468 /* dir */ 474 /* dir */
469 DIR * (*opendir)(const char *dirname); 475 DIR * (*opendir)(const char *dirname);
470 int (*closedir)(DIR *dirp); 476 int (*closedir)(DIR *dirp);
@@ -481,6 +487,24 @@ struct plugin_api {
481 const char *root, const char *selected); 487 const char *root, const char *selected);
482 int (*rockbox_browse)(struct browse_context *browse); 488 int (*rockbox_browse)(struct browse_context *browse);
483 489
490 /* talking */
491 int (*talk_id)(int32_t id, bool enqueue);
492 int (*talk_file)(const char *root, const char *dir, const char *file,
493 const char *ext, const long *prefix_ids, bool enqueue);
494 int (*talk_file_or_spell)(const char *dirname, const char* filename,
495 const long *prefix_ids, bool enqueue);
496 int (*talk_dir_or_spell)(const char* filename,
497 const long *prefix_ids, bool enqueue);
498 int (*talk_number)(long n, bool enqueue);
499 int (*talk_value)(long n, int unit, bool enqueue);
500 int (*talk_spell)(const char* spell, bool enqueue);
501 void (*talk_time)(const struct tm *tm, bool enqueue);
502 void (*talk_date)(const struct tm *tm, bool enqueue);
503 void (*talk_disable)(bool disable);
504 void (*talk_shutup)(void);
505 void (*talk_force_shutup)(void);
506 void (*talk_force_enqueue_next)(void);
507
484 /* kernel/ system */ 508 /* kernel/ system */
485#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE 509#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE
486 void (*__div0)(void); 510 void (*__div0)(void);
@@ -716,6 +740,7 @@ struct plugin_api {
716 chan_buffer_hook_fn_type fn); 740 chan_buffer_hook_fn_type fn);
717 void (*mixer_set_frequency)(unsigned int samplerate); 741 void (*mixer_set_frequency)(unsigned int samplerate);
718 unsigned int (*mixer_get_frequency)(void); 742 unsigned int (*mixer_get_frequency)(void);
743 void (*pcmbuf_fade)(bool fade, bool in);
719 void (*system_sound_play)(enum system_sound sound); 744 void (*system_sound_play)(enum system_sound sound);
720 void (*keyclick_click)(bool rawbutton, int action); 745 void (*keyclick_click)(bool rawbutton, int action);
721#endif /* CONFIG_CODEC == SWCODC */ 746#endif /* CONFIG_CODEC == SWCODC */
@@ -773,8 +798,12 @@ struct plugin_api {
773#endif 798#endif
774 799
775 /* menu */ 800 /* menu */
801 struct menu_table *(*root_menu_get_options)(int *nb_options);
776 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected, 802 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected,
777 struct viewport parent[NB_SCREENS], bool hide_theme); 803 struct viewport parent[NB_SCREENS], bool hide_theme);
804 void (*root_menu_set_default)(void* setting, void* defaultval);
805 char* (*root_menu_write_to_cfg)(void* setting, char*buf, int buf_len);
806 void (*root_menu_load_from_cfg)(void* setting, char *value);
778 807
779 /* scroll bar */ 808 /* scroll bar */
780 struct gui_syncstatusbar *statusbars; 809 struct gui_syncstatusbar *statusbars;
@@ -783,6 +812,7 @@ struct plugin_api {
783 /* options */ 812 /* options */
784 const struct settings_list* (*get_settings_list)(int*count); 813 const struct settings_list* (*get_settings_list)(int*count);
785 const struct settings_list* (*find_setting)(const void* variable, int *id); 814 const struct settings_list* (*find_setting)(const void* variable, int *id);
815 int (*settings_save)(void);
786 bool (*option_screen)(const struct settings_list *setting, 816 bool (*option_screen)(const struct settings_list *setting,
787 struct viewport parent[NB_SCREENS], 817 struct viewport parent[NB_SCREENS],
788 bool use_temp_var, unsigned char* option_title); 818 bool use_temp_var, unsigned char* option_title);
@@ -797,6 +827,11 @@ struct plugin_api {
797 const int* variable, void (*function)(int), int step, 827 const int* variable, void (*function)(int), int step,
798 int min, int max, 828 int min, int max,
799 const char* (*formatter)(char*, size_t, int, const char*) ); 829 const char* (*formatter)(char*, size_t, int, const char*) );
830 bool (*set_int_ex)(const unsigned char* string, const char* unit, int voice_unit,
831 const int* variable, void (*function)(int), int step,
832 int min, int max,
833 const char* (*formatter)(char*, size_t, int, const char*) ,
834 int32_t (*get_talk_id)(int, int));
800 bool (*set_bool)(const char* string, const bool* variable ); 835 bool (*set_bool)(const char* string, const bool* variable );
801 836
802#ifdef HAVE_LCD_COLOR 837#ifdef HAVE_LCD_COLOR
@@ -846,15 +881,15 @@ struct plugin_api {
846 void (*plugin_release_audio_buffer)(void); 881 void (*plugin_release_audio_buffer)(void);
847 void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); 882 void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
848 char* (*plugin_get_current_filename)(void); 883 char* (*plugin_get_current_filename)(void);
884#ifdef PLUGIN_USE_IRAM
885 void (*audio_hard_stop)(void);
886#endif
849#if defined(DEBUG) || defined(SIMULATOR) 887#if defined(DEBUG) || defined(SIMULATOR)
850 void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); 888 void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
851#endif 889#endif
852#ifdef ROCKBOX_HAS_LOGF 890#ifdef ROCKBOX_HAS_LOGF
853 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); 891 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
854#endif 892#endif
855 struct user_settings* global_settings;
856 struct system_status *global_status;
857 void (*talk_disable)(bool disable);
858#if CONFIG_CODEC == SWCODEC 893#if CONFIG_CODEC == SWCODEC
859 void (*codec_thread_do_callback)(void (*fn)(void), 894 void (*codec_thread_do_callback)(void (*fn)(void),
860 unsigned int *audio_thread_id); 895 unsigned int *audio_thread_id);
@@ -950,13 +985,6 @@ struct plugin_api {
950 void (*semaphore_release)(struct semaphore *s); 985 void (*semaphore_release)(struct semaphore *s);
951#endif 986#endif
952 987
953 const char *rbversion;
954 struct menu_table *(*root_menu_get_options)(int *nb_options);
955 void (*root_menu_set_default)(void* setting, void* defaultval);
956 char* (*root_menu_write_to_cfg)(void* setting, char*buf, int buf_len);
957 void (*root_menu_load_from_cfg)(void* setting, char *value);
958 int (*settings_save)(void);
959
960 /* new stuff at the end, sort into place next time 988 /* new stuff at the end, sort into place next time
961 the API gets incompatible */ 989 the API gets incompatible */
962}; 990};
@@ -988,6 +1016,13 @@ extern unsigned char plugin_end_addr[];
988#endif /* CONFIG_PLATFORM */ 1016#endif /* CONFIG_PLATFORM */
989#endif /* PLUGIN */ 1017#endif /* PLUGIN */
990 1018
1019/*
1020 * The str() macro/functions is how to access strings that might be
1021 * translated. Use it like str(MACRO) and expect a string to be
1022 * returned!
1023 */
1024#define str(x) language_strings[x]
1025
991int plugin_load(const char* plugin, const void* parameter); 1026int plugin_load(const char* plugin, const void* parameter);
992 1027
993/* defined by the plugin */ 1028/* defined by the plugin */
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 098dd27c8b..622c58d71d 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -51,14 +51,14 @@ static struct dices dice;
51static int sides_index; 51static int sides_index;
52 52
53static struct opt_items nb_sides_option[8] = { 53static struct opt_items nb_sides_option[8] = {
54 { "3", -1 }, 54 { "3", TALK_ID(3, UNIT_INT) },
55 { "4", -1 }, 55 { "4", TALK_ID(4, UNIT_INT) },
56 { "6", -1 }, 56 { "6", TALK_ID(6, UNIT_INT) },
57 { "8", -1 }, 57 { "8", TALK_ID(8, UNIT_INT) },
58 { "10", -1 }, 58 { "10", TALK_ID(10, UNIT_INT) },
59 { "12", -1 }, 59 { "12", TALK_ID(12, UNIT_INT) },
60 { "20", -1 }, 60 { "20", TALK_ID(20, UNIT_INT) },
61 { "100", -1 } 61 { "100", TALK_ID(100, UNIT_INT) }
62}; 62};
63static int nb_sides_values[] = { 3, 4, 6, 8, 10, 12, 20, 100 }; 63static int nb_sides_values[] = { 3, 4, 6, 8, 10, 12, 20, 100 };
64static char *sides_conf[] = {"3", "4", "6", "8", "10", "12", "20", "100" }; 64static char *sides_conf[] = {"3", "4", "6", "8", "10", "12", "20", "100" };
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index 54efaba6ca..d6ca6618cb 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -113,35 +113,35 @@ LCD_RGBPACK(19,10,26) };
113#endif 113#endif
114 114
115static const struct opt_items autofire_delay_settings[15] = { 115static const struct opt_items autofire_delay_settings[15] = {
116 { "Off", -1 }, 116 { STR(LANG_OFF) },
117 { "50ms", -1 }, 117 { "50ms", TALK_ID(50, UNIT_MS) },
118 { "100ms", -1 }, 118 { "100ms", TALK_ID(100, UNIT_MS) },
119 { "200ms", -1 }, 119 { "200ms", TALK_ID(200, UNIT_MS) },
120 { "300ms", -1 }, 120 { "300ms", TALK_ID(300, UNIT_MS) },
121 { "400ms", -1 }, 121 { "400ms", TALK_ID(400, UNIT_MS) },
122 { "500ms", -1 }, 122 { "500ms", TALK_ID(500, UNIT_MS) },
123 { "600ms", -1 }, 123 { "600ms", TALK_ID(600, UNIT_MS) },
124 { "700ms", -1 }, 124 { "700ms", TALK_ID(700, UNIT_MS) },
125 { "800ms", -1 }, 125 { "800ms", TALK_ID(800, UNIT_MS) },
126 { "900ms", -1 }, 126 { "900ms", TALK_ID(900, UNIT_MS) },
127 { "1s", -1 }, 127 { "1s", TALK_ID(1, UNIT_SEC) },
128 { "2s", -1 }, 128 { "2s", TALK_ID(2, UNIT_SEC) },
129 { "3s", -1 }, 129 { "3s", TALK_ID(3, UNIT_SEC) },
130 { "4s", -1 } 130 { "4s", TALK_ID(4, UNIT_SEC) }
131}; 131};
132 132
133int autofire_delay_values[15] = { 133int autofire_delay_values[15] = {
134 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400 }; 134 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400 };
135 135
136static const struct opt_items particle_settings[8] = { 136static const struct opt_items particle_settings[8] = {
137 { "5", -1 }, 137 { "5", TALK_ID(5, UNIT_INT) },
138 { "10", -1 }, 138 { "10", TALK_ID(10, UNIT_INT) },
139 { "15", -1 }, 139 { "15", TALK_ID(15, UNIT_INT) },
140 { "20", -1 }, 140 { "20", TALK_ID(20, UNIT_INT) },
141 { "25", -1 }, 141 { "25", TALK_ID(25, UNIT_INT) },
142 { "30", -1 }, 142 { "30", TALK_ID(30, UNIT_INT) },
143 { "35", -1 }, 143 { "35", TALK_ID(35, UNIT_INT) },
144 { "40", -1 }, 144 { "40", TALK_ID(40, UNIT_INT) },
145}; 145};
146 146
147int particle_values[8] = { 147int particle_values[8] = {
@@ -163,7 +163,7 @@ int particle_life_values[9] = {
163 20, 30, 40, 50, 60, 70, 80, 90, 100 }; 163 20, 30, 40, 50, 60, 70, 80, 90, 100 };
164 164
165static const struct opt_items gravity_settings[4] = { 165static const struct opt_items gravity_settings[4] = {
166 { "Off", -1 }, 166 { STR(LANG_OFF) },
167 { "Weak", -1 }, 167 { "Weak", -1 },
168 { "Moderate", -1 }, 168 { "Moderate", -1 },
169 { "Strong", -1 }, 169 { "Strong", -1 },
@@ -185,8 +185,8 @@ int rocket_values[4] = {
185#else 185#else
186 186
187static const struct opt_items rocket_settings[2] = { 187static const struct opt_items rocket_settings[2] = {
188 { "No", -1 }, 188 { STR(LANG_SET_BOOL_NO) },
189 { "Yes", -1 }, 189 { STR(LANG_SET_BOOL_YES) },
190}; 190};
191int rocket_values[4] = { 191int rocket_values[4] = {
192 1, 0 }; 192 1, 0 };
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c
index 1be234f70f..363033b1f2 100644
--- a/apps/plugins/lib/playback_control.c
+++ b/apps/plugins/lib/playback_control.c
@@ -90,21 +90,21 @@ static bool repeat_mode(void)
90 90
91 return false; 91 return false;
92} 92}
93MENUITEM_FUNCTION(prevtrack_item, 0, "Previous Track", 93MENUITEM_FUNCTION(prevtrack_item, 0, ID2P(LANG_PREVTRACK),
94 prevtrack, NULL, NULL, Icon_NOICON); 94 prevtrack, NULL, NULL, Icon_NOICON);
95MENUITEM_FUNCTION(playpause_item, 0, "Pause / Play", 95MENUITEM_FUNCTION(playpause_item, 0, ID2P(LANG_PLAYPAUSE),
96 play, NULL, NULL, Icon_NOICON); 96 play, NULL, NULL, Icon_NOICON);
97MENUITEM_FUNCTION(stop_item, 0, "Stop Playback", 97MENUITEM_FUNCTION(stop_item, 0, ID2P(LANG_STOP_PLAYBACK),
98 stop, NULL, NULL, Icon_NOICON); 98 stop, NULL, NULL, Icon_NOICON);
99MENUITEM_FUNCTION(nexttrack_item, 0, "Next Track", 99MENUITEM_FUNCTION(nexttrack_item, 0, ID2P(LANG_NEXTTRACK),
100 nexttrack, NULL, NULL, Icon_NOICON); 100 nexttrack, NULL, NULL, Icon_NOICON);
101MENUITEM_FUNCTION(volume_item, 0, "Change Volume", 101MENUITEM_FUNCTION(volume_item, 0, ID2P(LANG_CHANGE_VOLUME),
102 volume, NULL, NULL, Icon_NOICON); 102 volume, NULL, NULL, Icon_NOICON);
103MENUITEM_FUNCTION(shuffle_item, 0, "Enable/Disable Shuffle", 103MENUITEM_FUNCTION(shuffle_item, 0, ID2P(LANG_CHANGE_SHUFFLE_MODE),
104 shuffle, NULL, NULL, Icon_NOICON); 104 shuffle, NULL, NULL, Icon_NOICON);
105MENUITEM_FUNCTION(repeat_mode_item, 0, "Change Repeat Mode", 105MENUITEM_FUNCTION(repeat_mode_item, 0, ID2P(LANG_CHANGE_REPEAT_MODE),
106 repeat_mode, NULL, NULL, Icon_NOICON); 106 repeat_mode, NULL, NULL, Icon_NOICON);
107MAKE_MENU(playback_control_menu, "Playback Control", NULL, Icon_NOICON, 107MAKE_MENU(playback_control_menu, ID2P(LANG_PLAYBACK_CONTROL), NULL, Icon_NOICON,
108 &prevtrack_item, &playpause_item, &stop_item, &nexttrack_item, 108 &prevtrack_item, &playpause_item, &stop_item, &nexttrack_item,
109 &volume_item, &shuffle_item, &repeat_mode_item); 109 &volume_item, &shuffle_item, &repeat_mode_item);
110 110
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c
index f7467b5b5e..23751be041 100644
--- a/apps/plugins/wavrecord.c
+++ b/apps/plugins/wavrecord.c
@@ -3685,19 +3685,19 @@ static int recording_menu(void)
3685 bool done = false; 3685 bool done = false;
3686 3686
3687 static const struct opt_items freqs[9] = { 3687 static const struct opt_items freqs[9] = {
3688 { "8000Hz", -1 }, 3688 { "8000Hz", TALK_ID(8, UNIT_KHZ) },
3689 { "11025Hz", -1 }, 3689 { "11025Hz", TALK_ID(11, UNIT_KHZ) },
3690 { "12000Hz", -1 }, 3690 { "12000Hz", TALK_ID(12, UNIT_KHZ) },
3691 { "16000Hz", -1 }, 3691 { "16000Hz", TALK_ID(16, UNIT_KHZ) },
3692 { "22050Hz", -1 }, 3692 { "22050Hz", TALK_ID(22, UNIT_KHZ) },
3693 { "24000Hz", -1 }, 3693 { "24000Hz", TALK_ID(24, UNIT_KHZ) },
3694 { "32000Hz", -1 }, 3694 { "32000Hz", TALK_ID(32, UNIT_KHZ) },
3695 { "44100Hz", -1 }, 3695 { "44100Hz", TALK_ID(44, UNIT_KHZ) },
3696 { "48000Hz", -1 }, 3696 { "48000Hz", TALK_ID(48, UNIT_KHZ) },
3697 }; 3697 };
3698 static const struct opt_items chans[2] = { 3698 static const struct opt_items chans[2] = {
3699 { "Mono", -1 }, 3699 { STR(LANG_CHANNEL_MONO) },
3700 { "Stereo", -1 }, 3700 { STR(LANG_CHANNEL_STEREO) },
3701 }; 3701 };
3702 static const struct opt_items srcs[WAV_NUM_SRC] = { 3702 static const struct opt_items srcs[WAV_NUM_SRC] = {
3703 { "Line In", -1 }, 3703 { "Line In", -1 },
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 8c12862bdb..9adfc97b81 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -2499,39 +2499,41 @@ enum plugin_status plugin_start(const void* parameter)
2499 /* Setup screen */ 2499 /* Setup screen */
2500 2500
2501 static const struct opt_items noyes[2] = { 2501 static const struct opt_items noyes[2] = {
2502 { "No", -1 }, 2502 { STR(LANG_SET_BOOL_NO) },
2503 { "Yes", -1 }, 2503 { STR(LANG_SET_BOOL_YES) },
2504 }; 2504 };
2505 2505
2506 static const struct opt_items remoteonly_option[1] = { 2506 static const struct opt_items remoteonly_option[1] = {
2507 { "Remote Control", -1 } 2507 { STR(LANG_REMOTE_CONTROL) }
2508 }; 2508 };
2509 2509
2510 static const struct opt_items key24_option[2] = { 2510 static const struct opt_items key24_option[2] = {
2511 { "4 Key Control", -1 }, 2511 { STR(LANG_4_KEY_CONTROL) },
2512 { "2 Key Control", -1 } 2512 { STR(LANG_2_KEY_CONTROL) }
2513 }; 2513 };
2514 2514
2515#ifdef REMOTE 2515#ifdef REMOTE
2516 static const struct opt_items remote_option[2] = { 2516 static const struct opt_items remote_option[2] = {
2517 { "Remote Control", -1 }, 2517 { STR(LANG_REMOTE_CONTROL) },
2518 { "No Rem. Control", -1 } 2518 { STR(LANG_NO_REM_CONTROL) }
2519 }; 2519 };
2520#else 2520#else
2521 static const struct opt_items key2_option[1] = { 2521 static const struct opt_items key2_option[1] = {
2522 { "2 Key Control", -1 } 2522 { STR(LANG_2_KEY_CONTROL) }
2523 }; 2523 };
2524#endif 2524#endif
2525 2525
2526 static const struct opt_items nokey_option[1] = { 2526 static const struct opt_items nokey_option[1] = {
2527 { "Out of Control", -1 } 2527 { STR(LANG_OUT_OF_CONTROL) }
2528 }; 2528 };
2529 2529
2530 MENUITEM_STRINGLIST(menu, "Wormlet Menu", NULL, "Play Wormlet!", 2530 MENUITEM_STRINGLIST(menu, "Wormlet Menu", NULL,
2531 "Number of Worms", "Number of Players", "Control Style", 2531 ID2P(LANG_PLAY_WORMLET), ID2P(LANG_NUMBER_OF_WORMS),
2532 "Worm Growth Per Food","Worm Speed","Arghs Per Food", 2532 ID2P(LANG_NUMBER_OF_PLAYERS), ID2P(LANG_CONTROL_STYLE),
2533 "Argh Size","Food Size","Revert to Default Settings", 2533 ID2P(LANG_WORM_GROWTH_PER_FOOD), ID2P(LANG_WORM_SPEED),
2534 "Playback Control", "Quit"); 2534 ID2P(LANG_ARGHS_PER_FOOD), ID2P(LANG_ARGH_SIZE),
2535 ID2P(LANG_FOOD_SIZE), ID2P(LANG_REVERT_TO_DEFAULT_SETTINGS),
2536 ID2P(LANG_PLAYBACK_CONTROL), ID2P(LANG_MENU_QUIT));
2535 2537
2536 rb->button_clear_queue(); 2538 rb->button_clear_queue();
2537 2539
@@ -2543,7 +2545,7 @@ enum plugin_status plugin_start(const void* parameter)
2543 launch_wormlet(); 2545 launch_wormlet();
2544 break; 2546 break;
2545 case 1: 2547 case 1:
2546 rb->set_int("Number of Worms", "", UNIT_INT, &worm_count, NULL, 2548 rb->set_int(rb->str(LANG_NUMBER_OF_WORMS), "", UNIT_INT, &worm_count, NULL,
2547 1, 1, 3, NULL); 2549 1, 1, 3, NULL);
2548 if (worm_count < players) { 2550 if (worm_count < players) {
2549 worm_count = players; 2551 worm_count = players;
@@ -2551,10 +2553,10 @@ enum plugin_status plugin_start(const void* parameter)
2551 break; 2553 break;
2552 case 2: 2554 case 2:
2553#ifdef MULTIPLAYER 2555#ifdef MULTIPLAYER
2554 rb->set_int("Number of Players", "", UNIT_INT, &players, NULL, 2556 rb->set_int(rb->str(LANG_NUMBER_OF_PLAYERS), "", UNIT_INT, &players, NULL,
2555 1, 0, 4, NULL); 2557 1, 0, 4, NULL);
2556#else 2558#else
2557 rb->set_int("Number of Players", "", UNIT_INT, &players, NULL, 2559 rb->set_int(rb->str(LANG_NUMBER_OF_PLAYERS), "", UNIT_INT, &players, NULL,
2558 1, 0, 2, NULL); 2560 1, 0, 2, NULL);
2559#endif 2561#endif
2560 if (players > worm_count) { 2562 if (players > worm_count) {
@@ -2567,53 +2569,53 @@ enum plugin_status plugin_start(const void* parameter)
2567 case 3: 2569 case 3:
2568 switch(players) { 2570 switch(players) {
2569 case 0: 2571 case 0:
2570 rb->set_option("Control Style",&use_remote,INT, 2572 rb->set_option(rb->str(LANG_CONTROL_STYLE),&use_remote,INT,
2571 nokey_option, 1, NULL); 2573 nokey_option, 1, NULL);
2572 break; 2574 break;
2573 case 1: 2575 case 1:
2574 rb->set_option("Control Style",&use_remote,INT, 2576 rb->set_option(rb->str(LANG_CONTROL_STYLE),&use_remote,INT,
2575 key24_option, 2, NULL); 2577 key24_option, 2, NULL);
2576 break; 2578 break;
2577 case 2: 2579 case 2:
2578#ifdef REMOTE 2580#ifdef REMOTE
2579 rb->set_option("Control Style",&use_remote,INT, 2581 rb->set_option(rb->str(LANG_CONTROL_STYLE),&use_remote,INT,
2580 remote_option, 2, NULL); 2582 remote_option, 2, NULL);
2581#else 2583#else
2582 rb->set_option("Control Style",&use_remote,INT, 2584 rb->set_option(rb->str(LANG_CONTROL_STYLE),&use_remote,INT,
2583 key2_option, 1, NULL); 2585 key2_option, 1, NULL);
2584#endif 2586#endif
2585 break; 2587 break;
2586 case 3: 2588 case 3:
2587 rb->set_option("Control Style",&use_remote,INT, 2589 rb->set_option(rb->str(LANG_CONTROL_STYLE),&use_remote,INT,
2588 remoteonly_option, 1, NULL); 2590 remoteonly_option, 1, NULL);
2589 break; 2591 break;
2590 } 2592 }
2591 break; 2593 break;
2592 case 4: 2594 case 4:
2593 rb->set_int("Worm Growth Per Food", "", UNIT_INT, &worm_food, 2595 rb->set_int(rb->str(LANG_WORM_GROWTH_PER_FOOD), "", UNIT_INT, &worm_food,
2594 NULL, 1, 0, 15, NULL); 2596 NULL, 1, 0, 15, NULL);
2595 break; 2597 break;
2596 case 5: 2598 case 5:
2597 new_setting = 20 - speed; 2599 new_setting = 20 - speed;
2598 rb->set_int("Worm Speed", "", UNIT_INT, &new_setting, 2600 rb->set_int(rb->str(LANG_WORM_SPEED), "", UNIT_INT, &new_setting,
2599 NULL, 1, 0, 20, NULL); 2601 NULL, 1, 0, 20, NULL);
2600 speed = 20 - new_setting; 2602 speed = 20 - new_setting;
2601 break; 2603 break;
2602 case 6: 2604 case 6:
2603 rb->set_int("Arghs Per Food", "", UNIT_INT, &arghs_per_food, 2605 rb->set_int(rb->str(LANG_ARGHS_PER_FOOD), "", UNIT_INT, &arghs_per_food,
2604 NULL, 1, 0, 8, NULL); 2606 NULL, 1, 0, 8, NULL);
2605 break; 2607 break;
2606 case 7: 2608 case 7:
2607 rb->set_int("Argh Size", "", UNIT_INT, &argh_size, 2609 rb->set_int(rb->str(LANG_ARGH_SIZE), "", UNIT_INT, &argh_size,
2608 NULL, 1, 2, 10, NULL); 2610 NULL, 1, 2, 10, NULL);
2609 break; 2611 break;
2610 case 8: 2612 case 8:
2611 rb->set_int("Food Size", "", UNIT_INT, &food_size, 2613 rb->set_int(rb->str(LANG_FOOD_SIZE), "", UNIT_INT, &food_size,
2612 NULL, 1, 2, 10, NULL); 2614 NULL, 1, 2, 10, NULL);
2613 break; 2615 break;
2614 case 9: 2616 case 9:
2615 new_setting = 0; 2617 new_setting = 0;
2616 rb->set_option("Reset Settings?", &new_setting, INT, noyes , 2, NULL); 2618 rb->set_option(rb->str(LANG_RESET), &new_setting, INT, noyes , 2, NULL);
2617 if (new_setting == 1) 2619 if (new_setting == 1)
2618 default_settings(); 2620 default_settings();
2619 break; 2621 break;
diff --git a/apps/talk.c b/apps/talk.c
index de564c0ff0..aa79dd1b33 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -1540,7 +1540,6 @@ void talk_setting(const void *global_settings_variable)
1540} 1540}
1541 1541
1542 1542
1543#if CONFIG_RTC
1544void talk_date(const struct tm *tm, bool enqueue) 1543void talk_date(const struct tm *tm, bool enqueue)
1545{ 1544{
1546 talk_id(LANG_MONTH_JANUARY + tm->tm_mon, enqueue); 1545 talk_id(LANG_MONTH_JANUARY + tm->tm_mon, enqueue);
@@ -1595,8 +1594,6 @@ void talk_time(const struct tm *tm, bool enqueue)
1595 } 1594 }
1596} 1595}
1597 1596
1598#endif /* CONFIG_RTC */
1599
1600bool talk_get_debug_data(struct talk_debug_data *data) 1597bool talk_get_debug_data(struct talk_debug_data *data)
1601{ 1598{
1602 char* p_lang = DEFAULT_VOICE_LANG; /* default */ 1599 char* p_lang = DEFAULT_VOICE_LANG; /* default */
diff --git a/apps/talk.h b/apps/talk.h
index 3070efc61a..c298476b0c 100644
--- a/apps/talk.h
+++ b/apps/talk.h
@@ -107,11 +107,11 @@ int talk_file(const char *root, const char *dir, const char *file,
107/* play file's thumbnail or spell name */ 107/* play file's thumbnail or spell name */
108int talk_file_or_spell(const char *dirname, const char* filename, 108int talk_file_or_spell(const char *dirname, const char* filename,
109 const long *prefix_ids, bool enqueue); 109 const long *prefix_ids, bool enqueue);
110#if CONFIG_CODEC == SWCODEC 110
111/* play dir's thumbnail or spell name */ 111/* play dir's thumbnail or spell name */
112int talk_dir_or_spell(const char* filename, 112int talk_dir_or_spell(const char* filename,
113 const long *prefix_ids, bool enqueue); 113 const long *prefix_ids, bool enqueue);
114#endif 114
115/* play thumbnails for each components of full path, or spell */ 115/* play thumbnails for each components of full path, or spell */
116int talk_fullpath(const char* path, bool enqueue); 116int talk_fullpath(const char* path, bool enqueue);
117int talk_number(long n, bool enqueue); /* say a number */ 117int talk_number(long n, bool enqueue); /* say a number */
@@ -126,10 +126,8 @@ void talk_shutup(void); /* Interrupt voice, as when enqueue is false */
126/* helper function for speaking fractional numbers */ 126/* helper function for speaking fractional numbers */
127void talk_fractional(char *tbuf, int value, int unit); 127void talk_fractional(char *tbuf, int value, int unit);
128 128
129#if CONFIG_RTC
130void talk_time(const struct tm *tm, bool enqueue); 129void talk_time(const struct tm *tm, bool enqueue);
131void talk_date(const struct tm *tm, bool enqueue); 130void talk_date(const struct tm *tm, bool enqueue);
132#endif /* CONFIG_RTC */
133 131
134/* speaks hr, min, sec, ms; unit_idx is lowest or base unit of the time value */ 132/* speaks hr, min, sec, ms; unit_idx is lowest or base unit of the time value */
135int talk_time_intervals(long time, int unit_idx, bool enqueue); 133int talk_time_intervals(long time, int unit_idx, bool enqueue);
diff --git a/tools/genlang b/tools/genlang
index ac49e594d3..d0b0f145ef 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -658,6 +658,20 @@ extern unsigned char *language_strings[];
658/* this contains the concatenation of all strings, separated by \\0 chars */ 658/* this contains the concatenation of all strings, separated by \\0 chars */
659extern const unsigned char core_language_builtin[]; 659extern const unsigned char core_language_builtin[];
660 660
661#include "${prefix}_enum.h"
662
663MOO
664 ;
665
666 close(HFILE_CORE);
667
668 open(HFILE_CORE, ">${prefix}_enum.h") ||
669 die "couldn't create file ${prefix}_enum.h\n";
670
671 print HFILE_CORE <<MOO
672/* This file was automatically generated using genlang */
673#ifndef _LANG_ENUM_H_
674#define _LANG_ENUM_H_
661/* The enum below contains all available strings */ 675/* The enum below contains all available strings */
662enum \{ 676enum \{
663MOO 677MOO
@@ -702,8 +716,13 @@ MOO
702 printf HFILE_CORE (" %s, /* 0x%x */\n", $name, $i); 716 printf HFILE_CORE (" %s, /* 0x%x */\n", $name, $i);
703 } 717 }
704 718
705 # Output end of enum 719 # Output end of lang_enum.h
706 print HFILE_CORE "\n};\n/* end of generated enum list */\n"; 720 print HFILE_CORE <<MOO
721};
722/* end of generated enum list */
723#endif /* _LANG_ENUM_H_ */
724MOO
725 ;
707 726
708 # Output the target phrases for the source file 727 # Output the target phrases for the source file
709 for $i (0 .. $idcount[$users{"core"}]-1) { 728 for $i (0 .. $idcount[$users{"core"}]-1) {