summaryrefslogtreecommitdiff
path: root/apps/recorder/albumart.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-03 15:06:30 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-03 15:06:30 +0000
commit3b75c86d74937a6bffcb371bb08bdfb182db9d2b (patch)
tree3be12a89b7a5377a31a46b48e672e08af36ac949 /apps/recorder/albumart.c
parent0dc5cc8002e3d30fc7ae7ddf7f33a56c8b136e7e (diff)
downloadrockbox-3b75c86d74937a6bffcb371bb08bdfb182db9d2b.tar.gz
rockbox-3b75c86d74937a6bffcb371bb08bdfb182db9d2b.zip
A bit mroe wps/skin engine cleanup so that the structs the wps uses can be static:
-add wrappers wps_data_load() and wps_data_init() so that other code doesn't need the structs for that -change (and rename) gui_sync_wps_uses_albumart() to take points to be filled as parameter to get the AA size of a wps git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22139 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/albumart.c')
-rw-r--r--apps/recorder/albumart.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index f1315da71f..4507923144 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -28,6 +28,7 @@
28#include "dircache.h" 28#include "dircache.h"
29#include "misc.h" 29#include "misc.h"
30#include "settings.h" 30#include "settings.h"
31#include "wps.h"
31 32
32/* Define LOGF_ENABLE to enable logf output in this file */ 33/* Define LOGF_ENABLE to enable logf output in this file */
33/*#define LOGF_ENABLE*/ 34/*#define LOGF_ENABLE*/
@@ -279,16 +280,16 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen)
279 return false; 280 return false;
280 281
281 char size_string[9]; 282 char size_string[9];
282 struct wps_data *data = gui_wps[0].data; 283 int width = 0, height = 0;
283 284
284 if (!data) 285 if (!wps_uses_albumart(&width, &height))
285 return false; 286 return false;
286 287
287 logf("Looking for album art for %s", id3->path); 288 logf("Looking for album art for %s", id3->path);
288 289
289 /* Write the size string, e.g. ".100x100". */ 290 /* Write the size string, e.g. ".100x100". */
290 snprintf(size_string, sizeof(size_string), ".%dx%d", 291 snprintf(size_string, sizeof(size_string), ".%dx%d",
291 data->albumart_max_width, data->albumart_max_height); 292 width, height);
292 293
293 /* First we look for a bitmap of the right size */ 294 /* First we look for a bitmap of the right size */
294 if (search_albumart_files(id3, size_string, buf, buflen)) 295 if (search_albumart_files(id3, size_string, buf, buflen))
@@ -372,9 +373,14 @@ void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
372void get_albumart_size(struct bitmap *bmp) 373void get_albumart_size(struct bitmap *bmp)
373{ 374{
374 /* FIXME: What should we do with albumart on remote? */ 375 /* FIXME: What should we do with albumart on remote? */
375 struct wps_data *data = gui_wps[0].data; 376 int width, height;
376 377
377 bmp->width = data->albumart_max_width; 378 if (!wps_uses_albumart(&width, &height))
378 bmp->height = data->albumart_max_height; 379 {
380 width = 0; height = 0;
381 }
382
383 bmp->width = width;
384 bmp->height = height;
379} 385}
380#endif /* PLUGIN */ 386#endif /* PLUGIN */