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:
parent
19f487b451
commit
90ce826903
11 changed files with 1677 additions and 4 deletions
|
@ -532,6 +532,38 @@ static const struct plugin_api rockbox_api = {
|
|||
remote_backlight_set_timeout_plugged,
|
||||
#endif
|
||||
#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)
|
||||
|
|
|
@ -78,6 +78,9 @@
|
|||
#include "list.h"
|
||||
#include "tree.h"
|
||||
#include "color_picker.h"
|
||||
#include "buffering.h"
|
||||
#include "tagcache.h"
|
||||
#include "albumart.h"
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
#include "lcd-remote.h"
|
||||
|
@ -655,6 +658,42 @@ struct plugin_api {
|
|||
void (*remote_backlight_set_timeout_plugged)(int index);
|
||||
#endif
|
||||
#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 */
|
||||
|
|
|
@ -47,6 +47,7 @@ mpegplayer,viewers
|
|||
nim,games
|
||||
oscilloscope,demos
|
||||
pacbox,games
|
||||
pictureflow,demos
|
||||
plasma,demos
|
||||
pong,games
|
||||
properties,viewers
|
||||
|
|
|
@ -136,6 +136,10 @@ splitedit.c
|
|||
matrix.c
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
|
||||
pictureflow.c
|
||||
#endif
|
||||
|
||||
/* Platform-specific plugins */
|
||||
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
|
||||
iriverify.c
|
||||
|
|
|
@ -510,4 +510,10 @@ matrix_bold.bmp
|
|||
matrix_normal.bmp
|
||||
#endif
|
||||
|
||||
/* pictureflow */
|
||||
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
|
||||
pictureflow_logo.bmp
|
||||
pictureflow_emptyslide.bmp
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
|
BIN
apps/plugins/bitmaps/native/pictureflow_emptyslide.bmp
Normal file
BIN
apps/plugins/bitmaps/native/pictureflow_emptyslide.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
apps/plugins/bitmaps/native/pictureflow_logo.bmp
Normal file
BIN
apps/plugins/bitmaps/native/pictureflow_logo.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
1586
apps/plugins/pictureflow.c
Normal file
1586
apps/plugins/pictureflow.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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.
|
||||
* 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 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);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Then we look for generic bitmaps */
|
||||
*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.
|
||||
|
|
|
@ -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. */
|
||||
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 /* _ALBUMART_H_ */
|
||||
|
|
|
@ -352,6 +352,8 @@ Chris Allegretta
|
|||
Alastair S
|
||||
Gerritt Gonzales
|
||||
Martin Crkovský
|
||||
Ariya Hidayat
|
||||
Jonas Hurrelmann
|
||||
|
||||
The libmad team
|
||||
The wavpack team
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue