diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-10 11:48:23 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-10 11:48:23 +0000 |
commit | cdc2c3b653e0d9bd01d1af3dbd7cd568de1a32e9 (patch) | |
tree | a090ea7c1a0de1389e584a9e37dbcc4dfcafe3b0 | |
parent | 6a86036e90508bd319c56370967e24eb7f59771a (diff) | |
download | rockbox-cdc2c3b653e0d9bd01d1af3dbd7cd568de1a32e9.tar.gz rockbox-cdc2c3b653e0d9bd01d1af3dbd7cd568de1a32e9.zip |
Enable all Rockbox supported formats for the database command line
utility.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11499 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/metadata.c | 26 | ||||
-rw-r--r-- | tools/Makefile | 5 |
2 files changed, 16 insertions, 15 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index 845536877c..03141d05c7 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -559,7 +559,7 @@ static bool get_vorbis_metadata(int fd, struct mp3entry* id3) | |||
559 | */ | 559 | */ |
560 | 560 | ||
561 | /* Use the path name of the id3 structure as a temporary buffer. */ | 561 | /* Use the path name of the id3 structure as a temporary buffer. */ |
562 | unsigned char* buf = id3->path; | 562 | unsigned char* buf = (unsigned char *)id3->path; |
563 | long comment_size; | 563 | long comment_size; |
564 | long remaining = 0; | 564 | long remaining = 0; |
565 | long last_serial = 0; | 565 | long last_serial = 0; |
@@ -754,7 +754,7 @@ static bool get_flac_metadata(int fd, struct mp3entry* id3) | |||
754 | */ | 754 | */ |
755 | 755 | ||
756 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 756 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
757 | unsigned char* buf = id3->path; | 757 | unsigned char* buf = (unsigned char *)id3->path; |
758 | bool rc = false; | 758 | bool rc = false; |
759 | 759 | ||
760 | if (!skip_id3v2(fd, id3) || (read(fd, buf, 4) < 4)) | 760 | if (!skip_id3v2(fd, id3) || (read(fd, buf, 4) < 4)) |
@@ -842,7 +842,7 @@ static bool get_flac_metadata(int fd, struct mp3entry* id3) | |||
842 | static bool get_wave_metadata(int fd, struct mp3entry* id3) | 842 | static bool get_wave_metadata(int fd, struct mp3entry* id3) |
843 | { | 843 | { |
844 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 844 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
845 | unsigned char* buf = id3->path; | 845 | unsigned char* buf = (unsigned char *)id3->path; |
846 | unsigned long totalsamples = 0; | 846 | unsigned long totalsamples = 0; |
847 | unsigned long channels = 0; | 847 | unsigned long channels = 0; |
848 | unsigned long bitspersample = 0; | 848 | unsigned long bitspersample = 0; |
@@ -1375,10 +1375,10 @@ static bool get_musepack_metadata(int fd, struct mp3entry *id3) | |||
1375 | /* Write replaygain values to strings for use in id3 screen. We use | 1375 | /* Write replaygain values to strings for use in id3 screen. We use |
1376 | the XING header as buffer space since Musepack files shouldn't | 1376 | the XING header as buffer space since Musepack files shouldn't |
1377 | need to use it in any other way */ | 1377 | need to use it in any other way */ |
1378 | id3->track_gain_string = id3->toc; | 1378 | id3->track_gain_string = (char *)id3->toc; |
1379 | bufused = snprintf(id3->track_gain_string, 45, | 1379 | bufused = snprintf(id3->track_gain_string, 45, |
1380 | "%d.%d dB", track_gain/100, abs(track_gain)%100); | 1380 | "%d.%d dB", track_gain/100, abs(track_gain)%100); |
1381 | id3->album_gain_string = id3->toc + bufused + 1; | 1381 | id3->album_gain_string = (char *)id3->toc + bufused + 1; |
1382 | bufused = snprintf(id3->album_gain_string, 45, | 1382 | bufused = snprintf(id3->album_gain_string, 45, |
1383 | "%d.%d dB", album_gain/100, abs(album_gain)%100); | 1383 | "%d.%d dB", album_gain/100, abs(album_gain)%100); |
1384 | } | 1384 | } |
@@ -1422,7 +1422,7 @@ static bool get_musepack_metadata(int fd, struct mp3entry *id3) | |||
1422 | static bool get_sid_metadata(int fd, struct mp3entry* id3) | 1422 | static bool get_sid_metadata(int fd, struct mp3entry* id3) |
1423 | { | 1423 | { |
1424 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 1424 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
1425 | unsigned char* buf = id3->path; | 1425 | unsigned char* buf = (unsigned char *)id3->path; |
1426 | int read_bytes; | 1426 | int read_bytes; |
1427 | char *p; | 1427 | char *p; |
1428 | 1428 | ||
@@ -1433,7 +1433,7 @@ static bool get_sid_metadata(int fd, struct mp3entry* id3) | |||
1433 | return false; | 1433 | return false; |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | if ((memcmp(buf, "PSID",4) != 0)) | 1436 | if ((memcmp(buf, "PSID",4) != 0)) |
1437 | { | 1437 | { |
1438 | return false; | 1438 | return false; |
1439 | } | 1439 | } |
@@ -1441,12 +1441,12 @@ static bool get_sid_metadata(int fd, struct mp3entry* id3) | |||
1441 | p = id3->id3v2buf; | 1441 | p = id3->id3v2buf; |
1442 | 1442 | ||
1443 | /* Copy Title */ | 1443 | /* Copy Title */ |
1444 | strcpy(p, &buf[0x16]); | 1444 | strcpy(p, (char *)&buf[0x16]); |
1445 | id3->title = p; | 1445 | id3->title = p; |
1446 | p += strlen(p)+1; | 1446 | p += strlen(p)+1; |
1447 | 1447 | ||
1448 | /* Copy Artist */ | 1448 | /* Copy Artist */ |
1449 | strcpy(p, &buf[0x36]); | 1449 | strcpy(p, (char *)&buf[0x36]); |
1450 | id3->artist = p; | 1450 | id3->artist = p; |
1451 | p += strlen(p)+1; | 1451 | p += strlen(p)+1; |
1452 | 1452 | ||
@@ -1466,7 +1466,7 @@ static bool get_sid_metadata(int fd, struct mp3entry* id3) | |||
1466 | static bool get_adx_metadata(int fd, struct mp3entry* id3) | 1466 | static bool get_adx_metadata(int fd, struct mp3entry* id3) |
1467 | { | 1467 | { |
1468 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 1468 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
1469 | unsigned char * buf = id3->path; | 1469 | unsigned char * buf = (unsigned char *)id3->path; |
1470 | int chanstart, channels, read_bytes; | 1470 | int chanstart, channels, read_bytes; |
1471 | int looping = 0, start_adr = 0, end_adr = 0; | 1471 | int looping = 0, start_adr = 0, end_adr = 0; |
1472 | 1472 | ||
@@ -1578,7 +1578,7 @@ static bool get_adx_metadata(int fd, struct mp3entry* id3) | |||
1578 | static bool get_aiff_metadata(int fd, struct mp3entry* id3) | 1578 | static bool get_aiff_metadata(int fd, struct mp3entry* id3) |
1579 | { | 1579 | { |
1580 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 1580 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
1581 | unsigned char* buf = id3->path; | 1581 | unsigned char* buf = (unsigned char *)id3->path; |
1582 | unsigned long numChannels = 0; | 1582 | unsigned long numChannels = 0; |
1583 | unsigned long numSampleFrames = 0; | 1583 | unsigned long numSampleFrames = 0; |
1584 | unsigned long sampleSize = 0; | 1584 | unsigned long sampleSize = 0; |
@@ -1751,7 +1751,7 @@ bool get_metadata(struct track_info* track, int fd, const char* trackname, | |||
1751 | */ | 1751 | */ |
1752 | 1752 | ||
1753 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 1753 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
1754 | buf = track->id3.path; | 1754 | buf = (unsigned char *)track->id3.path; |
1755 | 1755 | ||
1756 | for (i = 0; i < 256; ++i) { | 1756 | for (i = 0; i < 256; ++i) { |
1757 | 1757 | ||
@@ -1803,7 +1803,7 @@ bool get_metadata(struct track_info* track, int fd, const char* trackname, | |||
1803 | 1803 | ||
1804 | case AFMT_A52: | 1804 | case AFMT_A52: |
1805 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 1805 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
1806 | buf = track->id3.path; | 1806 | buf = (unsigned char *)track->id3.path; |
1807 | 1807 | ||
1808 | if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, buf, 5) < 5)) | 1808 | if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, buf, 5) < 5)) |
1809 | { | 1809 | { |
diff --git a/tools/Makefile b/tools/Makefile index d6c885d85b..e477f7fc43 100644 --- a/tools/Makefile +++ b/tools/Makefile | |||
@@ -41,9 +41,10 @@ ipod_fw: ipod_fw.c | |||
41 | database: database.c ../apps/tagcache.c ../apps/metadata.c \ | 41 | database: database.c ../apps/tagcache.c ../apps/metadata.c \ |
42 | ../firmware/id3.c ../firmware/common/unicode.c \ | 42 | ../firmware/id3.c ../firmware/common/unicode.c \ |
43 | ../firmware/common/crc32.c ../uisimulator/common/io.c \ | 43 | ../firmware/common/crc32.c ../uisimulator/common/io.c \ |
44 | ../firmware/mp3data.c ../firmware/logf.c | 44 | ../firmware/mp3data.c ../firmware/logf.c ../firmware/replaygain.c |
45 | $(SILENT)$(CC) -g -I../firmware/export -iquote ../firmware/include \ | 45 | $(SILENT)$(CC) -g -I../firmware/export -iquote ../firmware/include \ |
46 | -D__PCTOOL__ -DHAVE_TAGCACHE -DROCKBOX_HAS_LOGF -DSIMULATOR -ldl -I../apps $+ -o $@ | 46 | -D__PCTOOL__ -DHAVE_TAGCACHE -DROCKBOX_HAS_LOGF -DSIMULATOR \ |
47 | -DCONFIG_CODEC=1 -ldl -I../apps $+ -o $@ | ||
47 | 48 | ||
48 | convbdf: convbdf.c | 49 | convbdf: convbdf.c |
49 | $(SILENT)$(CC) -g $+ -o $@ | 50 | $(SILENT)$(CC) -g $+ -o $@ |