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>
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>
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>
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>
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>
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>