summaryrefslogtreecommitdiff
path: root/apps/plugins/stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/stats.c')
-rw-r--r--apps/plugins/stats.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 388a617b14..11962043c4 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -114,15 +114,6 @@ static bool cancel;
114#error No keymap defined! 114#error No keymap defined!
115#endif 115#endif
116 116
117/* TODO: Better get the exts from the filetypes var in tree.c */
118const char *music_exts[] = {"mp3","mp2","mp1","mpa","ogg","oga",
119 "wav","flac","ac3","a52","mpc","wv","m4a","m4b","mp4",
120 "shn","aif","aiff","wma","wmv","asf","spx","ape","mac",
121 "sid","mod","nsf","nsfe","spc","adx","sap","rm","at3",
122 "ra","rmvb","oma","aa3","dmc","dlt","mpt","mpd","rmt",
123 "tmc","tm8","tm2","cm3","cmc","cmr","cms","mmf","au",
124 "snd","vox","w64"};
125
126void prn(const char *str, int y) 117void prn(const char *str, int y)
127{ 118{
128 rb->lcd_puts(0,y,str); 119 rb->lcd_puts(0,y,str);
@@ -186,17 +177,12 @@ void traversedir(char* location, char* name)
186 dirs++; 177 dirs++;
187 } 178 }
188 else { 179 else {
189 char *ptr = rb->strrchr(entry->d_name,'.'); 180 int attr = rb->filetype_get_attr(entry->d_name);
181 if ((attr & FILE_ATTR_MASK) == FILE_ATTR_AUDIO)
182 {
183 musicfiles++;
184 }
190 files++; files_in_dir++; 185 files++; files_in_dir++;
191 /* Might want to only count .mp3, .ogg etc. */
192 if(ptr){
193 unsigned i;
194 ptr++;
195 for(i=0;i<sizeof(music_exts)/sizeof(char*);i++)
196 if(!rb->strcasecmp(ptr,music_exts[i])){
197 musicfiles++; break;
198 }
199
200 } 186 }
201 } 187 }
202 } 188 }
@@ -222,6 +208,7 @@ void traversedir(char* location, char* name)
222 largestdir = files_in_dir; 208 largestdir = files_in_dir;
223} 209}
224 210
211/* this is the plugin entry point */
225enum plugin_status plugin_start(const void* parameter) 212enum plugin_status plugin_start(const void* parameter)
226{ 213{
227 int button; 214 int button;