Blame alsamixer/bindings.h

Packit Service a9274b
#ifndef BINDINGS_H_INCLUDED
Packit Service a9274b
#define BINDINGS_H_INCLUDED
Packit Service a9274b
Packit Service a9274b
#include CURSESINC
Packit Service a9274b
#include <menu.h>
Packit Service a9274b
#include <stdint.h>
Packit Service a9274b
Packit Service a9274b
/* Commands are stored in an uint16_t and may take an unsigned numeric argument.
Packit Service a9274b
 * The command itself is stored in the lower 7 bits, the argument is stored
Packit Service a9274b
 * in the higher 9 bits.
Packit Service a9274b
 *
Packit Service a9274b
 * The value `0` is used for no (unbound) command. */
Packit Service a9274b
Packit Service a9274b
typedef uint16_t command_enum;
Packit Service a9274b
extern command_enum mixer_bindings[KEY_MAX];
Packit Service a9274b
/* No need for a 16bit type, since textbox commands don't take arguments */
Packit Service a9274b
extern uint8_t textbox_bindings[KEY_MAX];
Packit Service a9274b
Packit Service a9274b
#define CMD_WITH_ARG(CMD, ARG) \
Packit Service a9274b
	((CMD) + ((ARG) << 9))
Packit Service a9274b
Packit Service a9274b
#define CMD_GET_COMMAND(CMD) \
Packit Service a9274b
	((CMD) & 0x1FF)
Packit Service a9274b
Packit Service a9274b
#define CMD_GET_ARGUMENT(CMD) \
Packit Service a9274b
	((CMD) >> 9)
Packit Service a9274b
Packit Service a9274b
enum mixer_command {
Packit Service a9274b
	// `CMD % 4` should produce the channel mask
Packit Service a9274b
	CMD_MIXER_CONTROL_DOWN_LEFT = 1,
Packit Service a9274b
	CMD_MIXER_CONTROL_DOWN_RIGHT,
Packit Service a9274b
	CMD_MIXER_CONTROL_DOWN,
Packit Service a9274b
	CMD_MIXER_CONTROL_UP_LEFT = 5,
Packit Service a9274b
	CMD_MIXER_CONTROL_UP_RIGHT,
Packit Service a9274b
	CMD_MIXER_CONTROL_UP,
Packit Service a9274b
	CMD_MIXER_CONTROL_SET_PERCENT_LEFT = 9,
Packit Service a9274b
	CMD_MIXER_CONTROL_SET_PERCENT_RIGHT,
Packit Service a9274b
	CMD_MIXER_CONTROL_SET_PERCENT,
Packit Service a9274b
Packit Service a9274b
	// Keep those in the same order as displayed on screen
Packit Service a9274b
	CMD_MIXER_HELP,
Packit Service a9274b
	CMD_MIXER_SYSTEM_INFORMATION,
Packit Service a9274b
	CMD_MIXER_SELECT_CARD,
Packit Service a9274b
	CMD_MIXER_CLOSE,
Packit Service a9274b
Packit Service a9274b
	CMD_MIXER_TOGGLE_VIEW_MODE,
Packit Service a9274b
	CMD_MIXER_SET_VIEW_MODE,
Packit Service a9274b
	CMD_MIXER_PREVIOUS,
Packit Service a9274b
	CMD_MIXER_NEXT,
Packit Service a9274b
	CMD_MIXER_FOCUS_CONTROL,
Packit Service a9274b
	CMD_MIXER_TOGGLE_MUTE,
Packit Service a9274b
	CMD_MIXER_TOGGLE_CAPTURE,
Packit Service a9274b
	CMD_MIXER_BALANCE_CONTROL,
Packit Service a9274b
	CMD_MIXER_REFRESH,
Packit Service a9274b
Packit Service a9274b
	// Mouse
Packit Service a9274b
	CMD_MIXER_MOUSE_CLICK_MUTE,
Packit Service a9274b
	CMD_MIXER_MOUSE_CLICK_VOLUME_BAR,
Packit Service a9274b
	CMD_MIXER_MOUSE_CLICK_CONTROL_ENUM,
Packit Service a9274b
};
Packit Service a9274b
Packit Service a9274b
enum textbox_command {
Packit Service a9274b
	/* Since these commands are also used by the menu widget we make use of
Packit Service a9274b
	 * the menu_driver() request constants.
Packit Service a9274b
	 * KEY_MAX is substracted so the value fits in 8 bits. */
Packit Service a9274b
	CMD_TEXTBOX___MIN_MENU_COMMAND = MIN_MENU_COMMAND - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_TOP = REQ_FIRST_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_BOTTOM = REQ_LAST_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_LEFT = REQ_LEFT_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_RIGHT = REQ_RIGHT_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_UP = REQ_UP_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_DOWN = REQ_DOWN_ITEM - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_PAGE_DOWN = REQ_SCR_DPAGE - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_PAGE_UP = REQ_SCR_UPAGE - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX___MAX_MENU_COMMAND = MAX_MENU_COMMAND - KEY_MAX,
Packit Service a9274b
	CMD_TEXTBOX_PAGE_LEFT,
Packit Service a9274b
	CMD_TEXTBOX_PAGE_RIGHT,
Packit Service a9274b
	CMD_TEXTBOX_CLOSE,
Packit Service a9274b
};
Packit Service a9274b
Packit Service a9274b
#endif