pulse-server: implement control arg for module-ladspa

See #1987
This commit is contained in:
Wim Taymans 2022-01-07 16:38:54 +01:00
parent 6d081d5214
commit 163c365340
2 changed files with 28 additions and 2 deletions

View file

@ -84,11 +84,24 @@ static int module_ladspa_sink_load(struct client *client, struct module *module)
fprintf(f, " type = ladspa "); fprintf(f, " type = ladspa ");
fprintf(f, " plugin = \"%s\" ", plugin); fprintf(f, " plugin = \"%s\" ", plugin);
fprintf(f, " label = \"%s\" ", label); fprintf(f, " label = \"%s\" ", label);
if ((str = pw_properties_get(module->props, "control")) != NULL) {
size_t len;
const char *s, *state = NULL;
int count = 0;
fprintf(f, " control = {");
while ((s = pw_split_walk(str, ", ", &len, &state))) {
fprintf(f, " \"%d\" = %.*s", count, (int)len, s);
count++;
}
fprintf(f, " }");
}
fprintf(f, " } ]");
if ((str = pw_properties_get(module->props, "inputs")) != NULL) if ((str = pw_properties_get(module->props, "inputs")) != NULL)
fprintf(f, " inputs = [ %s ] ", str); fprintf(f, " inputs = [ %s ] ", str);
if ((str = pw_properties_get(module->props, "outputs")) != NULL) if ((str = pw_properties_get(module->props, "outputs")) != NULL)
fprintf(f, " outputs = [ %s ] ", str); fprintf(f, " outputs = [ %s ] ", str);
fprintf(f, " } ] }"); fprintf(f, " }");
fprintf(f, " capture.props = {"); fprintf(f, " capture.props = {");
pw_properties_serialize_dict(f, &data->capture_props->dict, 0); pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
fprintf(f, " } playback.props = {"); fprintf(f, " } playback.props = {");

View file

@ -84,11 +84,24 @@ static int module_ladspa_source_load(struct client *client, struct module *modul
fprintf(f, " type = ladspa "); fprintf(f, " type = ladspa ");
fprintf(f, " plugin = \"%s\" ", plugin); fprintf(f, " plugin = \"%s\" ", plugin);
fprintf(f, " label = \"%s\" ", label); fprintf(f, " label = \"%s\" ", label);
if ((str = pw_properties_get(module->props, "control")) != NULL) {
size_t len;
const char *s, *state = NULL;
int count = 0;
fprintf(f, " control = {");
while ((s = pw_split_walk(str, ", ", &len, &state))) {
fprintf(f, " \"%d\" = %.*s", count, (int)len, s);
count++;
}
fprintf(f, " }");
}
fprintf(f, " } ]");
if ((str = pw_properties_get(module->props, "inputs")) != NULL) if ((str = pw_properties_get(module->props, "inputs")) != NULL)
fprintf(f, " inputs = [ %s ] ", str); fprintf(f, " inputs = [ %s ] ", str);
if ((str = pw_properties_get(module->props, "outputs")) != NULL) if ((str = pw_properties_get(module->props, "outputs")) != NULL)
fprintf(f, " outputs = [ %s ] ", str); fprintf(f, " outputs = [ %s ] ", str);
fprintf(f, " } ] }"); fprintf(f, " }");
fprintf(f, " capture.props = {"); fprintf(f, " capture.props = {");
pw_properties_serialize_dict(f, &data->capture_props->dict, 0); pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
fprintf(f, " } playback.props = {"); fprintf(f, " } playback.props = {");