diff options
-rw-r--r-- | apps/tree.c | 67 | ||||
-rw-r--r-- | docs/CREDITS | 1 |
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 | |||
118 | Alexander Spyridakis | 118 | Alexander Spyridakis |
119 | Pedro Baltazar Vasconcelos | 119 | Pedro Baltazar Vasconcelos |
120 | Ray Lambert | 120 | Ray Lambert |
121 | Dave Wiard | ||