From 3b75c86d74937a6bffcb371bb08bdfb182db9d2b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 3 Aug 2009 15:06:30 +0000 Subject: 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 --- apps/recorder/albumart.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'apps/recorder/albumart.c') 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 @@ #include "dircache.h" #include "misc.h" #include "settings.h" +#include "wps.h" /* Define LOGF_ENABLE to enable logf output in this file */ /*#define LOGF_ENABLE*/ @@ -279,16 +280,16 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen) return false; char size_string[9]; - struct wps_data *data = gui_wps[0].data; + int width = 0, height = 0; - if (!data) + if (!wps_uses_albumart(&width, &height)) return false; logf("Looking for album art for %s", id3->path); /* Write the size string, e.g. ".100x100". */ snprintf(size_string, sizeof(size_string), ".%dx%d", - data->albumart_max_width, data->albumart_max_height); + width, height); /* First we look for a bitmap of the right size */ 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) void get_albumart_size(struct bitmap *bmp) { /* FIXME: What should we do with albumart on remote? */ - struct wps_data *data = gui_wps[0].data; + int width, height; - bmp->width = data->albumart_max_width; - bmp->height = data->albumart_max_height; + if (!wps_uses_albumart(&width, &height)) + { + width = 0; height = 0; + } + + bmp->width = width; + bmp->height = height; } #endif /* PLUGIN */ -- cgit v1.2.3