Better UI response with playlist operations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10544 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9d2929b79b
commit
54ec1f5f6d
5 changed files with 46 additions and 4 deletions
|
@ -9534,3 +9534,17 @@
|
|||
*: "Split Filesize"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_LOADING_PERCENT
|
||||
desc: splash number of percents loaded
|
||||
user:
|
||||
<source>
|
||||
*: "Loading... %d%% done (%s)"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Loading... %d%% done (%s)"
|
||||
</dest>
|
||||
<voice>
|
||||
*: ""
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -172,6 +172,8 @@ static bool add_to_playlist(int position, bool queue)
|
|||
};
|
||||
struct text_message message={lines, 2};
|
||||
|
||||
gui_syncsplash(0, true, str(LANG_WAIT));
|
||||
|
||||
if (new_playlist)
|
||||
playlist_create(NULL, NULL);
|
||||
|
||||
|
|
|
@ -1873,9 +1873,30 @@ int playlist_resume(void)
|
|||
char *str1 = NULL;
|
||||
char *str2 = NULL;
|
||||
char *str3 = NULL;
|
||||
|
||||
unsigned long last_tick = current_tick;
|
||||
|
||||
for(count=0; count<nread && !exit_loop; count++,p++)
|
||||
{
|
||||
/* So a splash while we are loading. */
|
||||
if (current_tick - last_tick > HZ/4)
|
||||
{
|
||||
gui_syncsplash(0, true, str(LANG_LOADING_PERCENT),
|
||||
(total_read+count)*100/control_file_size,
|
||||
#if CONFIG_KEYPAD == PLAYER_PAD
|
||||
str(LANG_STOP_ABORT)
|
||||
#else
|
||||
str(LANG_OFF_ABORT)
|
||||
#endif
|
||||
);
|
||||
if (SETTINGS_CANCEL == button_get(false))
|
||||
{
|
||||
/* FIXME:
|
||||
* Not sure how to implement this, somebody more familiar
|
||||
* with the code, please fix this. */
|
||||
}
|
||||
last_tick = current_tick;
|
||||
}
|
||||
|
||||
/* Are we on a new line? */
|
||||
if((*p == '\n') || (*p == '\r'))
|
||||
{
|
||||
|
|
|
@ -2657,6 +2657,7 @@ bool tagcache_create_changelog(struct tagcache_search *tcs)
|
|||
}
|
||||
|
||||
write(clfd, "\n", 1);
|
||||
yield();
|
||||
}
|
||||
|
||||
close(clfd);
|
||||
|
|
|
@ -526,7 +526,7 @@ bool show_search_progress(bool init, int count)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (current_tick - last_tick > HZ/2)
|
||||
if (current_tick - last_tick > HZ/4)
|
||||
{
|
||||
gui_syncsplash(0, true, str(LANG_PLAYLIST_SEARCH_MSG), count,
|
||||
#if CONFIG_KEYPAD == PLAYER_PAD
|
||||
|
@ -538,6 +538,7 @@ bool show_search_progress(bool init, int count)
|
|||
if (SETTINGS_CANCEL == button_get(false))
|
||||
return false;
|
||||
last_tick = current_tick;
|
||||
yield();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -993,6 +994,8 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue)
|
|||
|
||||
if (playlist_insert_track(NULL, buf, position, queue, false) < 0)
|
||||
break;
|
||||
|
||||
yield();
|
||||
}
|
||||
playlist_sync(NULL);
|
||||
tagcache_search_finish(&tcs);
|
||||
|
@ -1007,6 +1010,9 @@ bool tagtree_insert_selection_playlist(int position, bool queue)
|
|||
char buf[MAX_PATH];
|
||||
int dirlevel = tc->dirlevel;
|
||||
|
||||
/* We need to set the table to allsubentries. */
|
||||
show_search_progress(true, 0);
|
||||
|
||||
dptr = tagtree_get_entry(tc, tc->selected_item);
|
||||
|
||||
/* Insert a single track? */
|
||||
|
@ -1022,8 +1028,6 @@ bool tagtree_insert_selection_playlist(int position, bool queue)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* We need to set the table to allsubentries. */
|
||||
show_search_progress(true, 0);
|
||||
if (dptr->newtable == navibrowse)
|
||||
{
|
||||
tagtree_enter(tc);
|
||||
|
|
Loading…
Reference in a new issue