mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
acp: add support for soft volume
Add a set_soft_volume/mute event. If we can't configure the hardware volume completely, notify the remainder with the soft_volume/mute events.
This commit is contained in:
parent
4db6e0e2b3
commit
d80d593271
4 changed files with 87 additions and 10 deletions
|
|
@ -181,14 +181,25 @@ static inline int pa_cvolume_compatible_with_channel_map(const pa_cvolume *v,
|
|||
|
||||
static inline pa_volume_t pa_cvolume_max(const pa_cvolume *a)
|
||||
{
|
||||
pa_volume_t m = PA_VOLUME_MUTED;
|
||||
unsigned c;
|
||||
for (c = 0; c < a->channels; c++)
|
||||
if (a->values[c] > m)
|
||||
m = a->values[c];
|
||||
return m;
|
||||
pa_volume_t m = PA_VOLUME_MUTED;
|
||||
unsigned c;
|
||||
for (c = 0; c < a->channels; c++)
|
||||
if (a->values[c] > m)
|
||||
m = a->values[c];
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline pa_volume_t pa_cvolume_min(const pa_cvolume *a)
|
||||
{
|
||||
pa_volume_t m = PA_VOLUME_MAX;
|
||||
unsigned c;
|
||||
for (c = 0; c < a->channels; c++)
|
||||
if (a->values[c] < m)
|
||||
m = a->values[c];
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue