Index: trunk/apps/playlist_catalog.c =================================================================== --- trunk.orig/apps/playlist_catalog.c +++ trunk/apps/playlist_catalog.c @@ -38,6 +38,7 @@ #include "tree.h" #include "yesno.h" #include "filetypes.h" +#include "talk.h" #define PLAYLIST_CATALOG_CFG ROCKBOX_DIR "/playlist_catalog.config" #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists" @@ -113,7 +114,12 @@ static int initialize_catalog(void) if (!playlist_dir_exists) { if (mkdir(playlist_dir) < 0) { - gui_syncsplash(HZ*2, str(LANG_CATALOG_NO_DIRECTORY), + if (talk_menus_enabled()) { + talk_id(LANG_CATALOG_NO_DIRECTORY, false); + talk_spell(playlist_dir, true); + talk_force_enqueue_next(); + } + gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir); return -1; } @@ -147,7 +153,7 @@ static int create_playlist_list(char** p if (ft_load(tc, playlist_dir) < 0) { - gui_syncsplash(HZ*2, str(LANG_CATALOG_NO_DIRECTORY), + gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir); goto exit; } @@ -215,6 +221,13 @@ static char* playlist_callback_name(int return buffer; } +static int playlist_callback_voice(int selected_item, void* data) +{ + char** playlists = (char**) data; + talk_file_or_spell(playlist_dir, playlists[selected_item], NULL, false); + return 0; +} + /* Display all playlists in catalog. Selected "playlist" is returned. If "view" mode is set then we're not adding anything into playlist. */ static int display_playlists(char* playlist, bool view) @@ -232,7 +245,7 @@ static int display_playlists(char* playl if (num_playlists <= 0) { - gui_syncsplash(HZ*2, str(LANG_CATALOG_NO_PLAYLISTS)); + gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_PLAYLISTS)); return -1; } @@ -241,16 +254,20 @@ static int display_playlists(char* playl gui_synclist_init(&playlist_lists, playlist_callback_name, playlists, false, 1); + if(talk_menus_enabled()) + gui_synclist_set_voice_callback(&playlist_lists, + playlist_callback_voice); gui_synclist_set_nb_items(&playlist_lists, num_playlists); gui_synclist_draw(&playlist_lists); + gui_synclist_speak_item(&playlist_lists); while (!exit) { - int button = get_action(CONTEXT_LIST,HZ/2); char* sel_file; - - gui_synclist_do_button(&playlist_lists, button,LIST_WRAP_UNLESS_HELD); - + int button; + list_do_action(CONTEXT_LIST, HZ/2, + &playlist_lists, LIST_WRAP_UNLESS_HELD, &button); + sel_file = playlists[gui_synclist_get_sel_pos(&playlist_lists)]; switch (button) @@ -319,6 +336,15 @@ static int display_playlists(char* playl insert */ static void display_insert_count(int count) { + static long talked_tick = 0; + if(count && (talked_tick == 0 + || TIME_AFTER(current_tick, talked_tick+5*HZ))) + { + talked_tick = current_tick; + talk_number(count, false); + talk_id(LANG_PLAYLIST_INSERT_COUNT, true); + } + gui_syncsplash(0, str(LANG_PLAYLIST_INSERT_COUNT), count, str(LANG_OFF_ABORT)); } @@ -398,7 +424,7 @@ static int add_to_playlist(const char* p /* search directory for tracks and append to playlist */ bool recurse = false; char *lines[] = { - (char *)str(LANG_RECURSE_DIRECTORY_QUESTION), + ID2P(LANG_RECURSE_DIRECTORY_QUESTION), sel }; struct text_message message={lines, 2}; Index: trunk/apps/lang/english.lang =================================================================== --- trunk.orig/apps/lang/english.lang +++ trunk/apps/lang/english.lang @@ -7318,39 +7318,39 @@ id: LANG_CATALOG_NO_DIRECTORY desc: error message when playlist catalog directory doesn't exist user: *: "%s doesn't exist" *: "%s doesn't exist" - *: "" + *: "Playlist directory doesn't exist" id: LANG_CATALOG_NO_PLAYLISTS desc: error message when no playlists for playlist catalog user: *: "No Playlists" *: "No Playlists" - *: "" + *: "No Playlists" id: LANG_BOOKMARK_MENU desc: Text on main menu to get to bookmark commands user: *: "Bookmarks" *: "Bookmarks"