Index: trunk/apps/playlist_catalog.c
===================================================================
--- trunk.orig/apps/playlist_catalog.c
+++ trunk/apps/playlist_catalog.c
@@ -39,6 +39,7 @@
#include "yesno.h"
#include "filetypes.h"
#include "debug.h"
+#include "talk.h"
#define PLAYLIST_CATALOG_CFG ROCKBOX_DIR "/playlist_catalog.config"
#define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists"
@@ -114,7 +115,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 (global_settings.talk_menu) {
+ 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;
}
@@ -148,7 +154,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;
}
@@ -228,6 +234,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)
@@ -245,7 +258,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;
}
@@ -254,16 +267,19 @@ static int display_playlists(char* playl
gui_synclist_init(&playlist_lists, playlist_callback_name, playlists,
false, 1);
+ if(global_settings.talk_menu)
+ 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);
+ int button;
char* sel_file;
-
- gui_synclist_do_button(&playlist_lists, &button,LIST_WRAP_UNLESS_HELD);
-
+ list_do_action(CONTEXT_LIST,HZ/2,
+ &playlist_lists, &button,LIST_WRAP_UNLESS_HELD);
sel_file = playlists[gui_synclist_get_sel_pos(&playlist_lists)];
switch (button)
@@ -299,7 +315,10 @@ static int display_playlists(char* playl
exit = true;
}
else
+ {
gui_synclist_draw(&playlist_lists);
+ gui_synclist_speak_item(&playlist_lists);
+ }
}
break;
@@ -323,6 +342,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));
}
@@ -402,7 +430,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"