From d183959676bd269d1f2252517c4dac750c985482 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 1 Jan 2022 15:49:04 +0100 Subject: [PATCH] PictureFlow: Show track list loading message When tagcache or storage are busy, it can take a few seconds for the list to appear. Meanwhile, the screen used to be either blank or the cover was left suspended in mid-animation, if the animation was skipped. Change-Id: I655320c4f92ff496834e252cc77ece47723a8677 --- apps/plugins/pictureflow/pictureflow.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 7801377bda..74146d8172 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -3549,6 +3549,20 @@ void reset_track_list(void) } } +static void draw_album_text(void); +static void show_track_list_loading(void) +{ + int x = (LCD_WIDTH - mylcd_getstringsize(rb->str(LANG_WAIT), NULL, NULL)) / 2; + mylcd_set_foreground(G_BRIGHT(255)); + int char_height = rb->screens[SCREEN_MAIN]->getcharheight(); + track_list_yh(char_height); + mylcd_putsxy(x, pf_tracks.list_y + (pf_tracks.list_h - char_height) / 2, + rb->str(LANG_WAIT)); + draw_album_text(); + mylcd_update(); + mylcd_clear_display(); +} + /** Display the list of tracks */ @@ -3556,6 +3570,7 @@ static void show_track_list(void) { mylcd_clear_display(); if ( center_slide.slide_index != pf_tracks.cur_idx ) { + show_track_list_loading(); create_track_index(center_slide.slide_index); reset_track_list(); }