modules: add {sink|source|card}_properties argument to all modules

This commit is contained in:
Lennart Poettering 2009-05-28 02:39:22 +02:00
parent 208862698e
commit 1c4393acf0
20 changed files with 231 additions and 48 deletions

View file

@ -1693,6 +1693,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_xfree(control_device);
}
if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
pa_log("Invalid properties");
pa_sink_new_data_done(&data);
goto fail;
}
u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY|(u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0));
pa_sink_new_data_done(&data);

View file

@ -1548,6 +1548,12 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_xfree(control_device);
}
if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
pa_log("Invalid properties");
pa_source_new_data_done(&data);
goto fail;
}
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
pa_source_new_data_done(&data);

View file

@ -43,9 +43,12 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(FALSE);
PA_MODULE_USAGE(
"name=<name for the card/sink/source, to be prefixed> "
"card_name=<name for card> "
"sink_name=<name for sink> "
"source_name=<name for source> "
"card_name=<name for the card> "
"card_properties=<properties for the card> "
"sink_name=<name for the sink> "
"sink_properties=<properties for the sink> "
"source_name=<name for the source> "
"source_properties=<properties for the source> "
"device_id=<ALSA card index> "
"format=<sample format> "
"rate=<sample rate> "
@ -61,8 +64,11 @@ PA_MODULE_USAGE(
static const char* const valid_modargs[] = {
"name",
"card_name",
"card_properties",
"sink_name",
"sink_properties",
"source_name",
"source_properties",
"device_id",
"format",
"rate",
@ -340,6 +346,12 @@ int pa__init(pa_module *m) {
add_disabled_profile(data.profiles);
if (pa_modargs_get_proplist(ma, "card_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
pa_log("Invalid properties");
pa_card_new_data_done(&data);
goto fail;
}
u->card = pa_card_new(m->core, &data);
pa_card_new_data_done(&data);

View file

@ -40,6 +40,7 @@ PA_MODULE_LOAD_ONCE(FALSE);
PA_MODULE_USAGE(
"name=<name of the sink, to be prefixed> "
"sink_name=<name for the sink> "
"sink_properities=<properties for the sink> "
"device=<ALSA device> "
"device_id=<ALSA card index> "
"format=<sample format> "
@ -58,6 +59,7 @@ PA_MODULE_USAGE(
static const char* const valid_modargs[] = {
"name",
"sink_name",
"sink_properties",
"device",
"device_id",
"format",

View file

@ -64,6 +64,7 @@ PA_MODULE_LOAD_ONCE(FALSE);
PA_MODULE_USAGE(
"name=<name for the source, to be prefixed> "
"source_name=<name for the source> "
"source_properties=<properties for the source> "
"device=<ALSA device> "
"device_id=<ALSA card index> "
"format=<sample format> "
@ -82,6 +83,7 @@ PA_MODULE_USAGE(
static const char* const valid_modargs[] = {
"name",
"source_name",
"source_properties",
"device",
"device_id",
"format",