Commit 000320af authored by moritz's avatar moritz

Teach ezstream a different mode of operation, as a one-shot line shuffling tool.

git-svn-id: 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent c59c0c98
......@@ -12,6 +12,8 @@ Changes in 0.5.6, released on 2009-08-31:
and operation will continue until 100 subsequent errors. Based on
an idea from dhorton.
(Ticket #1585)
- [NEW] New command line option -s: Make ezstream function as a line-
based shuffling utility.
* src/playlist.c:
- [MISC] Consider no output from a playlist program to be equivalent to an
empty line, indicating that the end of the playlist is reached.
......@@ -27,6 +27,11 @@
.Op Fl hnqVv
.Fl c Ar configfile
.Bk -words
.Fl s
.Op Ar playlist
......@@ -44,7 +49,6 @@ reading from standard input, and can be used from the command line.
.It Fl c Ar configfile
Use the XML configuration in
.Ar configfile .
.Pq Mandatory.
.It Fl h
Print a summary of available command line parameters with short descriptions
and exit.
......@@ -53,6 +57,18 @@ Normalize metadata strings by removing excess whitespaces.
.It Fl q
Be more quiet.
Suppress the output that external programs send to standard error.
.It Fl s Op Ar playlist
as a line-based shuffling utility.
If no
.Ar playlist
argument is given, a list of media file names is read from standard input
instead of an input file.
After successfully reading the entire list, it is shuffled and printed to
standard output, and
will exit.
.It Fl V
Print the
......@@ -51,6 +51,7 @@ char *__progname;
int nFlag;
int qFlag;
int sFlag;
int vFlag;
int metadataFromProgram;
......@@ -1073,6 +1074,7 @@ void
printf("usage: %s [-hnqVv] -c configfile\n", __progname);
printf(" %s -s [playlist]\n", __progname);
......@@ -1083,6 +1085,8 @@ usageHelp(void)
printf(" -h display this additional help and exit\n");
printf(" -n normalize metadata strings\n");
printf(" -q suppress STDERR output from external en-/decoders\n");
printf(" -s [playlist] read lines from playlist (or STDIN), shuffle and print them to\n");
printf(" STDOUT, then exit\n");
printf(" -V print the version number and exit\n");
printf(" -v verbose output (use twice for more effect)\n");
......@@ -1120,7 +1124,7 @@ main(int argc, char *argv[])
qFlag = 0;
vFlag = 0;
while ((c = local_getopt(argc, argv, "c:hnqVv")) != -1) {
while ((c = local_getopt(argc, argv, "c:hnqsVv")) != -1) {
switch (c) {
case 'c':
if (configFile != NULL) {
......@@ -1140,6 +1144,9 @@ main(int argc, char *argv[])
case 'q':
qFlag = 1;
case 's':
sFlag = 1;
case 'V':
printf("%s\n", PACKAGE_STRING);
return (ez_shutdown(0));
......@@ -1156,6 +1163,35 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
if (sFlag) {
playlist_t *pl;
const char *entry;
switch (argc) {
case 0:
pl = playlist_read(NULL);
if (pl == NULL)
return (ez_shutdown(1));
case 1:
pl = playlist_read(argv[0]);
if (pl == NULL)
return (ez_shutdown(1));
printf("Error: Too many arguments.\n");
return (ez_shutdown(2));
while ((entry = playlist_get_next(pl)) != NULL)
printf("%s\n", entry);
return (ez_shutdown(0));
if (configFile == NULL) {
printf("You must supply a config file with the -c argument.\n");
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment