summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-12 01:31:42 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-12 01:31:42 +0000
commit81dedee7d050e2b52dfe1a294dbd349c4fe79155 (patch)
tree23cd47d71b9f6aead2d3d83b0b0131a36f806709 /apps/gui
parent49639257677ab98dc4730bebf1044ea1ca7591b0 (diff)
downloadrockbox-81dedee7d050e2b52dfe1a294dbd349c4fe79155.zip
rockbox-81dedee7d050e2b52dfe1a294dbd349c4fe79155.tar.gz
rockbox-81dedee7d050e2b52dfe1a294dbd349c4fe79155.tar.bz2
rockbox-81dedee7d050e2b52dfe1a294dbd349c4fe79155.tar.xz
Various album art improvements:
* Make the album art display tag static instead of dynamic, making it be drawn less often, which is good. * Add the possibility of clearing the album art bitmap instead of drawing it, and use this abaility when the display tag is inside a conditional construct. * Add the album art display tag to wps_debug.c. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15592 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps-common.c7
-rw-r--r--apps/gui/gwps.h2
-rw-r--r--apps/gui/wps_debug.c9
-rw-r--r--apps/gui/wps_parser.c6
4 files changed, 22 insertions, 2 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 3c29884..00505af 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -932,7 +932,7 @@ static char *get_token_value(struct gui_wps *gwps,
#ifdef HAVE_ALBUMART
case WPS_TOKEN_ALBUMART_DISPLAY:
- draw_album_art(gwps, audio_current_aa_hid());
+ draw_album_art(gwps, audio_current_aa_hid(), false);
return NULL;
case WPS_TOKEN_ALBUMART_FOUND:
@@ -1418,6 +1418,11 @@ static int evaluate_conditional(struct gui_wps *gwps, int cond_index)
}
#endif
+#ifdef HAVE_ALBUMART
+ if (data->albumart_cond_index == cond_index)
+ draw_album_art(gwps, audio_current_aa_hid(), true);
+#endif
+
return ret;
}
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 391fc72..f57656b 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -344,6 +344,8 @@ struct wps_data
+ .._INCREASE, + .._DECREASE */
short albumart_max_width;
short albumart_max_height;
+
+ int albumart_cond_index;
#endif
#else /*HAVE_LCD_CHARCELLS */
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c
index 58e6ab4..883626d 100644
--- a/apps/gui/wps_debug.c
+++ b/apps/gui/wps_debug.c
@@ -214,6 +214,15 @@ static void dump_wps_tokens(struct wps_data *data)
break;
#endif
+#ifdef HAVE_ALBUMART
+ case WPS_TOKEN_ALBUMART_DISPLAY:
+ snprintf(buf, sizeof(buf), "album art display at x=%d, y=%d, "
+ "maxwidth=%d, maxheight=%d", data->albumart_x,
+ data->albumart_y, data->albumart_max_width,
+ data->albumart_max_height);
+ break;
+#endif
+
#ifdef HAVE_LCD_BITMAP
case WPS_TOKEN_IMAGE_BACKDROP:
snprintf(buf, sizeof(buf), "backdrop image");
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 097a60c..86bd096 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -293,7 +293,7 @@ static const struct wps_tag all_tags[] = {
{ WPS_TOKEN_IMAGE_PROGRESS_BAR, "P", 0, parse_image_special },
#ifdef HAVE_ALBUMART
{ WPS_NO_TOKEN, "Cl", 0, parse_albumart_load },
- { WPS_TOKEN_ALBUMART_DISPLAY, "C", WPS_REFRESH_DYNAMIC,
+ { WPS_TOKEN_ALBUMART_DISPLAY, "C", WPS_REFRESH_STATIC,
parse_albumart_conditional },
#endif
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
@@ -824,7 +824,11 @@ static int parse_albumart_conditional(const char *wps_bufptr,
}
}
else
+ {
+ /* This %C tag is in a conditional construct. */
+ wps_data->albumart_cond_index = condindex[level];
return 0;
+ }
};
#endif /* HAVE_ALBUMART */