Rework profile/route handling

Add save property to Profile and Route params to notify the session
manager that they should be saved. Let the session manager only save
the Profile and Routes with the save flag.
Make pulse-server set the save flag on Profile and Route changes.
The result is that we can make a difference between user requested
changes and automatical changes and only remember the user preferences.
When a port changes availability, first check if we need to perform
a profile switch, if not select the new best port.
This commit is contained in:
Wim Taymans 2021-02-22 16:42:29 +01:00
parent 5ae92fd643
commit 8414092763
9 changed files with 176 additions and 105 deletions

View file

@ -320,7 +320,7 @@ static int cmd_set_profile(struct data *data, const struct command *cmd, int arg
else
index = card->active_profile_index;
return acp_card_set_profile(card, index);
return acp_card_set_profile(card, index, 0);
}
static int cmd_list_ports(struct data *data, const struct command *cmd, int argc, char *argv[])
@ -355,7 +355,7 @@ static int cmd_set_port(struct data *data, const struct command *cmd, int argc,
if (dev_id >= card->n_devices)
return -EINVAL;
return acp_device_set_port(card->devices[dev_id], port_id);
return acp_device_set_port(card->devices[dev_id], port_id, 0);
}
static int cmd_list_devices(struct data *data, const struct command *cmd, int argc, char *argv[])