summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-06-20 09:00:53 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-06-20 09:00:53 +0000
commit9a899213fc1446463bce3e38f7a09a3a82e60e4f (patch)
treef01c8e72ebfe4e7a22d3f4f4d8312c8ab8596eda
parentcf18f96b9953bfb964db670eaae7fc2d8aa8bae5 (diff)
downloadrockbox-9a899213fc1446463bce3e38f7a09a3a82e60e4f.tar.gz
rockbox-9a899213fc1446463bce3e38f7a09a3a82e60e4f.zip
Patch #1223219 by Dave Wiard - Add all supported audio files with Create Playlist
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6772 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tree.c67
-rw-r--r--docs/CREDITS1
2 files changed, 43 insertions, 25 deletions
diff --git a/apps/tree.c b/apps/tree.c
index a147c21e96..09b73484ba 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1407,35 +1407,43 @@ static bool add_dir(char* dirname, int len, int fd)
}
else {
int x = strlen(entry->d_name);
- if ((!strcasecmp(&entry->d_name[x-4], ".mp3")) ||
- (!strcasecmp(&entry->d_name[x-4], ".mp2")) ||
- (!strcasecmp(&entry->d_name[x-4], ".mpa")))
- {
- char buf[8];
- write(fd, dirname, strlen(dirname));
- write(fd, "/", 1);
- write(fd, entry->d_name, x);
- write(fd, "\n", 1);
-
- plsize++;
- snprintf(buf, sizeof buf, "%d", plsize);
+ int xl;
+ unsigned int i;
+
+ /* add all supported audio files to playlists */
+ for (i=0; i < sizeof(filetypes); i++) {
+ if (filetypes[i].tree_attr == TREE_ATTR_MPA) {
+ xl=strlen(filetypes[i].extension);
+ if (!strcasecmp(&entry->d_name[x-xl],
+ filetypes[i].extension))
+ {
+ char buf[8];
+ write(fd, dirname, strlen(dirname));
+ write(fd, "/", 1);
+ write(fd, entry->d_name, x);
+ write(fd, "\n", 1);
+
+ plsize++;
+ snprintf(buf, sizeof buf, "%d", plsize);
#ifdef HAVE_LCD_BITMAP
- lcd_puts(0,4,buf);
- lcd_update();
+ lcd_puts(0,4,buf);
+ lcd_update();
#else
- x = 10;
- if (plsize > 999)
- x=7;
- else {
- if (plsize > 99)
- x=8;
- else {
- if (plsize > 9)
- x=9;
+ x = 10;
+ if (plsize > 999)
+ x=7;
+ else {
+ if (plsize > 99)
+ x=8;
+ else {
+ if (plsize > 9)
+ x=9;
+ }
+ }
+ lcd_puts(x,0,buf);
+#endif
}
}
- lcd_puts(x,0,buf);
-#endif
}
}
}
@@ -1461,11 +1469,20 @@ bool create_playlist(void)
if (fd < 0)
return false;
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ cpu_boost(true);
+#endif
+
snprintf(filename, sizeof(filename), "%s",
tc.currdir[1] ? tc.currdir : "/");
plsize = 0;
add_dir(filename, sizeof(filename), fd);
close(fd);
+
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+ cpu_boost(true);
+#endif
+
sleep(HZ);
return true;
diff --git a/docs/CREDITS b/docs/CREDITS
index 25841204b9..de98748e85 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -118,3 +118,4 @@ Martin Arver
Alexander Spyridakis
Pedro Baltazar Vasconcelos
Ray Lambert
+Dave Wiard