Next: , Previous: , Up: High-Level Configuration   [Contents][Index]

5.1.3 ALSA Hardware Controls

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)’.

Record type: alsa-ctl numid type descr

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.

Function: make-alsa-ctl numid type descr

Make a new alsa-ctl record for the hardware control with numeric ID numid of type type. descr should be initialized to ‘#f’.

Function: alsa-ctl? x

Return ‘#t’ if x is a alsa-ctl record.

Function: alsa-ctl-numid alsa-ctl
Function: alsa-ctl-type alsa-ctl
Function: alsa-ctl-descr alsa-ctl

Return the numeric ID, type, or descriptor of alsa-ctl.

Function: set-alsa-ctl-descr! alsa-ctl

Set the descriptor of alsa-ctl

Syntax: define-alsa-ctl symbol numid type

Bind symbol to an alsa-ctl record constructed from numid and type.

Syntax: open-alsa-ctl alsa-ctl device

Open alsa-ctl in association with device, which has previously been opened via open-device (see Low-Level Devices).

Syntax: set-ctl alsa-ctl new-value
Syntax: toggle-ctl alsa-ctl

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.

Syntax: turn-off-ctls ctls

Turn off (or set to the minimum integer value) all hardware controls (alsa-ctl records) contained in the list ctls.

Next: , Previous: , Up: High-Level Configuration   [Contents][Index]