diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-09-18 05:15:18 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-09-18 05:15:18 +0000 |
commit | aafeaad65f3e3921cdb16e30098422f2afd84146 (patch) | |
tree | f689b6e2c7d798042ef03c7dfb4b6d7b246374e2 /apps/gui/skin_engine | |
parent | 7337fd332f0a1d4b37f96f8753c2d1dcc3ffb9eb (diff) | |
download | rockbox-aafeaad65f3e3921cdb16e30098422f2afd84146.tar.gz rockbox-aafeaad65f3e3921cdb16e30098422f2afd84146.zip |
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/skin_engine')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 15 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 11 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 13 |
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) | |||
475 | if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY) | 475 | if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY) |
476 | clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, gwps->data)); | 476 | clear_image_pos(gwps, find_image(data->tokens[i].value.i&0xFF, gwps->data)); |
477 | #endif | 477 | #endif |
478 | #ifdef HAVE_ALBUMART | ||
479 | if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY) | ||
480 | { | ||
481 | draw_album_art(gwps, audio_current_aa_hid(), true); | ||
482 | data->albumart->draw = false; | ||
483 | } | ||
484 | #endif | ||
478 | } | 485 | } |
479 | 486 | ||
480 | return true; | 487 | return true; |
@@ -622,14 +629,6 @@ static bool get_line(struct gui_wps *gwps, | |||
622 | } | 629 | } |
623 | } | 630 | } |
624 | break; | 631 | break; |
625 | #ifdef HAVE_ALBUMART | ||
626 | case WPS_TOKEN_ALBUMART_DISPLAY: | ||
627 | if (data->albumart) | ||
628 | { | ||
629 | data->albumart->draw = true; | ||
630 | } | ||
631 | break; | ||
632 | #endif | ||
633 | default: | 632 | default: |
634 | { | 633 | { |
635 | /* get the value of the tag and copy it to the buffer */ | 634 | /* 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, | |||
1120 | struct wps_data *wps_data) | 1120 | struct wps_data *wps_data) |
1121 | { | 1121 | { |
1122 | (void)wps_bufptr; | 1122 | (void)wps_bufptr; |
1123 | (void)token; | 1123 | if (wps_data->num_tokens > 1) |
1124 | if (wps_data->albumart) | 1124 | { |
1125 | struct wps_token *prev = token-1; | ||
1126 | if (prev->type == WPS_TOKEN_CONDITIONAL) | ||
1127 | { | ||
1128 | token->type = WPS_TOKEN_ALBUMART_FOUND; | ||
1129 | } | ||
1130 | } | ||
1131 | else if (wps_data->albumart) | ||
1125 | { | 1132 | { |
1126 | wps_data->albumart->vp = &curr_vp->vp; | 1133 | wps_data->albumart->vp = &curr_vp->vp; |
1127 | } | 1134 | } |
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, | |||
318 | return id3->comment; | 318 | return id3->comment; |
319 | 319 | ||
320 | #ifdef HAVE_ALBUMART | 320 | #ifdef HAVE_ALBUMART |
321 | case WPS_TOKEN_ALBUMART_DISPLAY: | 321 | case WPS_TOKEN_ALBUMART_FOUND: |
322 | if (!data->albumart) | 322 | if (data->albumart && audio_current_aa_hid() >= 0) { |
323 | return NULL; | ||
324 | if (audio_current_aa_hid() >= 0) { | ||
325 | return "C"; | 323 | return "C"; |
326 | } | 324 | } |
327 | data->albumart->draw = false; | 325 | return NULL; |
326 | |||
327 | case WPS_TOKEN_ALBUMART_DISPLAY: | ||
328 | if (!data->albumart) | ||
329 | return NULL; | ||
330 | data->albumart->draw = true; | ||
328 | return NULL; | 331 | return NULL; |
329 | #endif | 332 | #endif |
330 | 333 | ||