summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-12-10 21:07:06 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-12-10 21:07:06 +0000
commit16be6567b6dcd66dabf8b1e7f3a84ac358589c16 (patch)
tree472bc0c108895f7ab56937973c33430d4b8f1a3d /apps/plugins
parent804dc810803863bd6062227be4289c073ecfbe06 (diff)
downloadrockbox-16be6567b6dcd66dabf8b1e7f3a84ac358589c16.zip
rockbox-16be6567b6dcd66dabf8b1e7f3a84ac358589c16.tar.gz
rockbox-16be6567b6dcd66dabf8b1e7f3a84ac358589c16.tar.bz2
rockbox-16be6567b6dcd66dabf8b1e7f3a84ac358589c16.tar.xz
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
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/bitmaps/native/SOURCES12
-rw-r--r--apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp (renamed from apps/plugins/bitmaps/native/pictureflow_emptyslide.bmp)bin30054 -> 30054 bytes
-rw-r--r--apps/plugins/bitmaps/native/pictureflow_emptyslide.50x50x16.bmpbin0 -> 7654 bytes
-rw-r--r--apps/plugins/bitmaps/native/pictureflow_logo.100x18x16.bmpbin0 -> 5454 bytes
-rw-r--r--apps/plugins/bitmaps/native/pictureflow_logo.193x34x16.bmp (renamed from apps/plugins/bitmaps/native/pictureflow_logo.bmp)bin19776 -> 19776 bytes
-rw-r--r--apps/plugins/pictureflow.c50
6 files changed, 50 insertions, 12 deletions
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 5a36ec0..1acc903 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -512,8 +512,16 @@ matrix_normal.bmp
/* pictureflow */
#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
-pictureflow_logo.bmp
-pictureflow_emptyslide.bmp
+#if (LCD_WIDTH < 200)
+ 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 /* HAVE_LCD_BITMAP */
diff --git a/apps/plugins/bitmaps/native/pictureflow_emptyslide.bmp b/apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp
index ff59a4f..ff59a4f 100644
--- a/apps/plugins/bitmaps/native/pictureflow_emptyslide.bmp
+++ b/apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/pictureflow_emptyslide.50x50x16.bmp b/apps/plugins/bitmaps/native/pictureflow_emptyslide.50x50x16.bmp
new file mode 100644
index 0000000..dc7cd55
--- /dev/null
+++ b/apps/plugins/bitmaps/native/pictureflow_emptyslide.50x50x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/pictureflow_logo.100x18x16.bmp b/apps/plugins/bitmaps/native/pictureflow_logo.100x18x16.bmp
new file mode 100644
index 0000000..815c5d6
--- /dev/null
+++ b/apps/plugins/bitmaps/native/pictureflow_logo.100x18x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/pictureflow_logo.bmp b/apps/plugins/bitmaps/native/pictureflow_logo.193x34x16.bmp
index 174c5f1..174c5f1 100644
--- a/apps/plugins/bitmaps/native/pictureflow_logo.bmp
+++ b/apps/plugins/bitmaps/native/pictureflow_logo.193x34x16.bmp
Binary files differ
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c
index 9d4294e..49c5692 100644
--- a/apps/plugins/pictureflow.c
+++ b/apps/plugins/pictureflow.c
@@ -77,8 +77,13 @@ const struct button_mapping *plugin_contexts[]
#define MAX_IMG_WIDTH LCD_WIDTH
#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_HEIGHT 100
+#endif
#define BUFFER_WIDTH LCD_WIDTH
#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)
{
- int txt_w, txt_h;
struct screen* display = rb->screens[0];
rb->lcd_set_background(LCD_RGBPACK(0,0,0));
@@ -485,10 +489,7 @@ void draw_splashscreen(void)
rb->lcd_clear_display();
const struct picture* logo = &(logos[display->screen_type]);
- picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 20);
-
- rb->lcd_getstringsize("Preparing album artwork", &txt_w, &txt_h);
- rb->lcd_putsxy((LCD_WIDTH - txt_w)/2, 100, "Preparing album artwork");
+ picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 10);
rb->lcd_update();
}
@@ -499,11 +500,18 @@ void draw_splashscreen(void)
*/
void draw_progressbar(int step)
{
+ int txt_w, txt_h;
const int bar_height = 22;
const int w = LCD_WIDTH - 20;
- const int y = 130;
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_drawrect(x, y, w+2, bar_height);
rb->lcd_set_foreground(LCD_RGBPACK(165, 231, 82));
@@ -1576,7 +1584,10 @@ int main(void)
long update_interval = 100;
int fps = 0;
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) {
current_update = *rb->current_tick;
@@ -1597,14 +1608,33 @@ int main(void)
}
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_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->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);
switch (button) {