summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_display.c6
-rw-r--r--apps/gui/skin_engine/skin_parser.c21
-rw-r--r--apps/gui/skin_engine/skin_tokens.c5
-rw-r--r--apps/gui/skin_engine/wps_internals.h1
-rw-r--r--apps/gui/wps.c22
-rw-r--r--apps/gui/wps.h10
6 files changed, 31 insertions, 34 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 67984cd2bb..a5ea28619a 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -259,7 +259,8 @@ static void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
259 if (data->albumart && data->albumart->vp == vp 259 if (data->albumart && data->albumart->vp == vp
260 && data->albumart->draw) 260 && data->albumart->draw)
261 { 261 {
262 draw_album_art(gwps, audio_current_aa_hid(), false); 262 draw_album_art(gwps, playback_current_aa_hid(data->playback_aa_slot),
263 false);
263 data->albumart->draw = false; 264 data->albumart->draw = false;
264 } 265 }
265#endif 266#endif
@@ -486,7 +487,8 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
486#ifdef HAVE_ALBUMART 487#ifdef HAVE_ALBUMART
487 if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY) 488 if (data->albumart && data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY)
488 { 489 {
489 draw_album_art(gwps, audio_current_aa_hid(), true); 490 draw_album_art(gwps,
491 playback_current_aa_hid(data->playback_aa_slot), true);
490 data->albumart->draw = false; 492 data->albumart->draw = false;
491 } 493 }
492#endif 494#endif
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 016126bffb..fa35ed994f 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -56,6 +56,10 @@
56#include "bmp.h" 56#include "bmp.h"
57#endif 57#endif
58 58
59#ifdef HAVE_ALBUMART
60#include "playback.h"
61#endif
62
59#include "backdrop.h" 63#include "backdrop.h"
60 64
61#define WPS_ERROR_INVALID_PARAM -1 65#define WPS_ERROR_INVALID_PARAM -1
@@ -985,6 +989,8 @@ static int parse_albumart_load(const char *wps_bufptr,
985{ 989{
986 const char *_pos, *newline; 990 const char *_pos, *newline;
987 bool parsing; 991 bool parsing;
992 struct dim dimensions;
993 int albumart_slot;
988 struct skin_albumart *aa = skin_buffer_alloc(sizeof(struct skin_albumart)); 994 struct skin_albumart *aa = skin_buffer_alloc(sizeof(struct skin_albumart));
989 (void)token; /* silence warning */ 995 (void)token; /* silence warning */
990 if (!aa) 996 if (!aa)
@@ -1125,6 +1131,16 @@ static int parse_albumart_load(const char *wps_bufptr,
1125 aa->draw = false; 1131 aa->draw = false;
1126 wps_data->albumart = aa; 1132 wps_data->albumart = aa;
1127 1133
1134 dimensions.width = aa->width;
1135 dimensions.height = aa->height;
1136
1137 albumart_slot = playback_claim_aa_slot(&dimensions);
1138
1139 if (albumart_slot < 0) /* didn't get a slot ? */
1140 return skip_end_of_line(wps_bufptr);
1141 else
1142 wps_data->playback_aa_slot = albumart_slot;
1143
1128 /* Skip the rest of the line */ 1144 /* Skip the rest of the line */
1129 return skip_end_of_line(wps_bufptr); 1145 return skip_end_of_line(wps_bufptr);
1130} 1146}
@@ -1601,6 +1617,11 @@ void skin_data_reset(struct wps_data *wps_data)
1601 wps_data->strings = NULL; 1617 wps_data->strings = NULL;
1602#ifdef HAVE_ALBUMART 1618#ifdef HAVE_ALBUMART
1603 wps_data->albumart = NULL; 1619 wps_data->albumart = NULL;
1620 if (wps_data->playback_aa_slot >= 0)
1621 {
1622 playback_release_aa_slot(wps_data->playback_aa_slot);
1623 wps_data->playback_aa_slot = -1;
1624 }
1604#endif 1625#endif
1605 wps_data->tokens = NULL; 1626 wps_data->tokens = NULL;
1606 wps_data->num_tokens = 0; 1627 wps_data->num_tokens = 0;
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index d607538f0f..6b29091fe6 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -368,8 +368,9 @@ const char *get_token_value(struct gui_wps *gwps,
368 368
369#ifdef HAVE_ALBUMART 369#ifdef HAVE_ALBUMART
370 case WPS_TOKEN_ALBUMART_FOUND: 370 case WPS_TOKEN_ALBUMART_FOUND:
371 if (data->albumart && audio_current_aa_hid() >= 0) { 371 if (data->albumart) {
372 return "C"; 372 if (playback_current_aa_hid(data->playback_aa_slot) >= 0)
373 return "C";
373 } 374 }
374 return NULL; 375 return NULL;
375 376
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 7a4fdddc7c..638fb0a081 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -255,6 +255,7 @@ struct wps_data
255 struct skin_token_list *strings; 255 struct skin_token_list *strings;
256#ifdef HAVE_ALBUMART 256#ifdef HAVE_ALBUMART
257 struct skin_albumart *albumart; 257 struct skin_albumart *albumart;
258 int playback_aa_slot;
258#endif 259#endif
259 struct wps_token *tokens; 260 struct wps_token *tokens;
260 /* Total number of tokens in the WPS. During WPS parsing, this is 261 /* Total number of tokens in the WPS. During WPS parsing, this is
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index d4a2893ff2..342ebdea2b 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1278,6 +1278,7 @@ static void statusbar_toggle_handler(void *data)
1278} 1278}
1279#endif 1279#endif
1280 1280
1281
1281void gui_sync_wps_init(void) 1282void gui_sync_wps_init(void)
1282{ 1283{
1283 int i; 1284 int i;
@@ -1285,6 +1286,7 @@ void gui_sync_wps_init(void)
1285 { 1286 {
1286#ifdef HAVE_ALBUMART 1287#ifdef HAVE_ALBUMART
1287 wps_datas[i].albumart = NULL; 1288 wps_datas[i].albumart = NULL;
1289 wps_datas[i].playback_aa_slot = -1;
1288#endif 1290#endif
1289#ifdef HAVE_REMOTE_LCD 1291#ifdef HAVE_REMOTE_LCD
1290 wps_datas[i].remote_wps = (i == SCREEN_REMOTE); 1292 wps_datas[i].remote_wps = (i == SCREEN_REMOTE);
@@ -1304,26 +1306,6 @@ void gui_sync_wps_init(void)
1304#endif 1306#endif
1305} 1307}
1306 1308
1307#ifdef HAVE_ALBUMART
1308bool wps_uses_albumart(int *width, int *height)
1309{
1310 int i;
1311 FOR_NB_SCREENS(i) {
1312 struct gui_wps *gwps = &gui_wps[i];
1313 struct skin_albumart *aa = gwps->data->albumart;
1314 if (aa && (aa->state != WPS_ALBUMART_NONE))
1315 {
1316 if (width)
1317 *width = aa->width;
1318 if (height)
1319 *height = aa->height;
1320 return true;
1321 }
1322 }
1323 return false;
1324}
1325#endif
1326
1327 1309
1328#ifdef IPOD_ACCESSORY_PROTOCOL 1310#ifdef IPOD_ACCESSORY_PROTOCOL
1329int wps_get_ff_rewind_count(void) 1311int wps_get_ff_rewind_count(void)
diff --git a/apps/gui/wps.h b/apps/gui/wps.h
index 6affcee698..8c6de9e2fc 100644
--- a/apps/gui/wps.h
+++ b/apps/gui/wps.h
@@ -38,16 +38,6 @@ void display_keylock_text(bool locked);
38 38
39bool is_wps_fading(void); 39bool is_wps_fading(void);
40 40
41
42#ifdef HAVE_ALBUMART
43/*
44 * Returns true if at least one of the gui_wps screens has an album art
45 * tag in its wps structure and writes the width and height into the passed
46 * pointers
47 */
48bool wps_uses_albumart(int*, int*);
49#endif
50
51#ifdef IPOD_ACCESSORY_PROTOCOL 41#ifdef IPOD_ACCESSORY_PROTOCOL
52/* return length of the current ff or rewin action, IAP needs this */ 42/* return length of the current ff or rewin action, IAP needs this */
53int wps_get_ff_rewind_count(void); 43int wps_get_ff_rewind_count(void);