From 20f76d61ae58bd47b647d79e40beebbbe747e480 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Mon, 4 May 2009 15:46:41 +0000 Subject: Make JPEG and BMP scaler optional with HAVE_JPEG and HAVE_BMP_SCALING, both defined for all targets that have HAVE_ALBUMART. Disable JPEG in PictureFlow and pluginlib album art search with 32KiB plugin buffer until PictureFlow gets overlay support. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20851 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/albumart.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'apps/recorder/albumart.c') diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 3adedc8159..da85f99bbc 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -91,7 +91,7 @@ static void fix_path_part(char* path, int offset, int count) } } -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) const char * extensions[] = { "jpeg", "jpg", "bmp" }; int extension_lens[] = { 4, 3, 3 }; /* Try checking for several file extensions, return true if a file is found and @@ -134,7 +134,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, const char *artist; int dirlen; int albumlen; -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) int pathlen; #endif @@ -153,7 +153,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, /* the first file we look for is one specific to the track playing */ strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname); strcat(path, size_string); -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) strcat(path, "."); pathlen = strlen(path); found = try_exts(path, pathlen); @@ -165,7 +165,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, { /* if it doesn't exist, * we look for a file specific to the track's album name */ -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) pathlen = snprintf(path, sizeof(path), "%s%s%s.", dir, id3->album, size_string); fix_path_part(path, dirlen, albumlen); @@ -181,7 +181,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, if (!found) { /* if it still doesn't exist, we look for a generic file */ -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) pathlen = snprintf(path, sizeof(path), "%scover%s.", dir, size_string); found = try_exts(path, pathlen); @@ -192,7 +192,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, #endif } -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) if (!found) { snprintf (path, sizeof(path), "%sfolder.jpg", dir); @@ -205,7 +205,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, if (!found && artist && id3->album) { /* look in the albumart subdir of .rockbox */ -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) pathlen = snprintf(path, sizeof(path), ROCKBOX_DIR "/albumart/%s-%s%s.", artist, @@ -241,7 +241,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, { /* we look in the parent directory * for a file specific to the track's album name */ -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) pathlen = snprintf(path, sizeof(path), "%s%s%s.", dir, id3->album, size_string); fix_path_part(path, dirlen, albumlen); @@ -258,7 +258,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, { /* if it still doesn't exist, we look in the parent directory * for a generic file */ -#if LCD_DEPTH > 1 +#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) pathlen = snprintf(path, sizeof(path), "%scover%s.", dir, size_string); found = try_exts(path, pathlen); @@ -278,7 +278,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, return true; } -#ifdef HAVE_ALBUMART +#ifndef PLUGIN /* Look for albumart bitmap in the same dir as the track and in its parent dir. * Stores the found filename in the buf parameter. * Returns true if a bitmap was found, false otherwise */ @@ -386,4 +386,4 @@ void get_albumart_size(struct bitmap *bmp) bmp->width = data->albumart_max_width; bmp->height = data->albumart_max_height; } -#endif /* HAVE_ALBUMART */ +#endif /* PLUGIN */ -- cgit v1.2.3