pulse: update per channel volumes

Use the channelVolume property to update the individual channel
volumes.
Update property values to match pulseaudio.

Handle the case where the number of channels changes. In pulse this
can normally never happen. Emit a remove and add of the node when
this happens as to not confuse pulse clients.
This commit is contained in:
Wim Taymans 2019-08-12 12:31:55 +02:00
parent 5e2b740ee0
commit 69ad904b63
4 changed files with 211 additions and 104 deletions

View file

@ -246,6 +246,8 @@ struct global {
uint32_t monitor;
float volume;
bool mute;
uint32_t n_channel_volumes;
float channel_volumes[SPA_AUDIO_MAX_CHANNELS];
} node_info;
/* for devices */
struct {
@ -382,7 +384,8 @@ struct pa_stream {
uint32_t buffer_size;
uint32_t buffer_offset;
float volume;
uint32_t n_channel_volumes;
float channel_volumes[SPA_AUDIO_MAX_CHANNELS];
bool mute;
pa_operation *drain;
uint64_t queued;