1
0
Fork 0
forked from len0rd/rockbox

Initial commit of the PictureFlow plugin, a nice visualization for album covers.

Original code by Ariya Hidayat. Rockbox port by Jonas Hurrelmann and a few tweaks by me.
On the first startup the database is scanned and album art is searched for each album. This process will take some time (dircache enabled and/or database in RAM speed it up, and it is possible to abort by pressing MENU), but the results are cached and the next startups will be very quick.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15900 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nicolas Pennequin 2007-12-09 18:48:02 +00:00
parent 19f487b451
commit 90ce826903
11 changed files with 1677 additions and 4 deletions

View file

@ -532,6 +532,38 @@ static const struct plugin_api rockbox_api = {
remote_backlight_set_timeout_plugged, remote_backlight_set_timeout_plugged,
#endif #endif
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
#if (CONFIG_CODEC == SWCODEC)
bufopen,
bufalloc,
bufclose,
bufseek,
bufadvance,
bufread,
bufgetdata,
bufgettail,
bufcuttail,
buf_get_offset,
buf_handle_offset,
buf_request_buffer_handle,
buf_set_base_handle,
buf_used,
#endif
#ifdef HAVE_TAGCACHE
tagcache_search,
tagcache_search_set_uniqbuf,
tagcache_search_add_filter,
tagcache_get_next,
tagcache_retrieve,
tagcache_search_finish,
#endif
#ifdef HAVE_ALBUMART
find_albumart,
search_albumart_files,
#endif
}; };
int plugin_load(const char* plugin, void* parameter) int plugin_load(const char* plugin, void* parameter)

View file

@ -78,6 +78,9 @@
#include "list.h" #include "list.h"
#include "tree.h" #include "tree.h"
#include "color_picker.h" #include "color_picker.h"
#include "buffering.h"
#include "tagcache.h"
#include "albumart.h"
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h" #include "lcd-remote.h"
@ -655,6 +658,42 @@ struct plugin_api {
void (*remote_backlight_set_timeout_plugged)(int index); void (*remote_backlight_set_timeout_plugged)(int index);
#endif #endif
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
#if (CONFIG_CODEC == SWCODEC)
int (*bufopen)(const char *file, size_t offset, enum data_type type);
int (*bufalloc)(const void *src, size_t size, enum data_type type);
bool (*bufclose)(int handle_id);
int (*bufseek)(int handle_id, size_t newpos);
int (*bufadvance)(int handle_id, off_t offset);
ssize_t (*bufread)(int handle_id, size_t size, void *dest);
ssize_t (*bufgetdata)(int handle_id, size_t size, void **data);
ssize_t (*bufgettail)(int handle_id, size_t size, void **data);
ssize_t (*bufcuttail)(int handle_id, size_t size);
ssize_t (*buf_get_offset)(int handle_id, void *ptr);
ssize_t (*buf_handle_offset)(int handle_id);
void (*buf_request_buffer_handle)(int handle_id);
void (*buf_set_base_handle)(int handle_id);
size_t (*buf_used)(void);
#endif
#ifdef HAVE_TAGCACHE
bool (*tagcache_search)(struct tagcache_search *tcs, int tag);
void (*tagcache_search_set_uniqbuf)(struct tagcache_search *tcs,
void *buffer, long length);
bool (*tagcache_search_add_filter)(struct tagcache_search *tcs,
int tag, int seek);
bool (*tagcache_get_next)(struct tagcache_search *tcs);
bool (*tagcache_retrieve)(struct tagcache_search *tcs, int idxid,
int tag, char *buf, long size);
void (*tagcache_search_finish)(struct tagcache_search *tcs);
#endif
#ifdef HAVE_ALBUMART
bool (*find_albumart)(const struct mp3entry *id3, char *buf, int buflen);
bool (*search_albumart_files)(const struct mp3entry *id3, const char *size_string,
char *buf, int buflen);
#endif
}; };
/* plugin header */ /* plugin header */

View file

@ -47,6 +47,7 @@ mpegplayer,viewers
nim,games nim,games
oscilloscope,demos oscilloscope,demos
pacbox,games pacbox,games
pictureflow,demos
plasma,demos plasma,demos
pong,games pong,games
properties,viewers properties,viewers

View file

@ -136,6 +136,10 @@ splitedit.c
matrix.c matrix.c
#endif #endif
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
pictureflow.c
#endif
/* Platform-specific plugins */ /* Platform-specific plugins */
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
iriverify.c iriverify.c

View file

@ -510,4 +510,10 @@ matrix_bold.bmp
matrix_normal.bmp matrix_normal.bmp
#endif #endif
/* pictureflow */
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
pictureflow_logo.bmp
pictureflow_emptyslide.bmp
#endif
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

1586
apps/plugins/pictureflow.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -125,7 +125,7 @@ static void fix_path_part(char* path, int offset, int count)
* If a matching bitmap is found, its filename is stored in buf. * If a matching bitmap is found, its filename is stored in buf.
* Return value is true if a bitmap was found, false otherwise. * Return value is true if a bitmap was found, false otherwise.
*/ */
static bool search_files(const struct mp3entry *id3, const char *size_string, bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
char *buf, int buflen) char *buf, int buflen)
{ {
char path[MAX_PATH + 1]; char path[MAX_PATH + 1];
@ -228,12 +228,12 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen)
data->albumart_max_width, data->albumart_max_height); data->albumart_max_width, data->albumart_max_height);
/* First we look for a bitmap of the right size */ /* First we look for a bitmap of the right size */
if (search_files(id3, size_string, buf, buflen)) if (search_albumart_files(id3, size_string, buf, buflen))
return true; return true;
/* Then we look for generic bitmaps */ /* Then we look for generic bitmaps */
*size_string = 0; *size_string = 0;
return search_files(id3, size_string, buf, buflen); return search_albumart_files(id3, size_string, buf, buflen);
} }
/* Draw the album art bitmap from the given handle ID onto the given WPS. /* Draw the album art bitmap from the given handle ID onto the given WPS.

View file

@ -35,6 +35,9 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen);
Call with clear = true to clear the bitmap instead of drawing it. */ Call with clear = true to clear the bitmap instead of drawing it. */
void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear); void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear);
bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
char *buf, int buflen);
#endif /* HAVE_ALBUMART */ #endif /* HAVE_ALBUMART */
#endif /* _ALBUMART_H_ */ #endif /* _ALBUMART_H_ */

View file

@ -352,6 +352,8 @@ Chris Allegretta
Alastair S Alastair S
Gerritt Gonzales Gerritt Gonzales
Martin Crkovský Martin Crkovský
Ariya Hidayat
Jonas Hurrelmann
The libmad team The libmad team
The wavpack team The wavpack team