Lines Matching +full:control +full:- +full:parent
1 .\"-
2 .\" Copyright (c) 2021-2022 Christos Margiolis <christos@FreeBSD.org>
51 Mixer library (libmixer, -lmixer)
63 .Fn mixer_add_ctl "struct mix_dev *parent" "int id" "const char *name" \
109 .Bd -literal
139 .Bl -tag -width "f_default"
203 .Bd -literal
205 struct mixer *parent_mixer; /* parent mixer */
217 TAILQ_HEAD(mix_ctlhead, mix_ctl) ctls; /* control list */
223 .Bl -tag -width "parent_mixer"
229 .Bd -ragged
241 Left and right-ear volumes.
242 Although the OSS API stores volumes in integers from 0-100, \
243 we normalize them to 32-bit floating point numbers.
248 Number of user-defined mixer controls associated with the device.
250 A tail queue containing user-defined mixer controls.
252 .Ss User-defined mixer controls
253 Each mixer device can have user-defined controls.
254 The control structure is defined as follows:
255 .Bd -literal
257 struct mix_dev *parent_dev; /* parent device */
258 int id; /* control id */
259 char name[NAME_MAX]; /* control name */
260 int (*mod)(struct mix_dev *, void *); /* modify control values */
261 int (*print)(struct mix_dev *, void *); /* print control */
267 .Bl -tag -width "parent_dev"
269 Pointer to the device the control is attached to.
271 Control ID assigned by the caller.
273 a control the same ID in case the caller has to choose controls using their ID.
275 Control name.
280 Function pointer to a control modification function.
283 each mixer control's values can be modified.
284 For example, if we have a volume control, the
288 Function pointer to a control print function.
351 .Bl -tag -width MIX_TOGGLEMUTE -offset indent
368 .Bl -tag -width MIX_REMOVERECSRC -offset indent
393 .Bl -tag -width "MIX_MODE_MIXER" -offset indent
418 can be either -1, in which case
443 macro normalizes a value to 32-bit floating point number.
454 function creates a control and attaches it to the device specified in the
455 .Ar parent
468 functions removes a control from the device its attached to.
472 function searches for a control in the device specified in the
475 The search is done using the control's ID.
481 but the search is done using the control's name.
497 functions return 0 or positive values on success and -1 on failure.
510 .Bd -literal
520 if ((m->dev = mixer_get_dev_byname(m, dev_name)) < 0)
531 .Bd -literal
537 TAILQ_FOREACH(dp, &m->devs, devs) {
538 m->dev = dp; /* Select device. */
539 if (M_ISMUTE(m, dp->devno))
542 warn("cannot mute device: %s", dp->name);
548 .Bd -literal
558 TAILQ_FOREACH(dp, &m->devs, devs) {
559 if (M_ISRECSRC(m, dp->devno))
561 dp->name, dp->vol.left, dp->vol.right);
567 .Bd -literal