diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index 7ba229a6f3..b8e69d09c6 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -200,6 +200,29 @@ bool warn_on_pl_erase(void) | |||
200 | return true; | 200 | return true; |
201 | } | 201 | } |
202 | 202 | ||
203 | bool show_search_progress(bool init, int count) | ||
204 | { | ||
205 | static int last_tick = 0; | ||
206 | |||
207 | /* Don't show splashes for 1/2 second after starting search */ | ||
208 | if (init) | ||
209 | { | ||
210 | last_tick = current_tick + HZ/2; | ||
211 | return true; | ||
212 | } | ||
213 | |||
214 | /* Update progress every 1/10 of a second */ | ||
215 | if (TIME_AFTER(current_tick, last_tick + HZ/10)) | ||
216 | { | ||
217 | splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), count, str(LANG_OFF_ABORT)); | ||
218 | if (action_userabort(TIMEOUT_NOBLOCK)) | ||
219 | return false; | ||
220 | last_tick = current_tick; | ||
221 | yield(); | ||
222 | } | ||
223 | |||
224 | return true; | ||
225 | } | ||
203 | 226 | ||
204 | /* Performance optimized version of the read_line() (see below) function. */ | 227 | /* Performance optimized version of the read_line() (see below) function. */ |
205 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, | 228 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, |