summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-12-12 18:34:41 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-12-24 11:08:26 -0500
commit6c6f0757d7a902feb293be165d1490c42bc8e7ad (patch)
tree598135a544a1874a9514c1efd4a25828a884c0d3 /apps
parentf4fbc1bcebaca17b251fc8ef8729f317147dd9b0 (diff)
downloadrockbox-6c6f0757d7a902feb293be165d1490c42bc8e7ad.tar.gz
rockbox-6c6f0757d7a902feb293be165d1490c42bc8e7ad.zip
PictureFlow: Show background cache building progress
There was no easy way to see how far along PictureFlow was in building the art cache, once background scanning had commenced. PF now uses the screen area normally used by the FPS meter to show completed percentage until building the art cache has finished. Change-Id: I60fa7187b522cda219e35f5a9f630835ecac6883
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 9592ac5266..35afdaf7e4 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -3467,30 +3467,32 @@ static inline void draw_gradient(int y, int h)
static void track_list_yh(int char_height)
{
+ bool needs_space = pf_cfg.show_fps || aa_cache.inspected < pf_idx.album_ct;
+
switch (pf_cfg.show_album_name)
{
case ALBUM_NAME_HIDE:
- pf_tracks.list_y = (pf_cfg.show_fps ? char_height : 0);
+ pf_tracks.list_y = (needs_space ? char_height : 0);
pf_tracks.list_h = LCD_HEIGHT - pf_tracks.list_y;
break;
case ALBUM_NAME_BOTTOM:
- pf_tracks.list_y = (pf_cfg.show_fps ? char_height : 0);
+ pf_tracks.list_y = (needs_space ? char_height : 0);
pf_tracks.list_h = LCD_HEIGHT - pf_tracks.list_y - (char_height * 3);
break;
case ALBUM_AND_ARTIST_TOP:
pf_tracks.list_y = char_height * 3;
pf_tracks.list_h = LCD_HEIGHT - pf_tracks.list_y -
- (pf_cfg.show_fps ? char_height : 0);
+ (needs_space ? char_height : 0);
break;
case ALBUM_AND_ARTIST_BOTTOM:
- pf_tracks.list_y = (pf_cfg.show_fps ? char_height : 0);
+ pf_tracks.list_y = (needs_space ? char_height : 0);
pf_tracks.list_h = LCD_HEIGHT - pf_tracks.list_y - (char_height * 3);
break;
case ALBUM_NAME_TOP:
default:
pf_tracks.list_y = char_height * 3;
pf_tracks.list_h = LCD_HEIGHT - pf_tracks.list_y -
- (pf_cfg.show_fps ? char_height : 0);
+ (needs_space ? char_height : 0);
break;
}
}
@@ -3945,15 +3947,22 @@ static int pictureflow_main(void)
last_update = current_update;
frames = 0;
}
- /* Draw FPS */
- if (pf_cfg.show_fps)
+ /* Draw FPS or draw percentage of already built album cache */
+ if (pf_cfg.show_fps || aa_cache.inspected < pf_idx.album_ct)
{
#ifdef USEGSLIB
mylcd_set_foreground(G_BRIGHT(255));
#else
mylcd_set_foreground(G_PIX(255,0,0));
#endif
- rb->snprintf(fpstxt, sizeof(fpstxt), "FPS: %d", fps);
+ if(aa_cache.inspected >= pf_idx.album_ct)
+ rb->snprintf(fpstxt, sizeof(fpstxt), "FPS: %d", fps);
+ else
+ {
+ int progress_pct = 100 * aa_cache.inspected / pf_idx.album_ct;
+ rb->snprintf(fpstxt, sizeof(fpstxt), "%d %%", progress_pct);
+ }
+
if (pf_cfg.show_album_name == ALBUM_NAME_TOP)
fpstxt_y = LCD_HEIGHT -
rb->screens[SCREEN_MAIN]->getcharheight();