-/*
- * FAPG
- */
-#define VERSION "0.35"
/*
* FAPG means Fast Audio Playlist Generator.
* It is a tool to generate list of audio files (Wav, MP3, Ogg, etc)
#include <assert.h>
#include "genres.h"
+#define VERSION "0.36"
#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] [-g|--genre=#:#:...] [-n|--nohardlink] [-o|--output=/path/to/file.m3u] [-p|--prefix=/the/prefix] [-r|--recursive] [-w|--windows] [-c|--command=<intern|....>] [-x|--exclude=#:#:...] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]\n");
+ "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=#:#:...] /path/to/mp3/dir1 [/path/to/mp3/dir2 ...]\n");
exit(1);
}
#define mywebputchar(x) { fputs(iso2web[(unsigned char)winorunix[(unsigned char)x]], stdout); }
#define myputchar(x) { putchar(basemap[(unsigned char)winorunix[(unsigned char)x]]); }
+/* #define myplaputchar(x) { putchar(basemap[(unsigned char)winorunix[(unsigned char)x]]);putchar('\0');} */
+void myplaputchar(const char x)
+{
+ putchar(basemap[(unsigned char)winorunix[(unsigned char)x]]);
+ putchar('\0');
+}
void mywebputstr(const char *c)
{
}
}
+void myplaputstr(const char *c)
+{
+ while(*c != 0) {
+ if( *c == '/')
+ myplaputchar('\\'); /* translate slash to backslash */
+ else
+ myplaputchar(*c);
+ c++;
+ /* remove multiple slashes "//" when parsing a directory ending with a "/" */
+ while(*c == '/' && c[1] == '/')
+ c++;
+ }
+}
+
void myputstr(const char *c)
{
while(*c != 0) {
format = 2;
else if(strcmp(optarg, "rss") == 0)
format = 3;
+ else if(strcmp(optarg, "pla") == 0)
+ format = 4;
else
usage();
break;
// there are no tag infos read
// use file name to state substitute it
char *c = strrchr(newpath, separator);
+ if (c == NULL) c = newpath;
strcpy(artist, ++c);
// arbitrarily use the first '-'
// to separate artist and title
printf("\t</item>%s", eol);
}
break;
+ case 4: // printing output for Sansa players
+ myplaputstr("HARP, ");
+ myplaputstr(newpath);
+ myplaputstr(eol);
+ break;
}
}
}
basemap = noand;
}
break;
+ case 4:
+ {
+ eol = "\r\n";
+ myplaputstr( "PLP PLAYLIST\r\nVERSION 1.20\r\n\r\n" );
+ }
}
for(; optind < argc; optind++) {
parse_directory(argv[optind]);