From 08953564bb85356869a1f043b82d1f365c8729a1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 17 Sep 2004 20:43:40 +0000 Subject: add --resample-method argument git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@214 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/cmdline.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'polyp/cmdline.c') diff --git a/polyp/cmdline.c b/polyp/cmdline.c index 7f8a947b..a5bb8101 100644 --- a/polyp/cmdline.c +++ b/polyp/cmdline.c @@ -52,6 +52,7 @@ enum { ARG_LOAD, ARG_FILE, ARG_DL_SEARCH_PATH, + ARG_RESAMPLE_METHOD }; static struct option long_options[] = { @@ -71,6 +72,7 @@ static struct option long_options[] = { {"load", 1, 0, ARG_LOAD}, {"file", 1, 0, ARG_FILE}, {"dl-search-path", 1, 0, ARG_DL_SEARCH_PATH}, + {"resample-method", 1, 0, ARG_RESAMPLE_METHOD}, {NULL, 0, 0, 0} }; @@ -98,7 +100,8 @@ void pa_cmdline_help(const char *argv0) { " --module-idle-time=SECS Unload autoloaded modules when idle and this time passed\n" " --scache-idle-time=SECS Unload autoloaded samples when idle and this time passed\n" " --log-target={auto,syslog,stderr} Specify the log target\n" - " -p, --dl-search-path=PATH Set the search path for dynamic shared objects (plugins)\n\n" + " -p, --dl-search-path=PATH Set the search path for dynamic shared objects (plugins)\n" + " --resample-method=[METHOD] Use the specified resampling method\n\n" " -L, --load=\"MODULE ARGUMENTS\" Load the specified plugin module with the specified argument\n" " -F, --file=FILENAME Run the specified script\n" @@ -198,15 +201,7 @@ int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [], break; case ARG_LOG_TARGET: - if (!strcmp(optarg, "syslog")) { - conf->auto_log_target = 0; - conf->log_target = PA_LOG_SYSLOG; - } else if (!strcmp(optarg, "stderr")) { - conf->auto_log_target = 0; - conf->log_target = PA_LOG_STDERR; - } else if (!strcmp(optarg, "auto")) - conf->auto_log_target = 1; - else { + if (pa_daemon_conf_set_log_target(conf, optarg) < 0) { pa_log(__FILE__": Invalid log target: use either 'syslog', 'stderr' or 'auto'.\n"); goto fail; } @@ -223,6 +218,13 @@ int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [], case ARG_SCACHE_IDLE_TIME: conf->scache_idle_time = atoi(optarg); break; + + case ARG_RESAMPLE_METHOD: + if (pa_daemon_conf_set_resample_method(conf, optarg) < 0) { + pa_log(__FILE__": Invalid resample method '%s'.\n", optarg); + goto fail; + } + break; default: goto fail; -- cgit