summaryrefslogtreecommitdiff
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-eb5e15803bf1f509f8f07e0af5c2e99143d34876.tar.gz
rockbox-eb5e15803bf1f509f8f07e0af5c2e99143d34876.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)
2039static bool insert_all_playlist(struct tree_context *c, int position, bool queue) 2039static bool insert_all_playlist(struct tree_context *c, int position, bool queue)
2040{ 2040{
2041 struct tagcache_search tcs; 2041 struct tagcache_search tcs;
2042 int i; 2042 int i, n;
2043 unsigned long last_tick;
2043 char buf[MAX_PATH]; 2044 char buf[MAX_PATH];
2044 int from, to, direction;
2045 int files_left = c->filesindir;
2046 2045
2047 cpu_boost(true); 2046 cpu_boost(true);
2048 if (!tagcache_search(&tcs, tag_filename)) 2047 if (!tagcache_search(&tcs, tag_filename))
@@ -2063,15 +2062,21 @@ static bool insert_all_playlist(struct tree_context *c, int position, bool queue
2063 } 2062 }
2064 } 2063 }
2065 2064
2066 from = 0; 2065 last_tick = current_tick + HZ/2; /* Show splash after 0.5 seconds have passed */
2067 to = c->filesindir;
2068 direction = 1;
2069 2066
2070 for (i = from; i != to; i += direction) 2067 n = c->filesindir;
2068 for (i = 0; i < n; i++)
2071 { 2069 {
2072 /* Count back to zero */ 2070 if (TIME_AFTER(current_tick, last_tick - 1))
2073 if (!show_search_progress(false, files_left--)) 2071 {
2074 break; 2072 splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT));
2073 if (TIME_AFTER(current_tick, last_tick + HZ/10))
2074 {
2075 if (action_userabort(TIMEOUT_NOBLOCK))
2076 break;
2077 last_tick = current_tick;
2078 }
2079 }
2075 2080
2076 if (!tagcache_retrieve(&tcs, tagtree_get_entry(c, i)->extraseek, 2081 if (!tagcache_retrieve(&tcs, tagtree_get_entry(c, i)->extraseek,
2077 tcs.type, buf, sizeof buf)) 2082 tcs.type, buf, sizeof buf))