summaryrefslogtreecommitdiff
path: root/alsamixer
Commit message (Collapse)AuthorAgeFilesLines
* alsamixer: add -B,--black-background optionJaroslav Kysela2023-02-102-2/+16
| | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/176 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: add alsamixer.rc.example fileJaroslav Kysela2022-05-312-1/+193
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/112 From: Bertram Felgenhauer / int-e / github Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Revert has_mouse() checkTakashi Iwai2022-01-281-1/+2
| | | | | | | | | has_mouse() function of ncurses doesn't seem working reliably. Revert the previous change for addressing the regressions. Fixes: 31820c5f239f ("alsamixer: Check the availability of mouse") BugLink: https://github.com/alsa-project/alsa-utils/issues/139 Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: Fix regression in color setupTakashi Iwai2022-01-204-7/+18
| | | | | | | | | | The recent change to add the background config broke the color setup via the config file due. Fix the regression by restoring the initialization order back again, and changing the logic for the default background color to be re-initializing color pairs instead. Link: https://github.com/alsa-project/alsa-utils/issues/137 Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: fix typo in man page (and/of -> and/or)Jaroslav Kysela2021-12-031-1/+1
| | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/110 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Allow setting the default background color in configTakashi Iwai2021-10-205-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | The recent commit c867aa8a84a7 ("alsamixer: use background color instead of COLOR_BLACK") changed the behavior of alsamixer to take the system default background color instead of black. This caused problems on the terminal setups that have bright background colors, e.g. yellow is very hard to read. It could be "fixed" by setting up the color configurations in ~/.config/alsamixer.rc, but this needs to change the all colors in every element, which is pretty cumbersome. Instead, this patch extends the config set command to allow user to specify the default background color. A user like me can create their own ~/.config/alsamixer.rc file containing the line set background black and the old good black background is back again. Note that, for achieving the above, we also had to shuffle the function call order, to parse the config at first, then initialize curses. This shouldn't matter for other behavior. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: Check the availability of mouseTakashi Iwai2021-10-201-1/+1
| | | | | | | Let's check the availiabiy via has_mouse(). Otherwise the program aborts unexpectedly just focusing on my rxvt terminal :-( Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Added configuration information to manual pagebraph2021-08-231-5/+206
| | | | | | | | Added sections FILES and CONFIGURATION. Removed section BUGS, because the described terminal issues have been fixed. Signed-off-by: braph <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: increase control device name buffer (sysdefault)Jaroslav Kysela2021-04-151-1/+1
| | | | | | | card_select.c:129:28: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 5 [-Wformat-overflow=] 129 | sprintf(buf, "sysdefault:%d", number); Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* amixer/alsamixer: use sysdefault:<CARD> devices instead hw:<CARD>Jaroslav Kysela2021-04-062-1/+9
| | | | | | | The alsa-lib 1.2.5 introduced a new scheme for the default control devices. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: use background color instead of COLOR_BLACKRyan Burns2021-03-051-4/+4
| | | | | | BugLink: https://github.com/alsa-project/alsa-utils/pull/77 Signed-off-by: Ryan Burns <rtburns@protonmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix shift in parse_words()Jaroslav Kysela2021-01-111-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: remove unused variable y in display_scroll_indicators()Jaroslav Kysela2021-01-111-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: remove dead fcn widget_handle_key() in widget.cJaroslav Kysela2021-01-111-7/+0
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Fix the mixer views description in man page積丹尼 Dan Jacobson2020-10-231-1/+1
| | | | | | | Fix grammar mess. From: Dan Jacobson <jidanni@jidanni.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: remove wrong free(buf) call in read_file()Jaroslav Kysela2020-07-011-1/+0
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: small optimizationsbraph2020-07-018-115/+58
| | | | | | | | | | | | | | | | | | | | | | | | textbox.c, mixer_display.c: - Replaced manual line drawing code `for (...) mvwaddch(...)` by the functions `mvwhline/mvwvline` provided by standard curses card_select.c, proc_files.c: - Moved duplicate code in the create() functions to menu_widget_create() in menu_widget.c card_select.c: - Removed redundant calls to sprintf() device_name.c: - Combined multiple calls to form_opts_off() - Recognize ASCII DEL (127) as backspace widget.c: - Uncommented code for setting a dummy key handler (all existing widgets do provide a key handling function) Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: added configuration file parserbraph2020-07-0111-40/+990
| | | | | | | | | | | | | | | | | Added configparser.c and curskey.c: - Lines starting with arbitrary whitespace + '#' are comments - Words in a command name don't have a fixed order (toggle_mute is the same as mute_toggle) Moved read_file() from textbox.c to utils.c, so configparser.c can make use of it. Added command line options: -f/-F to specify/disable configuration file -m/-M to enable/disable mouse Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Use a struct for storing color attributesbraph2020-07-018-158/+168
| | | | | | | | | | | | | | | | | 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-0112-59/+377
| | | | | | | | | | | | | | | | | | 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-018-207/+296
| | | | | | | | | | | | | | | 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 window_size_changed()braph2020-07-011-0/+6
| | | | | | | | Obtaining the new window size using TIOCGWINSZ and setting it using resize_term(), so getmaxyx() reports the actual terminal size. Signed-off-by: Benjamin Abendroth <braph93@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: suppress _XOPEN_SOURCE compile warningJaroslav Kysela2020-06-051-0/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Avoid empty initializer listMichael Forney2020-02-101-1/+1
| | | | | | | | To zero-initialize an object, use `{0}` instead. Signed-off-by: Michael Forney <mforney@mforney.org> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: Remove exp10 usageRosen Penev2019-09-031-3/+3
| | | | | | | exp10 is a GNU extension and not available everywhere (eg. uClibc-ng). Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: define _GNU_SOURCE to get exp10Jaroslav Kysela2019-01-182-6/+1
| | | | | | | | | | | | | | | Fixes Master, Headphones and Speaker stuck at -8 percentage after building with Clang 7.0.1 and getting warned about implicit declaration of exp10, which is behind _GNU_SOURCE as a non-standard feature. Thanks Takashi Iwai for the CFLAGS suggestion on the mailing list. GCC build is not affected, so not adding a compiler check to the configure script. uClibc-ng has got exp10 since 1.0.12, so the fallback macro is no longer needed. However, alsa-utils relies on gettext so might need further patches to actually work on uClibc systems. Signed-off-by: makepost <makepost@firemail.cc> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix gcc warningsJaroslav Kysela2018-10-147-10/+5
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: include missing mixer_controls.hJaroslav Kysela2014-06-251-0/+1
|
* Makefiles - use AM_CPPFLAGS instead INCLUDESJaroslav Kysela2014-05-071-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Use isatty() to check the terminal (interactive) availabilityJaroslav Kysela2013-03-221-0/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix handling of removed controlsClemens Ladisch2012-10-194-14/+17
| | | | | | | | | 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>
* amixer, alsamixer: Add description of volume-mappingTakashi Iwai2012-03-191-0/+13
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: Fix X-win related crash for PulseAudio plugin (bad linking)Jaroslav Kysela2011-11-024-5/+5
| | | | | | | | | | | | | | | | | A lot of reports that alsamixer crashes in X terminal when the PulseAudio CTL plugin is activated were entered to the tracking systems. I figured that there is a linking clash for the shutdown() function. The shutdown() function in glibc is socket related, but the alsamixer code redefines this function and appearently that under some linking circumstances - which PA client invokes during the runtime dynamic linking - the wrong function is called. This patch, for safety, renames the shutdown() function from alsamixer to app_shutdown(), but it might make sense to figure the real linking culprit to avoid future surprises. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: Fix 64bit issuesTakashi Iwai2011-06-031-3/+3
| | | | | | lrint() returns a long int. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: fix build on uClibcPeter Korsgaard2011-03-141-0/+5
| | | | | | | | | exp10 is a glibc extension, which isn't supported on uClibc. Luckily, exp10() is trivial to compute based on exp(), so add a wrapper for the uClibc case. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* 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-065-113/+260
| | | | | | | | 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-12-061-1/+1
| | | | | | Remove the no-longer-valid e-mail address also from the man page. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: remove obsolete e-mailClemens Ladisch2010-11-105-6/+6
| | | | | | Tim Janik's e-mail address is no longer valid. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: handle out-of-range volume valuesClemens Ladisch2010-02-221-1/+12
| | | | | | | | Ensure that control volume values are in their allowed range; otherwise, the displayed values could be outside the range 0..100 and mess up the layout. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: fix division by zeroClemens Ladisch2010-02-191-0/+2
| | | | | | | | The attempt to divide by max-min fails if a control has only one valid value. In this case, adjust the maximum so that the computation can succeed; the control will look like 0%. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: Improve set_escdelay() function availability detectionv1.0.21Jaroslav Kysela2009-08-311-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: fix display of inactive volume barClemens Ladisch2009-06-191-2/+4
| | | | | | | Fix the volume bar color selection logic so that the current attribute is used for inactive controls. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: rename attr to chClemens Ladisch2009-06-191-9/+8
| | | | | | | Rename the attr variable because it contains not only the character's attributes but also the character itself. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer - Tricolorize volume barsTakashi Iwai2009-06-183-18/+51
| | | | | | A little of bit of Italian taste was missing... Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: update man pageClemens Ladisch2009-06-021-1/+1
| | | | | | Update man page for change in "CAPTURE" field. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer: fix text box clipping with multi-column charactersClemens Ladisch2009-05-281-1/+1
| | | | | | | | When a multi-column character would straddle the left window border of a text box, we have to take the inserted space character into account when we compute how many characters fit into the rest of the line. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* alsamixer - Fix uninitialized variable warningTakashi Iwai2009-05-271-0/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsamixer: show channel names for multichannel controlsClemens Ladisch2009-05-2531-2509/+3942
| | | | | | | | | 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>