Use whitespace instead of colons to separate receiver/filter args
authorAndre <maan@p133.(none)>
Fri, 24 Feb 2006 15:13:57 +0000 (16:13 +0100)
committerAndre <maan@p133.(none)>
Fri, 24 Feb 2006 15:13:57 +0000 (16:13 +0100)
This is much nicer but the receiver/filter argument must now be quoted if any
options are present.

INSTALL
audiod.ggo
filter_chain.c
recv.ggo
recv_common.c

diff --git a/INSTALL b/INSTALL
index 9d82c9bf239bc130ce3eb1b1b7782558a1e5fa97..9bf20154454ecd0c083ca4555488fcacda176b65 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -115,19 +115,19 @@ on client_host:
 
        mp3:
 
-               para_recv -r http:-i:server_host | para_filter -f mp3 -f wav | para_play
-               or
-               mpg123 http://server_host:8000/
-               or
-               xmms http://server_host:8000/
+       para_recv -r 'http -i server_host' | para_filter -f mp3dec -f wav | para_play
+       or
+       mpg123 http://server_host:8000/
+       or
+       xmms http://server_host:8000/
 
        ogg:
 
-               para_recv -r http:-i:server_host | para_filter -f ogg -f wav | para_play
+       para_recv -r 'http -i server_host' | para_filter -f oggdec -f wav | para_play
 
 If this works, proceede. Otherwise doublecheck what is logged by
-para_server and use the --loglevel option of para_recv to increase
-verbosity.
+para_server and use the --loglevel option of para_recv, para_filter
+to increase verbosity.
 
 Configure para_audiod
 ~~~~~~~~~~~~~~~~~~~~~
@@ -142,7 +142,7 @@ the audio stream. Try
 for help. Usually you have to specify at least server_host as the
 receiver specifier, like this:
 
-       -r http:-i:server_host
+       -r 'mp3:http -i server_host'
 
 The prefered way to use para_audiod is to run it once at system start
 as an unprivileged user. para_audiod needs to create a "well-known"
index cafc851921eb2b650cc510185bfda7d77d25da10..b0b8d0c4d357eebb8fff341ac80cd966900d777b 100644 (file)
@@ -24,13 +24,15 @@ option "receiver" r "Select receiver.
 
 May be given multiple times, once for each
 supported audio format. receiver_spec
-consists of an audio format, the receiver
-name and any options for that receiver,
-seperated by colons.
+consists of an audio format and the receiver
+name, separated by a colon, and any options
+for that receiver, seperated by whitespace.
+If any receiver options are present, the
+whole receiver argument must be quoted.
 
 Example:
 
--r mp3:http:-i:www.paraslash.org:-p:8009
+-r 'mp3:http -i www.paraslash.org -p 8009'
 "
 
 string typestr="receiver_spec" default="http" no multiple
@@ -50,12 +52,11 @@ option "filter" f "Select filter(s) manually.
 
 May be given multiple times. filter_spec
 consists of an audio format, the name of the
-filter, and any options for that filter,
-separated by colons.
+filter, and any options for that filter.
 
 Examples:
        -f mp3:mp3dec
-       -f:mp3:compress:--anticlip:--volume:2
+       -f 'mp3:compress --anticlip --volume 2'
 
 Note that these options are ignored by default,
 see --no_default_filters."
index d22ef28eed3cbaa1e38f1b15f2f0b73a1ce7b011..d59ff7094fc37075b97f914b925d3ac776439591 100644 (file)
@@ -196,7 +196,7 @@ static int parse_filter_args(int filter_num, char *options, void **conf)
                return options? -E_BAD_FILTER_OPTIONS : filter_num;
        if (options) {
 //             PARA_DEBUG_LOG("options: %s\n", options);
-               argc = split_args(options, &argv, ':');
+               argc = split_args(options, &argv, ' ');
 //             PARA_DEBUG_LOG("argc = %d, argv[0]: %s\n", argc, argv[0]);
                for (i = argc; i >= 0; i--)
                        argv[i + 1] = argv[i];
@@ -242,7 +242,7 @@ int check_filter_arg(char *fa, void **conf)
                if (strncmp(name, fa, len))
                        continue;
                c = fa[len];
-               if (c && c != ':')
+               if (c && c != ' ')
                        continue;
                if (c && !filters[j].parse_config)
                        return -E_BAD_FILTER_OPTIONS;
index b6d5a77c651787100587c24aeced6d681596edbe..ed903fd6ac339d75afaf1bcd2e9e86285acd4a31 100644 (file)
--- a/recv.ggo
+++ b/recv.ggo
@@ -2,10 +2,10 @@ option "loglevel" l "set loglevel (0-6)" int typestr="level" default="4" no
 option "list_receivers" L "print list of available receivers" flag off
 option "receiver" r "Select receiver.
 
-If options for the selected receiver are given, they must
-be separated by ':' instead of white space. Example:
+Any options for the selected receiver must
+be quoted. Example:
 
-       -r http:-i:www.paraslash.org:-p:8009
+       -r 'http -i www.paraslash.org  -p 8009'
 "
 
 string typestr="receiver_spec" default="http" no
index 3a09e7c0f8611f8666bfadf36f06c989a5e0a990..39a840873a4495250cdfc519a4d0d5b0712e8260 100644 (file)
@@ -39,7 +39,7 @@ static void *parse_receiver_args(int receiver_num, char *options)
 //             options? options : "(none)");
        if (options) {
 //             PARA_DEBUG_LOG("%s options: %s\n", name, options);
-               argc = split_args(options, &argv, ':');
+               argc = split_args(options, &argv, ' ');
 //             PARA_DEBUG_LOG("argc = %d, argv[0]: %s\n", fn->argc, fn->argv[0]);
                for (i = argc; i >= 0; i--)
                        argv[i + 1] = argv[i];
@@ -74,13 +74,13 @@ void *check_receiver_arg(char *ra, int *receiver_num)
                if (strncmp(name, ra, len))
                        continue;
                c = ra[len];
-               if (c && c != ':')
+               if (c && c != ' ')
                        continue;
                if (c && !receivers[j].parse_config)
                        return NULL;
                *receiver_num = j;
                return parse_receiver_args(j, c? ra + len + 1: NULL);
        }
-       PARA_ERROR_LOG("%s", "receiver not found:");
+       PARA_ERROR_LOG("%s", "receiver not found\n");
        return NULL;
 }