Basically this patch adds the DEVICE parameter to pulse PCM and
control plugins, so that users may pass the specific pulse device
for multiple opens. Along with the addition of the DEVICE parameter
in the config definition, the plugin code is slightly modified for
allowing to receive the empty strings that are treated as the
"default" mode (= NULL).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
# Add a specific named PulseAudio pcm and ctl (typically useful for testing)
pcm.pulse {
+ @args [ DEVICE ]
+ @args.DEVICE {
+ type string
+ default ""
+ }
type pulse
+ device $DEVICE
hint {
show {
@func refer
}
ctl.pulse {
+ @args [ DEVICE ]
+ @args.DEVICE {
+ type string
+ default ""
+ }
type pulse
+ device $DEVICE
}
if (snd_config_get_string(n, &server) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*server) {
+ server = NULL;
}
continue;
}
if (snd_config_get_string(n, &device) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*device) {
+ device = NULL;
}
continue;
}
if (snd_config_get_string(n, &source) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*source) {
+ source = NULL;
}
continue;
}
if (snd_config_get_string(n, &sink) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*sink) {
+ sink = NULL;
}
continue;
}
if (snd_config_get_string(n, &server) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*server) {
+ server = NULL;
}
continue;
}
if (snd_config_get_string(n, &device) < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
+ } else if (!*device) {
+ device = NULL;
}
continue;
}
if (snd_config_get_string(n, &fallback_name) < 0) {
SNDERR("Invalid value for %s", id);
return -EINVAL;
+ } else if (!*fallback_name) {
+ fallback_name = NULL;
}
continue;
}