Index: apps/playlist.c =================================================================== --- apps/playlist.c (revision 19265) +++ apps/playlist.c (working copy) @@ -136,6 +136,9 @@ #define PLAYLIST_QUEUED 0x20000000 #define PLAYLIST_SKIPPED 0x10000000 +#define PLAYLIST_DISPLAY_COUNT 10 +#define PLAYLIST_DISPLAY_THRESHOLD 50 + struct directory_search_context { struct playlist_info* playlist; int position; @@ -1728,6 +1731,29 @@ } /* + * Display splash message showing completion of playlist/directory insertion or + * save. + */ +static void display_playlist_completion(int count, const unsigned char *fmt) +{ + static long talked_tick = 0; + long id = P2ID(fmt); + if(global_settings.talk_menu && id>=0) + { + if(count && (talked_tick == 0 + || TIME_AFTER(current_tick, talked_tick+5*HZ))) + { + talked_tick = current_tick; + talk_number(count, false); + talk_id(id, true); + } + } + fmt = P2STR(fmt); + + splashf(HZ*1, fmt, count); +} + +/* * Display buffer full message */ static void display_buffer_full(void) @@ -2901,10 +2927,12 @@ char *temp_ptr; const char *dir; unsigned char *count_str; + unsigned char *comp_str; char temp_buf[MAX_PATH+1]; char trackname[MAX_PATH+1]; int count = 0; int result = 0; + int playlist_display_step = 1; bool utf8 = is_m3u8(filename); if (!playlist) @@ -2933,9 +2961,15 @@ dir = "/"; if (queue) + { count_str = ID2P(LANG_PLAYLIST_QUEUE_COUNT); + comp_str = ID2P(LANG_PLAYLIST_QUEUE_COUNT_COMP); + } else + { count_str = ID2P(LANG_PLAYLIST_INSERT_COUNT); + comp_str = ID2P(LANG_PLAYLIST_INSERT_COUNT_COMP); + } display_playlist_count(count, count_str, false); @@ -2990,12 +3024,15 @@ position = insert_pos + 1; count++; - - if ((count%PLAYLIST_DISPLAY_COUNT) == 0) + + if (count == PLAYLIST_DISPLAY_THRESHOLD + 1) + playlist_display_step = PLAYLIST_DISPLAY_COUNT; + + if ((count%playlist_display_step) == 0) { display_playlist_count(count, count_str, false); - if (count == PLAYLIST_DISPLAY_COUNT && + if (count == playlist_display_step && (audio_status() & AUDIO_STATUS_PLAY) && playlist->started) audio_flush_and_reload_tracks(); @@ -3015,7 +3052,7 @@ cpu_boost(false); - display_playlist_count(count, count_str, true); + display_playlist_completion(count, comp_str); if ((audio_status() & AUDIO_STATUS_PLAY) && playlist->started) audio_flush_and_reload_tracks();