1
0
Fork 0
forked from len0rd/rockbox

PictureFlow improvements by Jonas Hurrelmann:

* Scrolling and fading album titles
* Better support for small displays

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15908 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nicolas Pennequin 2007-12-10 21:07:06 +00:00
parent 804dc81080
commit 16be6567b6
6 changed files with 50 additions and 12 deletions

View file

@ -512,8 +512,16 @@ matrix_normal.bmp
/* pictureflow */ /* pictureflow */
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE) #if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
pictureflow_logo.bmp #if (LCD_WIDTH < 200)
pictureflow_emptyslide.bmp pictureflow_logo.100x18x16.bmp
#else
pictureflow_logo.193x34x16.bmp
#endif
#if (LCD_HEIGHT < 200 )
pictureflow_emptyslide.50x50x16.bmp
#else
pictureflow_emptyslide.100x100x16.bmp
#endif
#endif #endif
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

@ -77,8 +77,13 @@ const struct button_mapping *plugin_contexts[]
#define MAX_IMG_WIDTH LCD_WIDTH #define MAX_IMG_WIDTH LCD_WIDTH
#define MAX_IMG_HEIGHT LCD_HEIGHT #define MAX_IMG_HEIGHT LCD_HEIGHT
#if (LCD_WIDTH < 200)
#define PREFERRED_IMG_WIDTH 50
#define PREFERRED_IMG_HEIGHT 50
#else
#define PREFERRED_IMG_WIDTH 100 #define PREFERRED_IMG_WIDTH 100
#define PREFERRED_IMG_HEIGHT 100 #define PREFERRED_IMG_HEIGHT 100
#endif
#define BUFFER_WIDTH LCD_WIDTH #define BUFFER_WIDTH LCD_WIDTH
#define BUFFER_HEIGHT LCD_HEIGHT #define BUFFER_HEIGHT LCD_HEIGHT
@ -477,7 +482,6 @@ bool get_albumart_for_index_from_db(int slide_index, char *buf, int buflen)
*/ */
void draw_splashscreen(void) void draw_splashscreen(void)
{ {
int txt_w, txt_h;
struct screen* display = rb->screens[0]; struct screen* display = rb->screens[0];
rb->lcd_set_background(LCD_RGBPACK(0,0,0)); rb->lcd_set_background(LCD_RGBPACK(0,0,0));
@ -485,10 +489,7 @@ void draw_splashscreen(void)
rb->lcd_clear_display(); rb->lcd_clear_display();
const struct picture* logo = &(logos[display->screen_type]); const struct picture* logo = &(logos[display->screen_type]);
picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 20); picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 10);
rb->lcd_getstringsize("Preparing album artwork", &txt_w, &txt_h);
rb->lcd_putsxy((LCD_WIDTH - txt_w)/2, 100, "Preparing album artwork");
rb->lcd_update(); rb->lcd_update();
} }
@ -499,11 +500,18 @@ void draw_splashscreen(void)
*/ */
void draw_progressbar(int step) void draw_progressbar(int step)
{ {
int txt_w, txt_h;
const int bar_height = 22; const int bar_height = 22;
const int w = LCD_WIDTH - 20; const int w = LCD_WIDTH - 20;
const int y = 130;
const int x = 10; const int x = 10;
rb->lcd_getstringsize("Preparing album artwork", &txt_w, &txt_h);
int y = (LCD_HEIGHT - txt_h)/2;
rb->lcd_putsxy((LCD_WIDTH - txt_w)/2, y, "Preparing album artwork");
y += (txt_h + 5);
rb->lcd_set_foreground(LCD_RGBPACK(100,100,100)); rb->lcd_set_foreground(LCD_RGBPACK(100,100,100));
rb->lcd_drawrect(x, y, w+2, bar_height); rb->lcd_drawrect(x, y, w+2, bar_height);
rb->lcd_set_foreground(LCD_RGBPACK(165, 231, 82)); rb->lcd_set_foreground(LCD_RGBPACK(165, 231, 82));
@ -1576,7 +1584,10 @@ int main(void)
long update_interval = 100; long update_interval = 100;
int fps = 0; int fps = 0;
int albumtxt_w, albumtxt_h; int albumtxt_w, albumtxt_h;
int ret; int albumtxt_x = 0, albumtxt_y = 0;
int albumtxt_dir = -1;
int ret, c;
int prev_center_index = -1;
while (true) { while (true) {
current_update = *rb->current_tick; current_update = *rb->current_tick;
@ -1597,14 +1608,33 @@ int main(void)
} }
albumtxt = get_album_name(center_index); albumtxt = get_album_name(center_index);
rb->lcd_set_foreground(LCD_RGBPACK(255, 255, 255)); if ( animation_is_active ) {
c = ((slide_frame & 0xffff )/ 256);
if (step > 0) c = 255-c;
}
else c= 255;
rb->lcd_set_foreground(LCD_RGBPACK(c,c,c));
rb->lcd_getstringsize(albumtxt, &albumtxt_w, &albumtxt_h); rb->lcd_getstringsize(albumtxt, &albumtxt_w, &albumtxt_h);
rb->lcd_putsxy((LCD_WIDTH - albumtxt_w) /2, LCD_HEIGHT-albumtxt_h-10, albumtxt); if (center_index != prev_center_index) {
albumtxt_x = 0;
albumtxt_dir = -1;
albumtxt_y = LCD_HEIGHT-albumtxt_h-10;
prev_center_index = center_index;
}
if (albumtxt_w > LCD_WIDTH && ! animation_is_active ) {
rb->lcd_putsxy(albumtxt_x, albumtxt_y , albumtxt);
if ( albumtxt_w + albumtxt_x <= LCD_WIDTH ) albumtxt_dir = 1;
else if ( albumtxt_x >= 0 ) albumtxt_dir = -1;
albumtxt_x += albumtxt_dir;
}
else {
rb->lcd_putsxy((LCD_WIDTH - albumtxt_w) /2, albumtxt_y , albumtxt);
}
rb->lcd_update(); rb->lcd_update();
rb->yield(); rb->yield();
button = pluginlib_getaction(rb, animation_is_active ? 0 : HZ/10, button = pluginlib_getaction(rb, animation_is_active ? 0 : HZ/16,
plugin_contexts, NB_ACTION_CONTEXTS); plugin_contexts, NB_ACTION_CONTEXTS);
switch (button) { switch (button) {