diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-11 12:29:37 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-11 12:29:37 +0000 |
commit | 9d4bed7ff06818b098926932db824a8d6532bfee (patch) | |
tree | 0a1cfa6a98a75a2badc1a8d2a2d7839454522beb /apps/gui/gwps-common.c | |
parent | f34720b163aff1d167ae031f23f3250356aa2c1b (diff) | |
download | rockbox-9d4bed7ff06818b098926932db824a8d6532bfee.tar.gz rockbox-9d4bed7ff06818b098926932db824a8d6532bfee.zip |
Album art support. Based on FS#3045, but heavily modified to adapt to MoB and for cleanness.
The cover pictures are loaded from external bitmaps. JPEG and embedded art are not supported. The pictures will only be drawn on the main display. There is no resizing but it is possible to specify the WPS bitmap size in the bitmap names (e.g. cover.100x100.bmp).
The bitmaps are stored in the main buffer and read directly from there. Currently, duplicate bitmaps will simply be present several times in the buffer, but this will be improved.
To enable for a target, #define HAVE_ALBUMART in its config file.
For more information, see the wiki page: http://www.rockbox.org/wiki/AlbumArt.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15572 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r-- | apps/gui/gwps-common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index fec13d564f..3c29884260 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -48,6 +48,7 @@ | |||
48 | /* Image stuff */ | 48 | /* Image stuff */ |
49 | #include "bmp.h" | 49 | #include "bmp.h" |
50 | #include "atoi.h" | 50 | #include "atoi.h" |
51 | #include "albumart.h" | ||
51 | #endif | 52 | #endif |
52 | #include "dsp.h" | 53 | #include "dsp.h" |
53 | #include "action.h" | 54 | #include "action.h" |
@@ -929,6 +930,19 @@ static char *get_token_value(struct gui_wps *gwps, | |||
929 | case WPS_TOKEN_METADATA_COMMENT: | 930 | case WPS_TOKEN_METADATA_COMMENT: |
930 | return id3->comment; | 931 | return id3->comment; |
931 | 932 | ||
933 | #ifdef HAVE_ALBUMART | ||
934 | case WPS_TOKEN_ALBUMART_DISPLAY: | ||
935 | draw_album_art(gwps, audio_current_aa_hid()); | ||
936 | return NULL; | ||
937 | |||
938 | case WPS_TOKEN_ALBUMART_FOUND: | ||
939 | if (audio_current_aa_hid() >= 0) { | ||
940 | snprintf(buf, buf_size, "C"); | ||
941 | return buf; | ||
942 | } | ||
943 | return NULL; | ||
944 | #endif | ||
945 | |||
932 | case WPS_TOKEN_FILE_BITRATE: | 946 | case WPS_TOKEN_FILE_BITRATE: |
933 | if(id3->bitrate) | 947 | if(id3->bitrate) |
934 | snprintf(buf, buf_size, "%d", id3->bitrate); | 948 | snprintf(buf, buf_size, "%d", id3->bitrate); |