Index: apps/gui/skin_engine/skin_tokens.c =================================================================== --- apps/gui/skin_engine/skin_tokens.c (revision 25266) +++ apps/gui/skin_engine/skin_tokens.c (working copy) @@ -471,8 +471,8 @@ case WPS_TOKEN_ALBUMART_DISPLAY: if (!data->albumart) return NULL; - if (!data->albumart->draw) - data->albumart->draw = true; + draw_album_art(gwps, playback_current_aa_hid(data->playback_aa_slot), + false); return NULL; #endif Index: apps/gui/skin_engine/skin_display.c =================================================================== --- apps/gui/skin_engine/skin_display.c (revision 25266) +++ apps/gui/skin_engine/skin_display.c (working copy) @@ -115,21 +115,20 @@ } static void draw_progressbar(struct gui_wps *gwps, - struct skin_viewport *wps_vp) + struct progressbar *pb, struct viewport *vp) { struct screen *display = gwps->display; struct wps_state *state = gwps->state; - struct progressbar *pb = wps_vp->pb; struct mp3entry *id3 = state->id3; int y = pb->y, height = pb->height; unsigned long length, elapsed; if (height < 0) - height = font_get(wps_vp->vp.font)->height; + height = font_get(vp->font)->height; if (y < 0) { - int line_height = font_get(wps_vp->vp.font)->height; + int line_height = font_get(vp->font)->height; /* center the pb in the line, but only if the line is higher than the pb */ int center = (line_height-height)/2; /* if Y was not set calculate by font height,Y is -line_number-1 */ @@ -349,44 +348,6 @@ img->subimage_height); } #endif -} - -static void wps_display_images(struct gui_wps *gwps, struct viewport* vp) -{ - if(!gwps || !gwps->data || !gwps->display) - return; - - struct wps_data *data = gwps->data; - struct screen *display = gwps->display; - struct skin_token_list *list = data->images; - - while (list) - { - struct gui_img *img = (struct gui_img*)list->token->value.data; - if (img->loaded) - { - if (img->display >= 0) - { - wps_draw_image(gwps, img, img->display); - } - else if (img->always_display && img->vp == vp) - { - wps_draw_image(gwps, img, 0); - } - } - list = list->next; - } -#ifdef HAVE_ALBUMART - /* now draw the AA */ - if (data->albumart && data->albumart->vp == vp - && data->albumart->draw) - { - draw_album_art(gwps, playback_current_aa_hid(data->playback_aa_slot), - false); - data->albumart->draw = false; - } -#endif - display->set_drawmode(DRMODE_SOLID); } @@ -630,7 +591,8 @@ struct align_pos *align, char *linebuf, int linebuf_size, - unsigned refresh_mode) + unsigned refresh_mode, + struct skin_viewport *viewport) { struct wps_data *data = gwps->data; @@ -667,6 +629,13 @@ break; #ifdef HAVE_LCD_BITMAP + case WPS_TOKEN_PROGRESSBAR: + if (refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) + { + struct progressbar *pb = (struct progressbar *)data->tokens[i].value.data; + draw_progressbar(gwps, pb, &viewport->vp); + } + break; case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: { char n = data->tokens[i].value.i & 0xFF; @@ -674,7 +643,9 @@ struct gui_img *img = find_image(n, data); if (img && img->loaded) - img->display = subimage; + { + wps_draw_image(gwps, img, img->always_display ? 0 : subimage); + } break; } case WPS_TOKEN_DRAW_INBUILTBAR: @@ -1128,16 +1099,6 @@ int hidden_vp = 0; -#ifdef HAVE_LCD_BITMAP - /* Set images to not to be displayed */ - struct skin_token_list *imglist = data->images; - while (imglist) - { - struct gui_img *img = (struct gui_img *)imglist->token->value.data; - img->display = -1; - imglist = imglist->next; - } -#endif /* dont redraw the viewport if its disabled */ if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE) { /* don't draw anything into this one */ @@ -1183,7 +1144,7 @@ { /* get_line tells us if we need to update the line */ update_line = get_line(gwps, subline, &align, - linebuf, sizeof(linebuf), vp_refresh_mode); + linebuf, sizeof(linebuf), vp_refresh_mode, skin_viewport); } #ifdef HAVE_LCD_BITMAP /* peakmeter */ @@ -1244,19 +1205,6 @@ write_line(display, &align, line_count, false); } } -#ifdef HAVE_LCD_BITMAP - /* progressbar */ - if (vp_refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) - { - if (skin_viewport->pb) - { - draw_progressbar(gwps, skin_viewport); - } - } - /* Now display any images in this viewport */ - if (!hidden_vp) - wps_display_images(gwps, &skin_viewport->vp); -#endif } #ifdef HAVE_LCD_BITMAP Index: apps/gui/skin_engine/wps_internals.h =================================================================== --- apps/gui/skin_engine/wps_internals.h (revision 25266) +++ apps/gui/skin_engine/wps_internals.h (working copy) @@ -82,7 +82,6 @@ short int y; /* y-pos */ short int num_subimages; /* number of sub-images */ short int subimage_height; /* height of each sub-image */ - short int display; /* -1 for no display, 0..n to display a subimage */ struct bitmap bm; char label; bool loaded; /* load state */