module/alsa: add support for capture devices

This mostly comes down to tracking whether each channel is a playback,
or capture channel, and using the appropriate APIs when dealing with
it.

Some cleanup related to this:

* Add a channel struct, for per-channel data. Previously, our channel
  list was just a list of ALSA channel IDs.
* We now store current volume per-channel (but volume min/max is
  per-device)
* Muted state is stored per-channel
* Track both the device’s playback and capture volume ranges, as well
  as whether the device *has* playback or capture volume.
* Get the playback/capture volume ranges once, during init, instead of
  at each update.
* Use struct pointers for the volume/muted channels. This way we don’t
  have to iterate all channels and to string comparisons on the name
  each time we update our state.
This commit is contained in:
Daniel Eklöf 2021-08-26 10:55:10 +02:00
parent 7c7c4e7ce9
commit d1c7647b03
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 195 additions and 90 deletions

View file

@ -29,6 +29,7 @@
channels to use as source for the volume level and muted state.
* foreign-toplevel: Wayland module that provides information about
currently opened windows.
* alsa: support for capture devices.
### Changed