The procedures described here are for manipulating ALSA hardware controls. These typically (always?) correspond to LEDs on an audio-related device that are registered with ALSA. Following the conventions in the ALSA code, we refer to an ALSA control as a ctl to help distinguish it from input-related controls (buttons, knobs, etc.). These procedures are defined in the module ‘(librekontrol alsa)’.
The alsa-ctl record type contains the information required to manipulate an ALSA hardware control: numid, the control’s numeric ID; type, referring to the type of value the control can hold (boolean or integer); and descr, the control descriptor, used internally by Librekontrol.
Make a new alsa-ctl record for the hardware control with numeric ID numid of type type. descr should be initialized to ‘#f’.
Return ‘#t’ if x is a alsa-ctl record.
Return the numeric ID, type, or descriptor of alsa-ctl.
Set the descriptor of alsa-ctl
Bind symbol to an alsa-ctl record constructed from numid and type.
Open alsa-ctl in association with device, which has previously been opened via open-device (see Low-Level Devices).
set-ctl sets alsa-ctl to new-value, checking if it is open first. toggle-ctl toggles alsa-ctl’s current state between “on” and “off”.
Both procedures try to be flexible and reasonable about whether alsa-ctl is boolean- or integer-based, with regards to new-value type. For example, if alsa-ctl is an integer control, setting it to ‘#t’ or toggling it “on” simply sets it to its maximum integer value.
Turn off (or set to the minimum integer value) all hardware controls (alsa-ctl records) contained in the list ctls.