mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
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:
parent
5ae92fd643
commit
8414092763
9 changed files with 176 additions and 105 deletions
|
|
@ -186,6 +186,7 @@ struct acp_card_events {
|
|||
struct acp_port {
|
||||
uint32_t index; /**< unique index for this port */
|
||||
#define ACP_PORT_ACTIVE (1<<0)
|
||||
#define ACP_PORT_SAVE (1<<1) /* if the port needs saving */
|
||||
uint32_t flags; /**< extra port flags */
|
||||
|
||||
const char *name; /**< Name of this port */
|
||||
|
|
@ -229,6 +230,7 @@ struct acp_card_profile {
|
|||
uint32_t index;
|
||||
#define ACP_PROFILE_ACTIVE (1<<0)
|
||||
#define ACP_PROFILE_OFF (1<<1) /* the Off profile */
|
||||
#define ACP_PROFILE_SAVE (1<<2) /* if the profile needs saving */
|
||||
uint32_t flags;
|
||||
|
||||
const char *name;
|
||||
|
|
@ -274,10 +276,10 @@ int acp_card_poll_descriptors_revents(struct acp_card *card, struct pollfd *pfds
|
|||
int acp_card_handle_events(struct acp_card *card);
|
||||
|
||||
uint32_t acp_card_find_best_profile_index(struct acp_card *card, const char *name);
|
||||
int acp_card_set_profile(struct acp_card *card, uint32_t profile_index);
|
||||
int acp_card_set_profile(struct acp_card *card, uint32_t profile_index, uint32_t flags);
|
||||
|
||||
uint32_t acp_device_find_best_port_index(struct acp_device *dev, const char *name);
|
||||
int acp_device_set_port(struct acp_device *dev, uint32_t port_index);
|
||||
int acp_device_set_port(struct acp_device *dev, uint32_t port_index, uint32_t flags);
|
||||
|
||||
int acp_device_set_volume(struct acp_device *dev, const float *volume, uint32_t n_volume);
|
||||
int acp_device_get_volume(struct acp_device *dev, float *volume, uint32_t n_volume);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue