Index: apps/plugins/pictureflow.c =================================================================== --- apps/plugins/pictureflow.c (Revision 15944) +++ apps/plugins/pictureflow.c (Arbeitskopie) @@ -181,6 +181,7 @@ int extra_spacing_for_center_slide; int show_slides; int zoom; + int show_album_name; /* 0 = hide, 1 = top, 2 = bottom */ }; /** below we allocate the memory we want to use **/ @@ -1529,7 +1530,20 @@ return true; } +/** + Shows the album name setting menu +*/ +int album_name_menu(void) { + int selection = config.show_album_name; + MENUITEM_STRINGLIST(album_name_menu,"Show album titles",NULL, + "Hide album title", "Show at the bottom", "Show at the top"); + rb->do_menu(&album_name_menu,&selection); + config.show_album_name = selection; + return GO_TO_PREVIOUS; +} + + /** Shows the settings menu */ @@ -1538,7 +1552,7 @@ MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, "Show FPS", "Spacing", "Center margin", "Number of slides", "Zoom", - "Rebuild cache"); + "Show album titles", "Rebuild cache"); do { selection=rb->do_menu(&settings_menu,&selection); @@ -1571,13 +1585,17 @@ break; case 4: - rb->set_int("Number of slides", "", 1, &(config.zoom), + rb->set_int("Zoom", "", 1, &(config.zoom), NULL, 1, 10, 300, NULL ); recalc_table(); reset_slides(); break; - case 5: + album_name_menu(); + recalc_table(); + reset_slides(); + break; + case 6: rb->remove(CACHE_PREFIX "/ready"); rb->remove(EMPTY_SLIDE); rb->splash(HZ, "Cache will be rebuilt on next restart"); @@ -1635,6 +1653,7 @@ config.show_slides = 3; config.avg_album_width = 0; config.zoom = 100; + config.show_album_name = 1; } /** @@ -1761,7 +1780,9 @@ reset_track_list(); } static int titletxt_w, titletxt_h, titletxt_y, titletxt_x, i, color; - titletxt_y = 0; + /* adjust track list a bit downwards whem album title is set to be shown at the top + OR fps show fps is enabled */ + titletxt_y = (config.show_album_name == 2 || show_fps ? 30 : 0); int track_i; for (i=0; i < track_list_visible_entries; i++) { track_i = i+start_index_track_list; @@ -1844,8 +1865,7 @@ albumtxt_dir = -1; prev_center_index = center_index; } - albumtxt_y = LCD_HEIGHT-albumtxt_h-10; - + albumtxt_y = ((config.show_album_name == 1) ? (LCD_HEIGHT-albumtxt_h-10) : 10); if (albumtxt_w > LCD_WIDTH ) { rb->lcd_putsxy(albumtxt_x, albumtxt_y , albumtxt); if ( pf_state == pf_idle || pf_state == pf_show_tracks ) { @@ -1945,6 +1965,7 @@ reset_slides(); char fpstxt[10]; + int fpstxt_w, fpstxt_h; int button; #ifdef HAVE_ADJUSTABLE_CPU_FREQ @@ -1991,6 +2012,7 @@ break; } + rb->lcd_getstringsize(fpstxt, &fpstxt_w, &fpstxt_h); /* Calculate FPS */ if (current_update - last_update > update_interval) { fps = frames * HZ / (current_update - last_update); @@ -2002,10 +2024,13 @@ if (show_fps) { rb->lcd_set_foreground(LCD_RGBPACK(255, 0, 0)); rb->snprintf(fpstxt, sizeof(fpstxt), "FPS: %d", fps); - rb->lcd_putsxy(0, 0, fpstxt); + /* move fps text to the bottom, when the album + titles are set to be shown at the top */ + rb->lcd_putsxy(0, (config.show_album_name == 2 ? (LCD_HEIGHT-fpstxt_h) : 0), fpstxt); } - draw_album_text(); + if (config.show_album_name) /* Don't draw when album names are hidden */ + draw_album_text(); /* Copy offscreen buffer to LCD and give time to other threads */