summaryrefslogtreecommitdiff
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)
1407 } 1407 }
1408 else { 1408 else {
1409 int x = strlen(entry->d_name); 1409 int x = strlen(entry->d_name);
1410 if ((!strcasecmp(&entry->d_name[x-4], ".mp3")) || 1410 int xl;
1411 (!strcasecmp(&entry->d_name[x-4], ".mp2")) || 1411 unsigned int i;
1412 (!strcasecmp(&entry->d_name[x-4], ".mpa"))) 1412
1413 { 1413 /* add all supported audio files to playlists */
1414 char buf[8]; 1414 for (i=0; i < sizeof(filetypes); i++) {
1415 write(fd, dirname, strlen(dirname)); 1415 if (filetypes[i].tree_attr == TREE_ATTR_MPA) {
1416 write(fd, "/", 1); 1416 xl=strlen(filetypes[i].extension);
1417 write(fd, entry->d_name, x); 1417 if (!strcasecmp(&entry->d_name[x-xl],
1418 write(fd, "\n", 1); 1418 filetypes[i].extension))
1419 1419 {
1420 plsize++; 1420 char buf[8];
1421 snprintf(buf, sizeof buf, "%d", plsize); 1421 write(fd, dirname, strlen(dirname));
1422 write(fd, "/", 1);
1423 write(fd, entry->d_name, x);
1424 write(fd, "\n", 1);
1425
1426 plsize++;
1427 snprintf(buf, sizeof buf, "%d", plsize);
1422#ifdef HAVE_LCD_BITMAP 1428#ifdef HAVE_LCD_BITMAP
1423 lcd_puts(0,4,buf); 1429 lcd_puts(0,4,buf);
1424 lcd_update(); 1430 lcd_update();
1425#else 1431#else
1426 x = 10; 1432 x = 10;
1427 if (plsize > 999) 1433 if (plsize > 999)
1428 x=7; 1434 x=7;
1429 else { 1435 else {
1430 if (plsize > 99) 1436 if (plsize > 99)
1431 x=8; 1437 x=8;
1432 else { 1438 else {
1433 if (plsize > 9) 1439 if (plsize > 9)
1434 x=9; 1440 x=9;
1441 }
1442 }
1443 lcd_puts(x,0,buf);
1444#endif
1435 } 1445 }
1436 } 1446 }
1437 lcd_puts(x,0,buf);
1438#endif
1439 } 1447 }
1440 } 1448 }
1441 } 1449 }
@@ -1461,11 +1469,20 @@ bool create_playlist(void)
1461 if (fd < 0) 1469 if (fd < 0)
1462 return false; 1470 return false;
1463 1471
1472#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1473 cpu_boost(true);
1474#endif
1475
1464 snprintf(filename, sizeof(filename), "%s", 1476 snprintf(filename, sizeof(filename), "%s",
1465 tc.currdir[1] ? tc.currdir : "/"); 1477 tc.currdir[1] ? tc.currdir : "/");
1466 plsize = 0; 1478 plsize = 0;
1467 add_dir(filename, sizeof(filename), fd); 1479 add_dir(filename, sizeof(filename), fd);
1468 close(fd); 1480 close(fd);
1481
1482#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1483 cpu_boost(true);
1484#endif
1485
1469 sleep(HZ); 1486 sleep(HZ);
1470 1487
1471 return true; 1488 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
118Alexander Spyridakis 118Alexander Spyridakis
119Pedro Baltazar Vasconcelos 119Pedro Baltazar Vasconcelos
120Ray Lambert 120Ray Lambert
121Dave Wiard