mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-09 03:01:53 -04:00
acp: add min and max volume properties
This way, the min/max volume can be updated and saved in the same way as the volume is updated. Also add support for this in audioconvert channelmix.
This commit is contained in:
parent
fb74ab9054
commit
1a534cd907
6 changed files with 71 additions and 0 deletions
|
|
@ -905,6 +905,8 @@ static int node_param_props(struct impl *this, uint32_t id, uint32_t index,
|
|||
SPA_TYPE_Float,
|
||||
p->monitor.n_volumes,
|
||||
p->monitor.volumes),
|
||||
SPA_PROP_volumeMin, SPA_POD_Float(p->min_volume),
|
||||
SPA_PROP_volumeMax, SPA_POD_Float(p->max_volume),
|
||||
0);
|
||||
spa_pod_builder_prop(b, SPA_PROP_params, 0);
|
||||
spa_pod_builder_push_struct(b, &f[1]);
|
||||
|
|
@ -1867,6 +1869,20 @@ static int apply_props(struct impl *this, const struct spa_pod *param)
|
|||
changed++;
|
||||
}
|
||||
break;
|
||||
case SPA_PROP_volumeMin:
|
||||
if (!p->lock_volumes &&
|
||||
spa_pod_get_float(&prop->value, &p->min_volume) == 0) {
|
||||
spa_log_debug(this->log, "%p new min-volume %f", this, p->min_volume);
|
||||
changed++;
|
||||
}
|
||||
break;
|
||||
case SPA_PROP_volumeMax:
|
||||
if (!p->lock_volumes &&
|
||||
spa_pod_get_float(&prop->value, &p->max_volume) == 0) {
|
||||
spa_log_debug(this->log, "%p new max-volume %f", this, p->min_volume);
|
||||
changed++;
|
||||
}
|
||||
break;
|
||||
case SPA_PROP_rate:
|
||||
if (spa_pod_get_double(&prop->value, &p->rate) == 0 &&
|
||||
!this->rate_adjust && p->rate != 1.0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue