1
0
Fork 0
forked from len0rd/rockbox

splash_progress add delay function

I figure this is a better way to allow a delay before showing the
progress meter

Change-Id: I909902a52619023b0b87635d2eb94ed00cb4bcec
This commit is contained in:
William Wilgus 2022-10-13 00:05:34 -04:00
parent c607bfac6f
commit f9ea1fc79d
4 changed files with 28 additions and 23 deletions

View file

@ -2196,25 +2196,23 @@ int playlist_resume(void)
char *str1 = NULL;
char *str2 = NULL;
char *str3 = NULL;
unsigned long last_tick = current_tick + HZ / 2; /* wait 1/2 sec before progress */
unsigned long last_tick = current_tick;
splash_progress_set_delay(HZ / 2); /* wait 1/2 sec before progress */
bool useraborted = false;
for(count=0; count<nread && !exit_loop && !useraborted; count++,p++)
{
/* Show a splash while we are loading. */
if (TIME_AFTER(current_tick, last_tick - 1))
splash_progress((total_read + count), control_file_size,
"%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT));
if (TIME_AFTER(current_tick, last_tick + HZ/4))
{
splash_progress((total_read + count), control_file_size,
"%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT));
if (TIME_AFTER(current_tick, last_tick + HZ/4))
if (action_userabort(TIMEOUT_NOBLOCK))
{
if (action_userabort(TIMEOUT_NOBLOCK))
{
useraborted = true;
break;
}
last_tick = current_tick;
useraborted = true;
break;
}
last_tick = current_tick;
}
/* Are we on a new line? */
if((*p == '\n') || (*p == '\r'))