mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-13 14:33:03 -04:00
spa: alsa: Add a mechanism for external volume control
Currently enabled at device creation and delegated to an external entity via spa_device events.
This commit is contained in:
parent
c81c66826e
commit
eb9a751257
9 changed files with 614 additions and 85 deletions
|
|
@ -490,6 +490,11 @@ static struct spa_pod *build_route(struct spa_pod_builder *b, uint32_t id,
|
|||
dev->n_codecs, dev->codecs);
|
||||
}
|
||||
|
||||
if (dev->ext_volume_flags) {
|
||||
spa_pod_builder_prop(b, SPA_PROP_volumeControlFlags, 0);
|
||||
spa_pod_builder_id(b, dev->ext_volume_flags);
|
||||
}
|
||||
|
||||
spa_pod_builder_pop(b, &f[1]);
|
||||
}
|
||||
spa_pod_builder_prop(b, SPA_PARAM_ROUTE_devices, 0);
|
||||
|
|
@ -1083,6 +1088,12 @@ static void on_mute_changed(void *data, struct acp_device *dev)
|
|||
spa_device_emit_event(&this->hooks, event);
|
||||
}
|
||||
|
||||
static void on_ext_vol_event_available(void *data, struct spa_event *event)
|
||||
{
|
||||
struct impl *this = data;
|
||||
spa_device_emit_event(&this->hooks, event);
|
||||
}
|
||||
|
||||
static const struct acp_card_events card_events = {
|
||||
ACP_VERSION_CARD_EVENTS,
|
||||
.props_changed = card_props_changed,
|
||||
|
|
@ -1092,6 +1103,7 @@ static const struct acp_card_events card_events = {
|
|||
.port_available = card_port_available,
|
||||
.volume_changed = on_volume_changed,
|
||||
.mute_changed = on_mute_changed,
|
||||
.ext_vol_event_available = on_ext_vol_event_available,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue