pulse-server: add a pipewire-pulse:list-modules message

It list all available module names, which you can then describe further.
Make a little module_info iterator function for this.
This commit is contained in:
Wim Taymans 2025-09-26 10:55:10 +02:00
parent ecac86b0ca
commit 5a894270e6
3 changed files with 25 additions and 6 deletions

View file

@ -118,6 +118,16 @@ static int core_object_message_handler(struct client *client, struct pw_manager_
} else if (spa_streq(message, "pipewire-pulse:log-level")) {
int res = pw_log_set_level_string(params);
fprintf(response, "%d", res);
} else if (spa_streq(message, "pipewire-pulse:list-modules")) {
bool first = true;
const struct module_info *i = NULL;
fputc('[', response);
while ((i = module_info_next(client->impl, i)) != NULL) {
fprintf(response, "%s{\"name\":\"%s\"}",
first ? "" : ",\n", i->name);
first = false;
}
fputc(']', response);
} else if (spa_streq(message, "pipewire-pulse:describe-module")) {
const struct module_info *i = module_info_find(client->impl, params);