Index: tools/genlang =================================================================== --- tools/genlang (revision 14854) +++ tools/genlang (working copy) @@ -529,6 +529,18 @@ /* this contains the concatenation of all strings, separated by \\0 chars */ extern const unsigned char language_builtin[]; +#include "${prefix}_enum.h" + +MOO + ; + + close(HFILE); + + open(HFILE, ">${prefix}_enum.h") || + die "couldn't create file ${prefix}_enum.h\n"; + + print HFILE < + + id: VOICE_FILES_IN_DIR + desc: in stats plugin + user: + + *: none + + + *: none + + + *: "Files in directory" + + + + id: VOICE_DIRS + desc: in stats plugin + user: + + *: none + + + *: none + + + *: "Directories" + + + + id: VOICE_MUSICFILES +desc: in stats plugin + user: + + *: none + + + *: none + + + *: "Music files" + + + + id: VOICE_LARGESTDIR +desc: in stats plugin + user: + + *: none + + + *: none + + + *: "Largest directory" + + \ No newline at end of file Index: apps/plugins/stats.c =================================================================== --- apps/plugins/stats.c (revision 14854) +++ apps/plugins/stats.c (working copy) @@ -17,6 +17,7 @@ * ****************************************************************************/ #include "plugin.h" +#include "lang_enum.h" PLUGIN_HEADER @@ -99,7 +100,6 @@ rb->snprintf(buf, sizeof(buf), "Dirs: %5d", dirs); prn(buf,1); #endif - rb->lcd_update(); #ifdef HAVE_REMOTE_LCD rb->lcd_remote_update(); @@ -163,6 +163,14 @@ } if (largestdir < files_in_dir) largestdir = files_in_dir; + if (rb->talk_menus_enabled()) + { + rb->talk_value(files_in_dir, UNIT_FILES_IN_DIR, true); + rb->talk_value(files, UNIT_FILES, true); + rb->talk_value(dirs, UNIT_DIRS, true); + rb->talk_value(musicfiles, UNIT_MUSICFILES, true); + rb->talk_value(largestdir, UNIT_LARGESTDIR, true); + } } enum plugin_status plugin_start(struct plugin_api* api, void* parameter) @@ -179,12 +187,16 @@ abort = false; rb->splash(HZ, "Counting..."); + if (rb->talk_menus_enabled()) + rb->talk_id(LANG_COUNTING, true); update_screen(); lasttick = *rb->current_tick; traversedir("", ""); if (abort == true) { rb->splash(HZ, "Aborted"); + if (rb->talk_menus_enabled()) + rb->talk_id(LANG_ABORTED, true); return PLUGIN_OK; } update_screen(); @@ -193,6 +205,8 @@ #endif rb->backlight_on(); rb->splash(HZ, "Done"); + if (rb->talk_menus_enabled()) + rb->talk_id(LANG_DONE, true); update_screen(); button = rb->button_get(true); while (1) { Index: apps/talk.c =================================================================== --- apps/talk.c (revision 14854) +++ apps/talk.c (working copy) @@ -783,6 +783,16 @@ = VOICE_KBIT_PER_SEC, [UNIT_PM_TICK] = VOICE_PM_UNITS_PER_TICK, + [UNIT_FILES_IN_DIR] + = VOICE_FILES_IN_DIR, + [UNIT_FILES] + = LANG_DIR_BROWSER, + [UNIT_DIRS] + = VOICE_DIRS, + [UNIT_MUSICFILES] + = VOICE_MUSICFILES, + [UNIT_LARGESTDIR] + = VOICE_LARGESTDIR, }; #if CONFIG_CODEC != SWCODEC Index: apps/talk.h =================================================================== --- apps/talk.h (revision 14854) +++ apps/talk.h (working copy) @@ -33,6 +33,11 @@ UNIT_MS, /* milliseconds */ UNIT_SEC, /* seconds */ UNIT_MIN, /* minutes */ + UNIT_FILES_IN_DIR, + UNIT_FILES, + UNIT_DIRS, + UNIT_MUSICFILES, + UNIT_LARGESTDIR, UNIT_HOUR, /* hours */ UNIT_KHZ, /* kHz */ UNIT_DB, /* dB, mandatory sign */ @@ -45,7 +50,7 @@ UNIT_KBIT, /* kilobits per sec */ UNIT_PM_TICK, /* peak meter units per tick */ UNIT_LAST /* END MARKER */ -}; + }; #define UNIT_SHIFT (32-5) /* this many bits left from UNIT_xx enum */ Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 14854) +++ apps/plugin.c (working copy) @@ -235,6 +235,18 @@ mkdir, rmdir, + /* talking */ + is_voice_queued, + talk_id, + talk_file, + talk_number, + talk_value, + talk_spell, + talk_menus_enabled, + talk_disable_menus, + talk_enable_menus, + do_shutup, + /* kernel/ system */ PREFIX(sleep), yield, Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 14854) +++ apps/plugin.h (working copy) @@ -324,6 +324,18 @@ int (*mkdir)(const char *name); int (*rmdir)(const char *name); + /* talking */ + bool (*is_voice_queued)(void); /* Are there more voice clips to be spoken? */ + int (*talk_id)(long id, bool enqueue); /* play a voice ID from voicefont */ + int (*talk_file)(const char* filename, bool enqueue); /* play a thumbnail from file */ + int (*talk_number)(long n, bool enqueue); /* say a number */ + int (*talk_value)(long n, int unit, bool enqueue); /* say a numeric value */ + int (*talk_spell)(const char* spell, bool enqueue); /* spell a string */ + bool (*talk_menus_enabled)(void); /* returns true if menus should be voiced */ + void (*talk_disable_menus)(void); /* disable voice menus (temporarily, not persisted) */ + void (*talk_enable_menus)(void); /* re-enable voice menus */ + int (*do_shutup)(void); /* kill voice unconditionally */ + /* kernel/ system */ void (*PREFIX(sleep))(int ticks); void (*yield)(void);