summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-09-18 05:15:18 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-09-18 05:15:18 +0000
commitaafeaad65f3e3921cdb16e30098422f2afd84146 (patch)
treef689b6e2c7d798042ef03c7dfb4b6d7b246374e2 /apps/gui
parent7337fd332f0a1d4b37f96f8753c2d1dcc3ffb9eb (diff)
fix FS#10599 and do r22721 a slightly better way. the %C tag is internally converted to a different token for display and conditional check.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22726 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_display.c15
-rw-r--r--apps/gui/skin_engine/skin_parser.c11
-rw-r--r--apps/gui/skin_engine/skin_tokens.c13
3 files changed, 24 insertions, 15 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 762b7f78a6..e24ab66393 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -475,6 +475,13 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY)
clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, gwps->data));
#endif
+#ifdef HAVE_ALBUMART
+ if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY)
+ {
+ draw_album_art(gwps, audio_current_aa_hid(), true);
+ data->albumart->draw = false;
+ }
+#endif
}
return true;
@@ -622,14 +629,6 @@ static bool get_line(struct gui_wps *gwps,
}
}
break;
-#ifdef HAVE_ALBUMART
- case WPS_TOKEN_ALBUMART_DISPLAY:
- if (data->albumart)
- {
- data->albumart->draw = true;
- }
- break;
-#endif
default:
{
/* get the value of the tag and copy it to the buffer */
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 7d37e1972c..3717dadd48 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1120,8 +1120,15 @@ static int parse_albumart_display(const char *wps_bufptr,
struct wps_data *wps_data)
{
(void)wps_bufptr;
- (void)token;
- if (wps_data->albumart)
+ if (wps_data->num_tokens > 1)
+ {
+ struct wps_token *prev = token-1;
+ if (prev->type == WPS_TOKEN_CONDITIONAL)
+ {
+ token->type = WPS_TOKEN_ALBUMART_FOUND;
+ }
+ }
+ else if (wps_data->albumart)
{
wps_data->albumart->vp = &curr_vp->vp;
}
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 6d4fef5ab5..94d8eb4dc6 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -318,13 +318,16 @@ const char *get_token_value(struct gui_wps *gwps,
return id3->comment;
#ifdef HAVE_ALBUMART
- case WPS_TOKEN_ALBUMART_DISPLAY:
- if (!data->albumart)
- return NULL;
- if (audio_current_aa_hid() >= 0) {
+ case WPS_TOKEN_ALBUMART_FOUND:
+ if (data->albumart && audio_current_aa_hid() >= 0) {
return "C";
}
- data->albumart->draw = false;
+ return NULL;
+
+ case WPS_TOKEN_ALBUMART_DISPLAY:
+ if (!data->albumart)
+ return NULL;
+ data->albumart->draw = true;
return NULL;
#endif