Change log file for FAPG
+version 0.38 (2007-03-13) (by Jonny Bijlsma)
+ * added .txx output (to work with iRiver T-series)
+
version 0.37 (2007-03-07)
* added a --stdin option to act as a filter (read filenames and directories from input)
* trim spaces in artist/title when guessing from filename
-FAPG 0.37 (Fast Audio Playlist Generator)
+FAPG 0.38 (Fast Audio Playlist Generator)
site: http://royale.zerezo.com/fapg/
mail: royale@zerezo.com
make install
usage:
-fapg [-b|--backslash] [-d|--debug] [-f|--format=m3u|pls|html|rss|pla] [-g|--genre=#:#:...] [-o|--output=/path/to/file.m3u] [-p|--prefix=/the/prefix] [-r|--recursive] [-w|--windows] [-x|--exclude=#:#:...] [-c|--command=<intern|...>] [-s|--stdin] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]
+fapg [-b|--backslash] [-d|--debug] [-f|--format=m3u|pls|html|rss|pla|txx] [-g|--genre=#:#:...] [-o|--output=/path/to/file.m3u] [-p|--prefix=/the/prefix] [-r|--recursive] [-w|--windows] [-x|--exclude=#:#:...] [-c|--command=<intern|...>] [-s|--stdin] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]
- backslash : replace the '/' with '\' in Unix path.
- debug : display useful messages if the program fails ;)
- format : choose which format of playlist you want to generate (default is m3u).
Replace the '/' with '\' in Unix path.
.IP -d|--debug
Display useful messages if the program fails ;)
-.IP -f|--format=m3u|pls|html|rss|pla
+.IP -f|--format=m3u|pls|html|rss|pla|txx
Choose which format of playlist you want to generate (default is m3u).
.IP -g|--genre=#:#:...
Choose which genres (numerical values only) will be included in the generated playlist (default is all).
#include <assert.h>
#include "genres.h"
-#define VERSION "0.37"
+#define VERSION "0.38"
#define MP3_BASE 1024
#define OGG_BASE 1024*10
#define MAX 1024*200 /* 200ko for ID3 with JPEG images in it */
void usage()
{
fprintf(stderr,
- "Usage >> fapg [-b|--backslash] [-d|--debug] [-f|--format=m3u|pls|html|rss|pla] [-g|--genre=#:#:...] [-n|--nohardlink] [-o|--output=/path/to/file.m3u] [-p|--prefix=/the/prefix] [-r|--recursive] [-w|--windows] [-c|--command=<intern|...>] [-x|--exclude=#:#:...] [-s|--stdin] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]\n");
+ "Usage >> fapg [-b|--backslash] [-d|--debug] [-f|--format=m3u|pls|html|rss|pla|txx] [-g|--genre=#:#:...] [-n|--nohardlink] [-o|--output=/path/to/file.m3u] [-p|--prefix=/the/prefix] [-r|--recursive] [-w|--windows] [-c|--command=<intern|...>] [-x|--exclude=#:#:...] [-s|--stdin] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]\n");
exit(1);
}
}
}
+void txxputheader(const char *c)
+{
+ int cnt = 0;
+
+ while(*c != 0) {
+ myputchar(*c);
+ cnt++;
+ c++;
+ }
+
+ while(cnt < 512) {
+ putchar('\0');
+ cnt++;
+ }
+}
+
+void txxputnameoffset(const char *c)
+{
+ int pos = 0;
+ int cnt = 0;
+ char b;
+ unsigned char *prefx;
+
+ prefx = prefix;
+
+ if(*prefx != 0) {
+ while(*prefx != 0) {
+ if(*prefx == '/') {
+ pos = cnt;
+ }
+ cnt++;
+ prefx++;
+ }
+
+ cnt--; // skip the leading dot of the filepath
+ }
+
+ while(*c != 0) {
+ if(*c == '/') {
+ pos = cnt;
+ }
+ cnt++;
+ c++;
+ }
+
+ pos += 2;
+
+ b = (pos & 0xFF00) >> 8;
+ putchar(b);
+ b = (pos & 0x00FF);
+ putchar(b);
+}
+
+void txxputstr(const char *c)
+{
+ int cnt = 0;
+ int pos;
+ unsigned char *prefx;
+
+ txxputnameoffset(c);
+
+ prefx = prefix;
+ fprintf(stderr, "prefix: '%s'\n", prefx);
+
+ if(*prefx != 0) {
+ while(*prefx != 0) {
+ myputchar('\0');
+ cnt++;
+
+ if(*prefx == '/')
+ putchar(separator);
+ else
+ myputchar(*prefx);
+ cnt++;
+
+ prefx++;
+ }
+
+ c++; // skip the leading dot
+ }
+
+ while(*c != 0) {
+ myputchar('\0');
+ cnt++;
+
+ if(*c == '/')
+ putchar(separator);
+ else
+ myputchar(*c);
+ cnt++;
+
+ c++;
+ }
+
+ while(cnt < 510) {
+ myputchar('\0');
+ cnt++;
+ }
+}
+
+void txxputcounter(int c)
+{
+ int b;
+
+ rewind(stdout);
+
+ b = (c & 0xFF000000) >> 24;
+ putchar(b);
+ b = (c & 0x00FF0000) >> 16;
+ putchar(b);
+ b = (c & 0x0000FF00) >> 8;
+ putchar(b);
+ b = (c & 0x000000FF);
+ putchar(b);
+}
+
/* remove spaces at beginning and end of string */
void trim(char *c)
{
format = 3;
else if(strcmp(optarg, "pla") == 0)
format = 4;
+ else if(strcmp(optarg, "txx") == 0)
+ format = 5;
else
usage();
break;
myplaputstr(newpath);
myplaputstr(eol);
break;
+ case 5: //t-series playlist
+ txxputstr(newpath);
+ break;
}
}
}
eol = "\r\n";
myplaputstr("PLP PLAYLIST\r\nVERSION 1.20\r\n\r\n");
}
+ break;
+ case 5:
+ {
+ txxputheader(" iriver UMS PLA");
+ }
}
if(fromstdin) {
unsigned char path[PATH_MAX];
case 3:
printf(" </channel>%s</rss>%s", eol, eol);
break;
+ case 5:
+ txxputcounter(counter);
+ break;
}
if(genrelist)
free(genrelist);