summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-10-09 23:39:13 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2022-10-10 07:49:04 -0400
commiteb5e15803bf1f509f8f07e0af5c2e99143d34876 (patch)
tree749d017b22a9f2f8d768474b700410d1c7bbb31a
parent0374dea33a4f9cd5ab57cc186aaebe8cc37175d1 (diff)
downloadrockbox-eb5e15803b.tar.gz
rockbox-eb5e15803b.zip
Use splash_progress in database when inserting into dynamic playlist
Change-Id: Iaef66cc00a1be0ce3cf869f0e6137a2e9efa2713
-rw-r--r--apps/tagtree.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 2694a764a0..d354d7c2a1 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -2039,10 +2039,9 @@ int tagtree_get_filename(struct tree_context* c, char *buf, int buflen)
static bool insert_all_playlist(struct tree_context *c, int position, bool queue)
{
struct tagcache_search tcs;
- int i;
+ int i, n;
+ unsigned long last_tick;
char buf[MAX_PATH];
- int from, to, direction;
- int files_left = c->filesindir;
cpu_boost(true);
if (!tagcache_search(&tcs, tag_filename))
@@ -2063,15 +2062,21 @@ static bool insert_all_playlist(struct tree_context *c, int position, bool queue
}
}
- from = 0;
- to = c->filesindir;
- direction = 1;
+ last_tick = current_tick + HZ/2; /* Show splash after 0.5 seconds have passed */
- for (i = from; i != to; i += direction)
+ n = c->filesindir;
+ for (i = 0; i < n; i++)
{
- /* Count back to zero */
- if (!show_search_progress(false, files_left--))
- break;
+ if (TIME_AFTER(current_tick, last_tick - 1))
+ {
+ splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT));
+ if (TIME_AFTER(current_tick, last_tick + HZ/10))
+ {
+ if (action_userabort(TIMEOUT_NOBLOCK))
+ break;
+ last_tick = current_tick;
+ }
+ }
if (!tagcache_retrieve(&tcs, tagtree_get_entry(c, i)->extraseek,
tcs.type, buf, sizeof buf))