Index: apps/plugins/stats.c =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/stats.c,v retrieving revision 1.2 diff -u -r1.2 stats.c --- apps/plugins/stats.c 2 Sep 2005 22:25:25 -0000 1.2 +++ apps/plugins/stats.c 5 Nov 2005 15:37:41 -0000 @@ -19,7 +19,7 @@ #include "plugin.h" static struct plugin_api* rb; -static int files, dirs; +static int files, dirs, maxfiles; static int lasttick; static bool abort; #ifdef HAVE_LCD_BITMAP @@ -39,16 +39,21 @@ rb->lcd_clear_display(); rb->lcd_putsxy(0,0,"Files:"); rb->lcd_putsxy(0,fontheight,"Dirs:"); + rb->lcd_putsxy(0,fontheight*2,"Max files:"); rb->snprintf(buf, sizeof(buf), "%d", files); rb->lcd_putsxy(fontwidth,0,buf); rb->snprintf(buf, sizeof(buf), "%d", dirs); rb->lcd_putsxy(fontwidth,fontheight,buf); + rb->snprintf(buf, sizeof(buf), "%d", maxfiles); + rb->lcd_putsxy(fontwidth,fontheight*2,buf); rb->lcd_update(); #else rb->snprintf(buf, sizeof(buf), "Files:%5d", files); rb->lcd_puts(0,0,buf); rb->snprintf(buf, sizeof(buf), "Dirs: %5d", dirs); rb->lcd_puts(0,1,buf); + rb->snprintf(buf, sizeof(buf), "Max files: %5d", maxfiles); + rb->lcd_puts(0,2,buf); #endif } @@ -58,6 +63,7 @@ struct dirent *entry; DIR* dir; char fullpath[MAX_PATH]; + int filesindir = 0; rb->snprintf(fullpath, sizeof(fullpath), "%s/%s", location, name); dir = rb->opendir(fullpath); @@ -74,8 +80,15 @@ dirs += 1; } else + { /* Might want to only count .mp3, .ogg etc. */ files++; + filesindir++; + if (filesindir > maxfiles) + { + maxfiles = filesindir; + } + } } if (*rb->current_tick - lasttick > (HZ/2)) { update_screen(); @@ -103,10 +116,11 @@ rb = api; files = 0; dirs = 0; + maxfiles = 0; abort = false; #ifdef HAVE_LCD_BITMAP - rb->lcd_getstringsize("Files: ", &fontwidth, &fontheight); + rb->lcd_getstringsize("Max files: ", &fontwidth, &fontheight); #endif rb->splash(HZ, true, "Counting.."); update_screen();