alsa-utils/alsamixer/mixer_widget.h
braph 6e9e84ba60 alsamixer: Replaced hardcoded keys by binding arrays
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>
2020-07-01 16:10:35 +02:00

43 lines
867 B
C

#ifndef MIXER_WIDGET_H_INCLUDED
#define MIXER_WIDGET_H_INCLUDED
#include CURSESINC
#include <alsa/asoundlib.h>
#include "widget.h"
enum view_mode {
VIEW_MODE_PLAYBACK,
VIEW_MODE_CAPTURE,
VIEW_MODE_ALL,
VIEW_MODE_COUNT,
};
enum channel_mask {
LEFT = 1,
RIGHT = 2,
};
extern snd_mixer_t *mixer;
extern char *mixer_device_name;
extern bool unplugged;
extern struct widget mixer_widget;
extern enum view_mode view_mode;
extern int focus_control_index;
extern snd_mixer_selem_id_t *current_selem_id;
extern unsigned int current_control_flags;
extern bool control_values_changed;
extern bool controls_changed;
void create_mixer_object(struct snd_mixer_selem_regopt *selem_regopt);
void create_mixer_widget(void);
void mixer_shutdown(void);
void close_mixer_device(void);
bool select_card_by_name(const char *device_name);
void refocus_control(void);
#endif