summaryrefslogtreecommitdiffstats
path: root/polyp
diff options
context:
space:
mode:
Diffstat (limited to 'polyp')
-rw-r--r--polyp/module-alsa-sink.c1
-rw-r--r--polyp/module-alsa-source.c3
-rw-r--r--polyp/module-cli.c1
-rw-r--r--polyp/module-oss-mmap.c1
-rw-r--r--polyp/module-oss.c1
-rw-r--r--polyp/module-pipe-sink.c3
-rw-r--r--polyp/module-pipe-source.c1
-rw-r--r--polyp/module-protocol-stub.c8
-rw-r--r--polyp/util.c4
9 files changed, 18 insertions, 5 deletions
diff --git a/polyp/module-alsa-sink.c b/polyp/module-alsa-sink.c
index c31b73f0..528fe8d3 100644
--- a/polyp/module-alsa-sink.c
+++ b/polyp/module-alsa-sink.c
@@ -43,6 +43,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("ALSA Sink")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("sink_name=<name for the sink> device=<ALSA device> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>")
struct userdata {
snd_pcm_t *pcm_handle;
diff --git a/polyp/module-alsa-source.c b/polyp/module-alsa-source.c
index 41a17691..c0a18d2b 100644
--- a/polyp/module-alsa-source.c
+++ b/polyp/module-alsa-source.c
@@ -43,6 +43,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("ALSA Source")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("source_name=<name for the source> device=<ALSA device> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>")
struct userdata {
snd_pcm_t *pcm_handle;
@@ -58,9 +59,9 @@ struct userdata {
static const char* const valid_modargs[] = {
"device",
"source_name",
- "format",
"channels",
"rate",
+ "format",
"fragments",
"fragment_size",
NULL
diff --git a/polyp/module-cli.c b/polyp/module-cli.c
index 94c65d07..6444194c 100644
--- a/polyp/module-cli.c
+++ b/polyp/module-cli.c
@@ -36,6 +36,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("Command line interface")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("No arguments")
static void eof_cb(struct pa_cli*c, void *userdata) {
struct pa_module *m = userdata;
diff --git a/polyp/module-oss-mmap.c b/polyp/module-oss-mmap.c
index 015f4c6c..f7fcbd3b 100644
--- a/polyp/module-oss-mmap.c
+++ b/polyp/module-oss-mmap.c
@@ -50,6 +50,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("OSS Sink/Source (mmap)")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("sink_name=<name for the sink> source_name=<name for the source> device=<OSS device> record=<enable source?> playback=<enable sink?> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>")
struct userdata {
struct pa_sink *sink;
diff --git a/polyp/module-oss.c b/polyp/module-oss.c
index 68918604..c0c6be8e 100644
--- a/polyp/module-oss.c
+++ b/polyp/module-oss.c
@@ -49,6 +49,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("OSS Sink/Source")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("sink_name=<name for the sink> source_name=<name for the source> device=<OSS device> record=<enable source?> playback=<enable sink?> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>")
struct userdata {
struct pa_sink *sink;
diff --git a/polyp/module-pipe-sink.c b/polyp/module-pipe-sink.c
index 57e7425b..c5097fb7 100644
--- a/polyp/module-pipe-sink.c
+++ b/polyp/module-pipe-sink.c
@@ -44,6 +44,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("UNIX pipe sink")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("sink_name=<name for the sink> file=<path of the FIFO> format=<sample format> channels=<number of channels> rate=<sample rate>")
#define DEFAULT_FIFO_NAME "/tmp/music.output"
#define DEFAULT_SINK_NAME "fifo_output"
@@ -64,8 +65,8 @@ struct userdata {
static const char* const valid_modargs[] = {
"file",
"rate",
- "channels",
"format",
+ "channels",
"sink_name",
NULL
};
diff --git a/polyp/module-pipe-source.c b/polyp/module-pipe-source.c
index 61fcdce8..3decc415 100644
--- a/polyp/module-pipe-source.c
+++ b/polyp/module-pipe-source.c
@@ -44,6 +44,7 @@
PA_MODULE_AUTHOR("Lennart Poettering")
PA_MODULE_DESCRIPTION("UNIX pipe source")
PA_MODULE_VERSION(PACKAGE_VERSION)
+PA_MODULE_USAGE("source_name=<name for the source> file=<path of the FIFO> format=<sample format> channels=<number of channels> rate=<sample rate>")
#define DEFAULT_FIFO_NAME "/tmp/music.input"
#define DEFAULT_SOURCE_NAME "fifo_input"
diff --git a/polyp/module-protocol-stub.c b/polyp/module-protocol-stub.c
index fe9e12a1..46522d9b 100644
--- a/polyp/module-protocol-stub.c
+++ b/polyp/module-protocol-stub.c
@@ -42,11 +42,12 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
#ifdef USE_TCP_SOCKETS
#define SOCKET_DESCRIPTION "(TCP sockets)"
+#define SOCKET_USAGE "port=<TCP port number> loopback=<listen on loopback device only?>"
#else
#define SOCKET_DESCRIPTION "(UNIX sockets)"
+#define SOCKET_USAGE "socket=<path to UNIX socket>"
#endif
-
#if defined(USE_PROTOCOL_SIMPLE)
#include "protocol-simple.h"
#define protocol_new pa_protocol_simple_new
@@ -55,6 +56,8 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
#define UNIX_SOCKET "/tmp/polypaudio/simple"
#define MODULE_ARGUMENTS "rate", "format", "channels", "sink", "source", "playback", "record",
PA_MODULE_DESCRIPTION("Simple protocol "SOCKET_DESCRIPTION)
+ PA_MODULE_USAGE("rate=<sample rate> format=<sample format> channels=<number of channels> sink=<sink to connect to> source=<source to connect to> playback=<enable playback?> record=<enable record?> "SOCKET_USAGE)
+
#elif defined(USE_PROTOCOL_CLI)
#include "protocol-cli.h"
#define protocol_new pa_protocol_cli_new
@@ -63,6 +66,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
#define UNIX_SOCKET "/tmp/polypaudio/cli"
#define MODULE_ARGUMENTS
PA_MODULE_DESCRIPTION("Command line interface protocol "SOCKET_DESCRIPTION)
+ PA_MODULE_USAGE(SOCKET_USAGE)
#elif defined(USE_PROTOCOL_NATIVE)
#include "protocol-native.h"
#define protocol_new pa_protocol_native_new
@@ -71,6 +75,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
#define UNIX_SOCKET "/tmp/polypaudio/native"
#define MODULE_ARGUMENTS "public", "cookie",
PA_MODULE_DESCRIPTION("Native protocol "SOCKET_DESCRIPTION)
+ PA_MODULE_USAGE("public=<don't check for cookies?> cookie=<path to cookie file> "SOCKET_USAGE)
#elif defined(USE_PROTOCOL_ESOUND)
#include "protocol-esound.h"
#include "esound.h"
@@ -80,6 +85,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
#define UNIX_SOCKET ESD_UNIX_SOCKET_NAME
#define MODULE_ARGUMENTS "sink", "source", "public", "cookie",
PA_MODULE_DESCRIPTION("EsounD protocol "SOCKET_DESCRIPTION)
+ PA_MODULE_USAGE("sink=<sink to connect to> source=<source to connect to> public=<don't check for cookies?> cookie=<path to cookie file> "SOCKET_USAGE)
#else
#error "Broken build system"
#endif
diff --git a/polyp/util.c b/polyp/util.c
index b9bf9f82..9b74ee75 100644
--- a/polyp/util.c
+++ b/polyp/util.c
@@ -368,9 +368,9 @@ char *pa_path_get_filename(const char *p) {
int pa_parse_boolean(const char *v) {
- if (!strcmp(v, "1") || !strcasecmp(v, "yes") || !strcasecmp(v, "y") || !strcasecmp(v, "on"))
+ if (!strcmp(v, "1") || v[0] == 'y' || v[0] == 'Y' || v[0] == 't' || v[0] == 'T' || !strcasecmp(v, "on"))
return 1;
- else if (!strcmp(v, "0") || !strcasecmp(v, "no") || !strcasecmp(v, "n") || !strcasecmp(v, "off"))
+ else if (!strcmp(v, "0") || v[0] == 'n' || v[0] == 'N' || v[0] == 'f' || v[0] == 'F' || !strcasecmp(v, "off"))
return 0;
return -1;