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>
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>
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>
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>
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>
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>
The recent ncurses package provides ncurses*-config program to give the
proper cflags and libs. Let's use them if available.
Right now, the ncurses version (5) is hard-coded. It should be better
to be variable as well, but it'd be messy. Hope the ncurses version won't
change rapidly.