summaryrefslogtreecommitdiff
path: root/alsamixer/mixer_widget.c
Commit message (Collapse)AuthorAgeFilesLines
* alsamixer: Use a struct for storing color attributesbraph2020-07-011-2/+2
| | | | | | | | | | | | | | | | | This commit is a preparation for the configuration file parser. The `int attr_*` variables have been moved into a separate struct. Members of that struct are alphabetically ordered, so an attribute can later be accessed by its name. Added `int get_color_pair(short fg, short bg)` for returning or creating a color pair number. Added call to `use_default_colors()` for enabling access to the terminal's default color (-1). Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: added mouse supportbraph2020-07-011-1/+88
| | | | | | | | | | | | | | | | | | Mouse support has been added for mixer_widget.c, card_select.c and proc_files.c. In the mixer widget the mouse is handled as follows: - After an element has been printed in mixer_display.c, a call to clickable_set() will store the coordinates of the drawn area plus the command enum that should be executed on click. An optional argument holds an index which points to the selected mixer control. - on_mouse_click() searches for a matching rectangle, focuses the mixer control and returns the command enum. In the menu widgets, the menu_driver() function handles mouse input. Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Replaced hardcoded keys by binding arraysbraph2020-07-011-127/+52
| | | | | | | | | | | | | | | This commit is a preparation for making keybindings configurable. The hardcoded keys in the switch statements of mixer_widget.c, textbox.c, proc_files.c and card_select.c have been replaced by command enums. The command that shall be executed is looked up in the arrays `mixer_bindings` and `textbox_bindings`. The channel_mask enum has been made public, since LEFT and RIGHT are used as command arguments in bindings.c. Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix gcc warningsJaroslav Kysela2018-10-141-1/+0
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix handling of removed controlsClemens Ladisch2012-10-191-12/+8
| | | | | | | | | When we get a notification that an element has been removed, we have to recreate our internal control representation to avoid accessing freed memory. (And the checking for SND_CTL_EVENT_MASK_REMOVE should actually be done correctly while we're at it.) Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: fix display of active/inactive controlsRaymond Yau2011-02-281-0/+11
| | | | | Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: use cubic scale for volume barsClemens Ladisch2010-12-061-76/+44
| | | | | | | | Instead of mapping the raw volume values linearly to the screen, use a mapping where the bar height is proportional to the audible volume, i.e., where the amplitude is the cube of the bar height. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: increase step size for big control value rangesClemens Ladisch2010-12-061-1/+3
| | | | | | | | | For controls with a big range, stepping through all values can become tedious and make it impossible to adjust the volume easily. Therefore, ensure that all steps are big enough so that the full range has at most one hundred steps. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: remove obsolete e-mailClemens Ladisch2010-11-101-2/+2
| | | | | | Tim Janik's e-mail address is no longer valid. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: show channel names for multichannel controlsClemens Ladisch2009-05-251-0/+680
For multichannel mixer controls, add the channel name to each screen control. Also make some other small changes. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>